0 ) $where = "rmx_songs.id = '".escape_string($_REQUEST['id'])."'"; else if( isset($_REQUEST['e']) && strlen($_REQUEST['e'])>0 && checkEmail($_REQUEST['e']) ) $where = "rmx_songs.email = '".escape_string($_REQUEST['e'])."'"; $pager_attr = array(); $query = "SELECT count(rmx_votes.song) AS song_votes, rmx_songs.trackname, rmx_songs.artist, rmx_songs.id, rmx_songs.comment, rmx_songs.plays AS song_plays, DATE_FORMAT( rmx_songs.created, '%a %b %e, %Y %l:%i %p' ) AS date_formatted, rmx_genres.name AS genre FROM rmx_songs LEFT JOIN rmx_votes ON rmx_votes.song = rmx_songs.id LEFT JOIN rmx_genres ON rmx_songs.genre_id = rmx_genres.id WHERE rmx_songs.state = 2 ".(strlen($where)>0? " AND ".$where: '')." GROUP BY rmx_songs.id"; $attrs['sorts'] = array( 'rmx_songs.id DESC'=>'Most Recent', 'rmx_songs.artist, rmx_songs.id DESC'=>'Artist', 'rmx_songs.trackname, rmx_songs.id DESC'=>'Title', 'song_plays DESC, song_votes DESC, rmx_songs.id DESC'=>'Most Plays', 'song_votes DESC, song_plays DESC, rmx_songs.id DESC'=>'Most Votes' ); $attrs['sort_key'] = get_sort_key_with_default( "rmx_songs.id DESC", $attrs['sorts'], 'rmx' ); $attrs['sort_id'] = 'rmx'; if( strlen($where)>0 ) $attrs['noheaders'] = true; $query .= (strlen($attrs['sort_key'])? " ORDER BY ".$attrs['sort_key']: ""); $remixes = rmx_paged_results( $query, 'list_remix.inc.html', 5, 'rmx', $attrs ); $out = file_get_contents('remixes.inc.html'); $out = str_replace( '{msg}', $msg, $out ); $out = str_replace( '{remixes}', $remixes, $out ); setActiveTab( 'remixes' ); setSectionTitle( 'Listen to remixes that have been submitted...' ); setSectionContent( $out ); printPage(); ?>