diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-26 21:42:25 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-12-26 21:42:25 +0000 |
commit | 380a8615ae97295f650699e8ecdf478e54f75d74 (patch) | |
tree | ebf352226fccaabacda57f9315e8d8f898145e58 /modules | |
parent | 7ea54a5c7127d48d300128869105a1e6fb2928f9 (diff) | |
download | ampache-380a8615ae97295f650699e8ecdf478e54f75d74.tar.gz ampache-380a8615ae97295f650699e8ecdf478e54f75d74.tar.bz2 ampache-380a8615ae97295f650699e8ecdf478e54f75d74.zip |
updated show_genre_pulldown, hopefully speeding it up
Diffstat (limited to 'modules')
-rw-r--r-- | modules/lib.php | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/modules/lib.php b/modules/lib.php index e37acd49..e887ac54 100644 --- a/modules/lib.php +++ b/modules/lib.php @@ -75,94 +75,6 @@ function show_flagged_popup($reason,$label='value', $name='flagged_type', $other /* - * show_genre_pulldown() - * - * Set complete=1 if you want the entire genre list - * - */ - -function show_genre_pulldown ($genre, $complete, $lines= "'10' multiple='multiple'") { - - $dbh = dbh(); - - // find the genres we have in use - if ( $complete ) { - $sql = "SELECT id FROM genre ORDER BY name"; - } - else { - $sql = "SELECT DISTINCT song.genre FROM genre, song" . - " WHERE song.genre = genre.id" . - " ORDER BY genre.name"; - } - - $db_result = mysql_query($sql, $dbh); - - echo "<select name=\"genre[]\" size=".$lines.">\n"; - - if ( ! $complete ) { - $genre_info = get_genre_info( -1 ); - if ( $genre == -1 ) { - echo " <option value=\"-1\" selected=\"selected\">${genre_info[0]} - (${genre_info[1]})</option>\n"; - } - else { - echo " <option value=\"-1\">${genre_info[0]} - (${genre_info[1]})</option>\n"; - } - } - - while ( $r = mysql_fetch_row($db_result) ) { - // $r[0] = genre id - list($genre_name, $genre_count) = get_genre_info($r[0]); - $genre_name = htmlspecialchars($genre_name); - - if ( $genre == $r[0] ) { - echo " <option value=\"${r[0]}\" selected=\"selected\">$genre_name - ($genre_count)</option>\n"; - } - else { - echo " <option value=\"${r[0]}\">$genre_name - ($genre_count)</option>\n"; - } - } - echo " </select>\n"; - -} // show_genre_pulldown() - -/* - * update_counter() - * - * update what song/album/artist has just been played - * - */ - -function update_counter ($type, $id, $dbh=0) { - - global $settings; - if (!is_resource($dbh)) { - $dbh = dbh(); - } - - // from hopson: these queries will be very useful for generating overall statistics: - /* - SELECT song.title,SUM(object_count.count) FROM song,object_count WHERE object_count.object_type = 'song' AND object_count.object_id = song.id GROUP BY song.id; - - SELECT album.name,SUM(object_count.count) FROM album,object_count WHERE object_count.object_type = 'album' AND object_count.object_id = album.id GROUP BY album.id; - - SELECT artist.name,SUM(object_count.count) FROM artist,object_count WHERE object_count.object_type = 'artist' AND object_count.object_id = artist.id GROUP BY artist.id; - - SELECT playlist.name,SUM(object_count.count) FROM playlist,object_count WHERE object_count.object_type = 'playlist' AND object_count.object_id = playlist.id GROUP BY playlist.id; - */ - - if ( $type == 'song' ) { - $sql = "UPDATE $type SET times_played = times_played + 1 WHERE id = '$id'"; - } - else { - $sql = "UPDATE $type SET times_played = times_played + 1 WHERE id = '$id'"; - } - - $db_result = mysql_query($sql, $dbh); -} // update_counter() - - - -/* * delete_user_stats() * * just delete stats for specific users or all of them |