summaryrefslogtreecommitdiffstats
path: root/lib/class/song.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-15 06:12:52 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-15 06:12:52 +0000
commit063e67887b48ea9ba5570638dcfaf5439f0337da (patch)
tree6c8e958435d96505408f9dd63e76e038220f16bc /lib/class/song.class.php
parentb469b70195a92f7087d3b9c15bbc10797e0411a7 (diff)
downloadampache-063e67887b48ea9ba5570638dcfaf5439f0337da.tar.gz
ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.tar.bz2
ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.zip
browse by title and page header hotness
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r--lib/class/song.class.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index d85e0a53..b437692a 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -806,6 +806,54 @@ class Song {
} // end stream_cmd
+ /**
+ * get_sql_from_match
+ * This is specificly for browsing it takes the match and returns the sql call that we want to use
+ * @package Song
+ * @catagory Class
+ */
+ function get_sql_from_match($match) {
+
+ switch ($match) {
+ case 'Show_All':
+ case 'show_all':
+ $sql = "SELECT id FROM song";
+ break;
+ case 'Browse':
+ case 'show_genres':
+ $sql = "SELECT id FROM song";
+ break;
+ default:
+ $sql = "SELECT id FROM song WHERE title LIKE '" . sql_escape($match) . "%'";
+ break;
+ } // end switch on match
+
+ return $sql;
+
+ } // get_sql_from_match
+
+ /**
+ * get_genres
+ * this returns an array of songs based on a sql statement that's passed
+ * @package songs
+ * @catagory Class
+ */
+ function get_songs($sql) {
+
+ $db_results = mysql_query($sql, dbh());
+
+ $results = array();
+
+ while ($r = mysql_fetch_assoc($db_results)) {
+ $results[] = $r['id'];
+ }
+
+ return $results;
+
+ } // get_genres
+
+
+
} // end of song class
?>