Пример #1
0
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
if (!is_null($json)) {
    try {
        if ($playlist_empty && $something_added) {
            $play = get_playback();
            $play->play();
            $play->disconnect();
        }
        $json["status"] = $pl->getStatus();
        if (isset($_GET['plchanges']) && is_numeric(trim($_GET['plchanges'])) && $_GET['plchanges'] != $json['status']['playlist']) {
            $res = $pl->getChanges(trim($_GET['plchanges']), true);
            if ($res && isset($res['file']) && is_array($res['file'])) {
                if (isset($_GET['pmax']) && isset($_GET['page'])) {
                    $arr = $res['file'];
                    $max = intval($_GET['pmax']);
                    $page = intval($_GET['page']);
                    $start = $max * $page;
                    $end = $start + $max;
                    $ret = array();
                    foreach ($res['file'] as $f) {
Пример #2
0
/* If you're using a password you have a little case with specifying the password thing
 * The only solution as of yet is to not require a password to see now playing
 *
 * This does not grant access to anything else though 
 *
 * Just uncomment this line if that is something you want to do, I might add this option to the 
 * configure screen some day though
 *
 */
$no_require_login = "******";
require_once "../inc/base.php";
$iamincluded = true;
require_once "../player/metadata.php";
header("Content-Type: text/plain");
try {
    $pl = get_playback();
    $info = $pl->getCurrentSong();
    $pl->disconnect();
    $rlyric = "";
    if (isset($info['Artist']) && isset($info['Title'])) {
        $file = get_lyric_filename($info['Artist'], $info['Title']);
        $lyric = false;
        if (file_exists($file)) {
            $lyric = _get_lyric_cache($file, $info['file']);
        } else {
            $lyric = @_get_lyric_lyricwiki($info['Artist'], $info['Title'], $info['file']);
        }
        if ($lyric !== FALSE) {
            $lyric = simplexml_load_string($lyric);
            if ($lyric && $lyric->result->lyric) {
                $lyric = (string) $lyric->result->lyric;
Пример #3
0
include "mysql_login.php";
$game_id = (int) $_GET["game_id"];
if ($game_id == 0) {
    echo "No game_id given.\n";
} else {
    $query = "SELECT\n      g.*,\n      u1.username AS player_one,\n      u2.username AS player_two,\n      g.player_one as player_one_id,\n      g.player_two as player_two_id,\n      s1.user_id as user_one_id,\n      s2.user_id as user_two_id\n    FROM games g\n    INNER JOIN submissions s1 ON g.player_one = s1.submission_id\n    INNER JOIN users u1 ON s1.user_id = u1.user_id\n    INNER JOIN submissions s2 ON g.player_two = s2.submission_id\n    INNER JOIN users u2 ON s2.user_id = u2.user_id\n    WHERE g.game_id = {$game_id}";
    $result = mysql_query($query);
    if (!$result || mysql_num_rows($result) == 0) {
        $query = str_replace("FROM games g", "FROM games_archive g", $query);
        $result = mysql_query($query);
    }
    if (!$result) {
        echo "Could not query the database.\n";
    } else {
        $row = mysql_fetch_assoc($result);
        if ($playback_string = get_playback($game_id)) {
            $row['playback_string'] = $playback_string;
            $row['using_compression'] = true;
        }
        if ($error_message = get_error_message($game_id)) {
            $row['error_message'] = $error_message;
        }
        if ($row) {
            foreach ($row as $key => $value) {
                echo "{$key}={$value}\n";
            }
        }
    }
}
function get_playback($game_id)
{
Пример #4
0
function get_current_info()
{
    try {
        $pl = get_playback();
        if ($pl) {
            $info = $pl->getCurrentSong();
            if (isset($info['Artist']) && isset($info['Title'])) {
                $artist = trim($info['Artist']);
                $title = trim($info['Title']);
                $file_name = $info['file'];
                return array($artist, $title, $file_name);
            }
        }
        $pl->disconnect();
    } catch (PEARException $e) {
    }
    return false;
}