import_session_view(); // if we are returning if ($_REQUEST['keep_view']) { $view->initialize(); } // If we aren't keeping the view then initlize it elseif ($sql) { $db_results = mysql_query($sql, dbh()); $total_items = mysql_num_rows($db_results); if ($match != "Show_all") { $offset_limit = $_SESSION['userdata']['offset_limit']; } $view = new View($sql, 'albums.php','name',$total_items,$offset_limit); } else { $view = false; } if ($view->base_sql) { $albums = get_albums($view->sql); show_albums($albums,$view); } break; case 'artist': show_alphabet_list('artists','artists.php'); show_alphabet_form('',_("Show Artists starting with"),"artists.php?action=match"); show_artists(); break; case 'genre': /* Create the Needed Object */ $genre = new Genre(); /* Setup the View object */ $view = new View(); $view->import_session_view(); $genre->show_match_list($_REQUEST['match']); $sql = $genre->get_sql_from_match($_REQUEST['match']); if ($_REQUEST['keep_view']) { $view->initialize(); } else { $db_results = mysql_query($sql, dbh()); $total_items = mysql_num_rows($db_results); $offset_limit = 999999; if ($match != 'Show_All') { $offset_limit = $_SESSION['userdata']['offset_limit']; } $view = new View($sql, 'browse.php?action=genre','name',$total_items,$offset_limit); } if ($view->base_sql) { $genres = $genre->get_genres($view->sql); show_genres($genres,$view); } break; case 'song_title': /* Create the Needed Object */ $song = new Song(); /* Setup the View Object */ $view = new View(); $view->import_session_view(); $match = scrub_in($_REQUEST['match']); show_alphabet_list('song_title','browse.php',$match,'song_title'); /* Detect if it's Browse, and if so don't fill it in */ if ($match == 'Browse') { $match = ''; } show_alphabet_form($match,_('Show Titles Starting With'),"browse.php?action=song_title&match=$match"); $sql = $song->get_sql_from_match($_REQUEST['match']); if ($_REQUEST['keep_view']) { $view->initialize(); } else { $db_results = mysql_query($sql, dbh()); $total_items = mysql_num_rows($db_results); $offset_limit = 999999; if ($match != 'Show All') { $offset_limit = $_SESSION['userdata']['offset_limit']; } $view = new View($sql, 'browse.php?action=song_title','title',$total_items,$offset_limit); } if ($view->base_sql) { $songs = $song->get_songs($view->sql); show_songs($songs); } break; case 'catalog': break; /* Throw recently added, updated here */ default: /* Show Most Popular artist/album/songs */ show_all_popular(); /* Show Recent Additions */ show_all_recent(); break; } // end Switch $action /* Show the Footer */ show_footer(); ?>