<?php include 'header.php'; // Checks if the artist name has been submitted if (!($artistName = getReqArtist())) { $noInput = true; } else { $noInput = false; } // Gets the artist info // if (!$noInput) { $artistInfo = getSingleRow($dbHandle, "artist_list", "artist_name", $artistName); $artResult = $dbHandle->query("SELECT * FROM artist_artwork_list WHERE artist_id='" . $artistInfo['artist_id'] . "' AND image_size='" . $IMAGE_SIZE5 . "'"); $artReturn = $artResult->fetch_array(MYSQLI_BOTH); } // Constructs the query to get both album info and artwork // $albumQuery = "SELECT * FROM " . getJoinTable("album_list", "album_artwork_list") . " \n WHERE " . getJoinMatch("album_list", "album_artwork_list", "album_id") . " \n AND " . getImageType($IMAGE_SIZE3) . " \n AND " . getSectionCriteria("album_title"); if (!$noInput) { $albumQuery .= " AND album_list.artist_id='" . $artistInfo['artist_id'] . "'"; } $albumQuery .= " " . getSortCriteria("album_title"); // Gets the number of albums // $totalResult = $dbHandle->query($albumQuery); $totalCount = $totalResult->num_rows; mysqli_free_result($totalResult); $albumQuery .= " " . getPageCriteria($totalCount, $MAX_ITEMS_PER_PAGE, true); $albumResult = $dbHandle->query($albumQuery); ?> <a id="topofpage"></a>
function getSortNav() { $artist = getReqArtist(); $album = getReqAlbum(); $pageName = getReqPageName(false); $section = getReqSection(); $page = getReqPage(); if (orderByAdded() || orderByFav()) { constructLink($pageName, $artist, $album, $section, null, 1, "None"); } else { echo "<span class=\"current\">None</span>"; } echo " | "; if (!orderByAdded()) { constructLink($pageName, $artist, $album, $section, "added", 1, "Recently added"); } else { echo "<span class=\"current\">Recently added</span>"; } echo " | "; if (!orderByFav()) { constructLink($pageName, $artist, $album, $section, "fav", 1, "Most favourited"); } else { echo "<span class=\"current\">Most favourited</span>"; } }