Пример #1
0
function do_playlist_tracks($pl, $icon)
{
    global $putinplaylistarray, $playlist;
    if ($pl == '[Radio Streams]') {
        $streams = do_mpd_command('listplaylistinfo "' . $pl . '"', true);
        if (is_array($streams) && array_key_exists('file', $streams)) {
            if (!is_array($streams['file'])) {
                $temp = $streams['file'];
                $streams = array();
                $streams['file'][0] = $temp;
            }
            $c = 0;
            foreach ($streams['file'] as $st) {
                add_playlist(rawurlencode($st), htmlentities(substr($st, strrpos($st, '#') + 1, strlen($st))), 'icon-radio-tower', 'clicktrack', true, $c, false);
                $c++;
            }
        }
    } else {
        $putinplaylistarray = true;
        doCollection('listplaylistinfo "' . $pl . '"');
        $c = 0;
        foreach ($playlist as $track) {
            list($class, $link) = $track->get_checked_url();
            add_playlist(rawurlencode($link), htmlentities($track->get_artist_track_title()), 'icon-music', $class, true, $c, false);
            $c++;
        }
    }
}
function Spider_Video_Player_Playlists()
{
    require_once "Playlist_functions.php";
    // add functions for Spider_Video_Player
    require_once "Playlists_function.html.php";
    // add functions for vive Spider_Video_Player
    if (isset($_GET["task"])) {
        $task = htmlspecialchars($_GET["task"]);
    } else {
        $task = "default";
    }
    if (isset($_GET["id"])) {
        $id = htmlspecialchars($_GET["id"]);
    } else {
        $id = 0;
    }
    switch ($task) {
        case 'playlist':
            show_playlist();
            break;
        case "unpublish_playlist":
            $nonce_sp_vid = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
                die("Are you sure you want to do this?");
            }
            change_tag($id);
            show_playlist();
            break;
        case 'add_playlist':
            add_playlist();
            break;
        case 'cancel_playlist':
            cancel_playlist();
            break;
        case 'Save':
            if ($id) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                Apply_playlist($id);
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                save_playlist();
            }
            show_playlist();
            break;
        case 'Apply':
            if ($id == 0) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                $save_or_no = save_playlist();
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                $save_or_no = Apply_playlist($id);
            }
            if ($save_or_no) {
                edit_playlist($id);
            } else {
                show_playlist();
            }
            break;
        case 'edit_playlist':
            edit_playlist($id);
            break;
        case 'remove_playlist':
            $nonce_sp_vid = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
                die("Are you sure you want to do this?");
            }
            remove_playlist($id);
            show_playlist();
            break;
        case 'select_playlist':
            select_playlist();
            break;
        default:
            show_playlist();
            break;
    }
}
Пример #3
0
function Spider_Video_Player_Playlists()
{
    require_once "Playlist_functions.php";
    // add functions for Spider_Video_Player
    require_once "Playlists_function.html.php";
    // add functions for vive Spider_Video_Player
    if (isset($_GET["task"])) {
        $task = htmlspecialchars($_GET["task"]);
    } else {
        $task = "default";
    }
    if (isset($_GET["id"])) {
        $id = htmlspecialchars($_GET["id"]);
    } else {
        $id = 0;
    }
    switch ($task) {
        case 'playlist':
            show_playlist();
            break;
        case "unpublish_playlist":
            change_tag($id);
            show_playlist();
            break;
        case 'add_playlist':
            add_playlist();
            break;
        case 'cancel_playlist':
            cancel_playlist();
            break;
        case 'Save':
            if ($id) {
                Apply_playlist($id);
            } else {
                save_playlist();
            }
            show_playlist();
            break;
        case 'Apply':
            if ($id == 0) {
                $save_or_no = save_playlist();
            } else {
                $save_or_no = Apply_playlist($id);
            }
            if ($save_or_no) {
                edit_playlist($id);
            } else {
                show_playlist();
            }
            break;
        case 'edit_playlist':
            edit_playlist($id);
            break;
        case 'remove_playlist':
            remove_playlist($id);
            show_playlist();
            break;
        case 'select_playlist':
            select_playlist();
            break;
        default:
            show_playlist();
            break;
    }
}