Exemplo n.º 1
0
         debuglog("TTID Not Found", "USERRATING", 2);
         header('HTTP/1.1 417 Expectation Failed');
     }
     break;
 case 'remove':
     if ($artist === null || $title === null) {
         header('HTTP/1.1 400 Bad Request');
         exit(0);
     }
     $ttids = find_item($uri, $title, $artist, $album, $albumartist, forcedUriOnly($urionly, getDomain($uri)));
     if (count($ttids) > 0) {
         foreach ($ttids as $ttid) {
             foreach ($attributes as $pair) {
                 debuglog("Removing " . $pair["attribute"] . " " . $pair["value"], "USERRATING");
                 $result = true;
                 $r = remove_tag($ttid, $pair["value"]);
                 if ($r == false) {
                     debuglog("FAILED Removing " . $pair["attribute"] . " " . $pair["value"], "USERRATING", 2);
                     $result = false;
                 }
             }
             if ($result) {
                 send_list_updates($artist_created, $album_created, $ttid, false);
                 $returninfo['metadata'] = get_all_data($ttid);
             }
         }
         print json_encode($returninfo);
     } else {
         debuglog("TTID Not Found", "USERRATING", 2);
         header('HTTP/1.1 417 Expectation Failed');
     }
function Tags_Spider_Video_Player()
{
    global $wpdb;
    require_once "tag_functions.php";
    // add functions for Spider_Video_Player
    require_once "tag_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 'tag':
            show_tag();
            break;
        case 'add_tag':
            add_tag();
            break;
        case 'cancel_tag':
            cancel_tag();
            break;
        case 'apply_tag':
            if ($id == 0) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                $save_or_no = save_tag();
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                $save_or_no = apply_tag($id);
            }
            if ($save_or_no) {
                edit_tag($id);
            } else {
                show_tag();
            }
            break;
        case 'save_tag':
            if (!$id) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                save_tag();
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                apply_tag($id);
            }
            show_tag();
            break;
        case 'saveorder':
            check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
            saveorder();
            break;
        case 'orderup':
            ordertag(-1);
            break;
        case 'orderdown':
            ordertag(1);
            break;
        case 'edit_tag':
            edit_tag($id);
            break;
        case 'remove_tag':
            $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_tag($id);
            show_tag();
            break;
        case 'publish_tag':
            $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_tag();
            break;
        case 'unpublish_tag':
            $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_tag();
            break;
        case 'required_tag':
            $nonce_sp_vid = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
                die("Are you sure you want to do this?");
            }
            required_tag($id);
            show_tag();
            break;
        case 'unrequired_tag':
            $nonce_sp_vid = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
                die("Are you sure you want to do this?");
            }
            required_tag($id);
            show_tag();
            break;
        default:
            show_tag();
            break;
    }
}
Exemplo n.º 3
0
function Tags_Spider_Video_Player()
{
    global $wpdb;
    require_once "tag_functions.php";
    // add functions for Spider_Video_Player
    require_once "tag_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 'tag':
            show_tag();
            break;
        case 'add_tag':
            add_tag();
            break;
        case 'cancel_tag':
            cancel_tag();
            break;
        case 'apply_tag':
            if ($id == 0) {
                $save_or_no = save_tag();
            } else {
                $save_or_no = apply_tag($id);
            }
            if ($save_or_no) {
                edit_tag($id);
            } else {
                show_tag();
            }
            break;
        case 'save_tag':
            if (!$id) {
                save_tag();
            } else {
                apply_tag($id);
            }
            show_tag();
            break;
        case 'saveorder':
            saveorder();
            break;
        case 'orderup':
            ordertag(-1);
            break;
        case 'orderdown':
            ordertag(1);
            break;
        case 'edit_tag':
            edit_tag($id);
            break;
        case 'remove_tag':
            remove_tag($id);
            show_tag();
            break;
        case 'publish_tag':
            change_tag($id);
            show_tag();
            break;
        case 'unpublish_tag':
            change_tag($id);
            show_tag();
            break;
        case 'required_tag':
            required_tag($id);
            show_tag();
            break;
        case 'unrequired_tag':
            required_tag($id);
            show_tag();
            break;
        default:
            show_tag();
            break;
    }
}