" . htmlspecialchars($artist['prefix']) . " " . htmlspecialchars($artist['name']) . ""; return $artist; } // format_artist /*! @function show_artists @discussion takes a match and accounts for the possiblity of a view then displays _many_ artists */ function show_artists ($match = '') { $dbh = dbh(); $view = new View(); $view->import_session_view(); // Check for the view object... if ($_REQUEST['keep_view']) { $view->initialize(); } // If there isn't a view object we need to create a new one.. else { if ( isset($match) && $match != '' ) { $query = "SELECT id,name FROM artist " . " WHERE name LIKE '$match%' "; } else { $query = "SELECT id FROM artist "; } $db_results = mysql_query($query, $dbh); $total_items = mysql_num_rows($db_results); if ($_REQUEST['match'] === "Show_all") { $offset_limit = 999999; } else { $offset_limit = $_SESSION['userdata']['offset_limit']; } $view = new View($query,'artists.php','name',$total_items,$offset_limit); } // end if creating view object if (is_array($match)) { $artists = $match; $_SESSION['view_script'] = false; } $db_results = mysql_query($view->sql, $dbh); while ($r = @mysql_fetch_array($db_results)) { //FIXME: This seriously needs to be updated to use the artist object $artist_info = get_artist_info($r[0]); $artist = format_artist($artist_info); // Only Add this artist if there is information to go along with it if ($artist_info) { $artists[] = $artist; } } if (count($artists)) { require ( conf('prefix') . "/templates/show_artists.inc"); } } // show_artists ?>