diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-15 06:12:52 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-15 06:12:52 +0000 |
commit | 063e67887b48ea9ba5570638dcfaf5439f0337da (patch) | |
tree | 6c8e958435d96505408f9dd63e76e038220f16bc /lib | |
parent | b469b70195a92f7087d3b9c15bbc10797e0411a7 (diff) | |
download | ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.tar.gz ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.tar.bz2 ampache-063e67887b48ea9ba5570638dcfaf5439f0337da.zip |
browse by title and page header hotness
Diffstat (limited to 'lib')
-rw-r--r-- | lib/artist.lib.php | 2 | ||||
-rw-r--r-- | lib/class/song.class.php | 48 |
2 files changed, 50 insertions, 0 deletions
diff --git a/lib/artist.lib.php b/lib/artist.lib.php index 3e8964c6..f2857921 100644 --- a/lib/artist.lib.php +++ b/lib/artist.lib.php @@ -115,6 +115,8 @@ function show_artists ($match = '') { } if (count($artists)) { + /* Ack horrible hack :( */ + $GLOBALS['view'] = $view; require ( conf('prefix') . "/templates/show_artists.inc"); } 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 ?> |