Example #1
0
        // while we've got the 'new' song in old the array
    }
    // end if we've got a cooldown
}
// if democratic ID passed
/**
 * if we are doing random let's pull the random object
 */
if ($random) {
    if ($_REQUEST['start'] < 1) {
        if (isset($_REQUEST['random_type'])) {
            $rtype = $_REQUEST['random_type'];
        } else {
            $rtype = $type;
        }
        $oid = Random::get_single_song($rtype);
        if ($oid) {
            // Save this one in case we do a seek
            $_SESSION['random']['last'] = $oid;
        }
    } else {
        $oid = $_SESSION['random']['last'];
    }
}
// if random
if ($type == 'song') {
    /* Base Checks passed create the song object */
    $media = new Song($oid);
    $media->format();
} else {
    if ($type == 'song_preview') {
            $oid = $democratic->get_next_object($song_cool_check);
            if ($song_cool_check >= '5') {
                break;
            }
        }
        // while we've got the 'new' song in old the array
    }
    // end if we've got a cooldown
}
// if democratic ID passed
/**
 * if we are doing random let's pull the random object
 */
if ($random) {
    if ($_REQUEST['start'] < 1) {
        $oid = Random::get_single_song($_REQUEST['random_type']);
        // Save this one in case we do a seek
        $_SESSION['random']['last'] = $oid;
    } else {
        $oid = $_SESSION['random']['last'];
    }
}
// if random
if ($type == 'song') {
    /* Base Checks passed create the song object */
    $media = new Song($oid);
    $media->format();
} else {
    if ($type == 'song_preview') {
        $media = new Song_Preview($oid);
        $media->format();