Location: PHPKode > projects > Axis Groupware > musiclib/top.php
<?
# recent.php
#
# Shows most recently added or modified Albums
#
$phpgw_info["flags"] = array ("currentapp" => "musiclib",
							 "enable_nextmatchs_class" => True);
$GLOBALS['phpgw_info']['cursor_focus'] = "document.defaultsearch.searchFor.focus();
										  document.defaultsearch.searchFor.select();";
 
include ("../header.inc.php"); #PHP Groupware header

include ("inc/config.inc.php");
include ("inc/functions.inc.php");
include ("inc/sidebar.inc.php");

if ($mode == 'album')
{
	$title = "Most Popular Albums";
}
else if ($mode == 'song')
{
	$title = "Most Popular Songs";
}
else 
{
	$title = "Most Popular Misc";
}

include ("inc/header.inc.php");

switch ($mode)
{
	case 'album':
        $query = construct_album_select("ORDER BY ".$musiclib['tables']['albums'].".times_album_played "
        								."DESC LIMIT ".$musiclib['config']['top_albums']);
                
        echo "<b><font size=2>The ".$musiclib['config']['top_albums']
        	." most popular Albums:</font></b><BR><BR>\n";
        
        #echo $query;
        list_music('album','songs',$query, "no", "yes");
		break;
	case 'song':
        $query = construct_song_select("WHERE repository=1 ORDER BY ".$musiclib['tables']['songs'].".times_played "
        								."DESC LIMIT ".$musiclib['config']['top_songs']);
                
        echo "<b><font size=2>The ".$musiclib['config']['top_songs']
        	." most popular Songs from Albums:</font></b><BR><BR>\n";
        
        #echo $query;
        list_music('song','songs',$query, "no", "yes");
		break;
	case 'misc':
	
        $query = construct_song_select("WHERE repository=2 ORDER BY ".$musiclib['tables']['songs'].".times_played "
        								."DESC LIMIT ".$musiclib['config']['top_misc']);
                
        echo "<b><font size=2>The ".$musiclib['config']['top_misc']
        	." most popular Misc songs:</font></b><BR><BR>\n";
        
        #echo $query;
        list_music('misc','songs',$query, "no", "yes");
		break;
	default:
}

#include ("inc/footer.inc.php");
?>
Return current item: Axis Groupware