Example #1
0
<?php

// This function is used to display tracks
// Depending on the input value of $_GET['album'] it will display all if no input or
// individual tracks depending on the album
include 'header.php';
// Checks if there is any album input //
if (!($albumName = getReqAlbum())) {
    $noInput = true;
} else {
    $noInput = false;
}
// Starts the base query //
$trackQuery = "SELECT * FROM track_list";
// If there is input, it will get the album info //
if (!$noInput) {
    if ($albumInfo = getSingleRow($dbHandle, "album_list", "album_title", $albumName)) {
        $artistInfo = getSingleRow($dbHandle, "artist_list", "artist_id", $albumInfo['artist_id']);
    }
}
// Adds a album id depending on the input //
if (!$noInput) {
    if (!$albumInfo || !$artistInfo) {
        $trackQuery .= " WHERE album_id=0";
        $valid = false;
    } else {
        $valid = true;
        $trackQuery .= " WHERE album_id=\"" . $albumInfo['album_id'] . "\"";
    }
}
if ($noInput) {
Example #2
0
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>";
    }
}