Exemplo n.º 1
0
//Ajax categories...
$mode = post('mode');
switch ($mode) {
    case "add_profile":
        $profile_id = $cbvid->add_video_profile($_POST);
        //$cid = 18;
        if (error()) {
            echo json_encode(array('err' => error(), 'rel' => get_rel_list()));
        } else {
            echo json_encode(array('success' => 'yes', 'profile_id' => $profile_id, 'rel' => ''));
        }
        break;
    case "update_profile":
        $profile_id = $cbvid->update_video_profile($_POST);
        //$cid = 18;
        if (error()) {
            echo json_encode(array('err' => error(), 'rel' => get_rel_list()));
        } else {
            echo json_encode(array('success' => 'yes', 'profile_id' => $profile_id, 'rel' => ''));
        }
        break;
    case "activate_video":
        $videoid = $_POST['videoid'];
        $cbvid->action('activate', $videoid);
        echo json_encode(array('success' => 'yes'));
        break;
    case "deactivate_video":
        $videoid = $_POST['videoid'];
        $cbvid->action('deactivate', $videoid);
        echo json_encode(array('success' => 'yes'));
}
Exemplo n.º 2
0
     }
     if (!$type) {
         e(lang("Invalid playlist type"));
     }
     if (error()) {
         echo json_encode(array('err' => error(), 'rel' => get_rel_list()));
     } else {
         $playlist = $cbvid->action->get_playlist($pid);
         assign('playlist', $playlist);
         if (post('oid')) {
             assign('oid', post('oid'));
         }
         assign('type', post('type'));
         $template = Fetch('blocks/playlist.html');
         $ul_template = fetch('blocks/playlist-ul.html');
         echo json_encode(array('success' => 'yes', 'rel' => get_rel_list(), 'template' => $template, 'pid' => $pid, 'ul_template' => $ul_template, 'msg' => msg()));
     }
     break;
 case "delete_playlist":
     $pid = mysql_clean(post('pid'));
     $cbvid->action->delete_playlist($pid);
     if (error()) {
         echo json_encode(array('err' => error()));
     } else {
         echo json_encode(array('msg' => array(lang('Playlist has been removed'))));
     }
     break;
 case "add_playlist_item":
     $type = post('v');
     $pid = mysql_clean(post('pid'));
     $id = mysql_clean(post('oid'));
Exemplo n.º 3
0
 case "addPlaylist":
 case "add_playlist":
     $array = array('name', 'description', 'tags', 'playlist_type', 'privacy', 'allow_comments', 'allow_rating', 'type');
     $type = $request['type'];
     $input = array();
     foreach ($array as $ar) {
         $input[$ar] = mysql_clean($request[$ar]);
     }
     if ($type == 'v' || !isset($type)) {
         $pid = $cbvid->action->create_playlist($input);
     }
     if (!$type) {
         e(lang("Invalid playlist type"));
     }
     if (VERSION > 2.7) {
         $rel = get_rel_list();
     }
     if (error()) {
         $rel = array();
         echo json_encode(array('err' => error(), 'rel' => $rel));
     } else {
         $playlist = $cbvid->action->get_playlist($pid);
         echo json_encode(array('success' => 'yes', 'rel' => $rel, 'pid' => $pid, 'playlist' => $playlist, 'msg' => msg()));
     }
     break;
 case "delete_playlist":
     $pid = mysql_clean($request['playlist_id']);
     $cbvid->action->delete_playlist($pid);
     if (error()) {
         echo json_encode(array('err' => error()));
     } else {