function Spider_Video_Player_Videos()
{
    wp_enqueue_script('media-upload');
    wp_admin_css('thickbox');
    require_once "video_functions.php";
    // add functions for Spider_Video_Player
    require_once "video_function.html.php";
    // add functions for vive Spider_Video_Player
    /*
    	?>
       <form action="" method="post">
        <input type="text" value="asdgadsfg" id="narek" />
        <input type="button" onclick="alert(document.getElementById('narek').value);"  />
    	<a href="<?php echo plugins_url("video_function.html.php",__FILE__) ?>?TB_iframe=1&amp;width=640&amp;height=394" class="thickbox add_media" id="content-add_media" title="Add Video" onclick="return false;">Insert Video</a>
    	</form>
    	<?php
    */
    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 'video':
            show_video();
            break;
        case 'add_video':
            add_video();
            break;
        case 'published':
            $nonce_sp_vid = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce_sp_vid, 'nonce_sp_vid')) {
                die("Are you sure you want to do this?");
            }
            published($id);
            show_video();
            break;
        case 'Save':
            if (!$id) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                save_video();
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                apply_video($id);
            }
            show_video();
            break;
        case 'Apply':
            if (!$id) {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                save_video();
            } else {
                check_admin_referer('nonce_sp_vid', 'nonce_sp_vid');
                apply_video($id);
            }
            edit_video($id);
            break;
        case 'edit_video':
            edit_video($id);
            break;
        case 'remove_video':
            $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_video($id);
            show_video();
            break;
        case 'publish_video':
            $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_video(1);
            break;
        case 'unpublish_video':
            $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_video(0);
            break;
        default:
            show_video();
            break;
    }
}
    $g_old = trim($_POST['g_old']);
    $user_pass = $user == '' && $pass == '' ? "#netcam_userpass :"******"netcam_userpass {$user}:{$pass}";
    $text = $type == "dev" ? 'videodevice ' . $d_ip . "\n" : 'netcam_url ' . $d_ip . "\n" . $user_pass . "\n";
    $text .= 'text_left ' . $name . "\n";
    $text .= 'webcam_port ' . $port . "\n";
    $text .= $alert != '' ? 'on_movie_start /usr/local/bin/motion-web-alert-plugin/alert.sh %f' : '#on_movie_start /usr/local/bin/motion-web-alert-plugin/alert.sh %f';
    `echo "{$text}" > {$PATH_THREAD}/thread{$id}.conf`;
    set_config($id, $g_old, $group);
    $msg = "{$id}={$group}";
    if (`cat {$FILE_GROUP_THREAD} | grep "^{$msg}\$"` != '') {
        echo 'edited';
        `/usr/local/bin/motion-web-alert-plugin/motion-restart.sh`;
    }
}
switch ($_POST['action']) {
    case 'get_num':
        number_video();
        break;
    case 'add':
        add_video();
        break;
    case 'cf_edit':
        cf_edit_video();
        break;
    case 'edit':
        edit_video();
        break;
    case 'del':
        del_video();
        break;
}
Example #3
0
 /**
  * Standard aed_module edit actualiser.
  *
  * @param  ID_TEXT		The entry being edited
  */
 function edit_actualisation($_id)
 {
     $id = intval($_id);
     $cat = post_param('cat');
     if (can_submit_to_gallery($cat) === false) {
         access_denied('SUBMIT_HERE');
     }
     make_member_gallery_if_needed($cat);
     $this->check_videos_allowed($cat);
     $validated = post_param_integer('validated', 0);
     $title = post_param('title');
     $urls = get_url('url', 'file', 'uploads/galleries' . (get_value('use_gallery_subdirs') == '1' ? '/' . $cat : ''), 0, OCP_UPLOAD_VIDEO, true, 'thumb_url', 'file2');
     if ($urls[0] == '') {
         warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN_UPLOAD'));
     }
     $url = $urls[0];
     if (!array_key_exists(1, $urls) || $urls[1] == '') {
         $thumb_url = '';
     } else {
         $thumb_url = $urls[1];
     }
     if (substr($url, 0, 8) != 'uploads/' && $url != '' && is_null(http_download_file($url, 0, false)) && !is_null($GLOBALS['HTTP_MESSAGE_B'])) {
         attach_message($GLOBALS['HTTP_MESSAGE_B'], 'warn');
     }
     if ($thumb_url == '' && $url != '') {
         $thumb_url = create_video_thumb($url);
     }
     if ($thumb_url == '') {
         $rows = $GLOBALS['SITE_DB']->query_select('videos', array('url', 'thumb_url'), array('id' => $id), '', 1);
         $thumb_url = $rows[0]['thumb_url'];
     }
     if ($url == '' || $thumb_url == '') {
         warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN_UPLOAD'));
     }
     $comments = post_param('comments');
     $allow_rating = post_param_integer('allow_rating', 0);
     $allow_comments = post_param_integer('allow_comments', 0);
     $notes = post_param('notes', '');
     $allow_trackbacks = post_param_integer('allow_trackbacks', 0);
     list($video_width, $video_height, $video_length) = $this->get_special_video_info();
     $this->donext_type = $cat;
     if ($validated == 1 && $GLOBALS['SITE_DB']->query_value('videos', 'validated', array('id' => $id)) == 0) {
         $submitter = $GLOBALS['SITE_DB']->query_value('videos', 'submitter', array('id' => $id));
         if (has_actual_page_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'galleries') && has_category_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'galleries', $cat)) {
             syndicate_described_activity($submitter != get_member() ? 'galleries:ACTIVITY_VALIDATE_VIDEO' : 'galleries:ACTIVITY_ADD_VIDEO', $title == '' ? $urls[2] : $title, '', '', '_SEARCH:galleries:video:' . strval($id), '', '', 'galleries', 1, NULL);
         }
     }
     edit_video($id, $title, $cat, $comments, $url, $thumb_url, $validated, $allow_rating, $allow_comments, $allow_trackbacks, $notes, $video_length, $video_width, $video_height, post_param('meta_keywords', ''), post_param('meta_description', ''));
 }
Example #4
0
 } elseif (!empty($is_audio)) {
     $var = 'edit-audio';
 } elseif (!empty($is_post)) {
     $var = 'edit-post';
 }
 if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($image)) {
     if (empty($url)) {
         $url = $title;
     }
     edit_image($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $image, $revertPost, $publishDraft, $category);
 } else {
     if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($video)) {
         if (empty($url)) {
             $url = $title;
         }
         edit_video($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $video, $revertPost, $publishDraft, $category);
     } else {
         if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($link)) {
             if (empty($url)) {
                 $url = $title;
             }
             edit_link($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $link, $revertPost, $publishDraft, $category);
         } else {
             if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($quote)) {
                 if (empty($url)) {
                     $url = $title;
                 }
                 edit_quote($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime, $quote, $revertPost, $publishDraft, $category);
             } else {
                 if ($proper && !empty($title) && !empty($tag) && !empty($content) && !empty($audio)) {
                     if (empty($url)) {
Example #5
0
            $description = mysqli_real_escape_string($dbc, $_POST['description']);
        }
        // validate type
        if (isset($_POST['type_id']) && filter_var($_POST['type_id'], FILTER_VALIDATE_INT, array('min_range' => 1))) {
            $type_id = $_POST['type_id'];
        } else {
            $errors[] = 'type';
        }
        // validate status
        if (isset($_POST['status'])) {
            $status = $_POST['status'];
        } else {
            $errors[] = 'status';
        }
        if (empty($errors)) {
            $result = edit_video($vid, $type_id, $title, $description, $status);
            if (mysqli_affected_rows($dbc) == 1) {
                echo "<script type='text/javascript'>\n                            alert('{$lang['AD_EDIT_VIDEO_SUCCESS']}');\n                            window.location = 'list_news.php';\n                            </script>\n                        ";
            } else {
                echo "<script type='text/javascript'>\n                            alert('{$lang['AD_EDIT_FAIL']}');\n                            window.location = 'list_news.php';\n                            </script>\n                        ";
            }
        } else {
            $error = $lang['AD_REQUIRED'];
        }
    }
    // END main IF submit condition
} else {
    redirect_to('admin/list_videos.php');
}
include '../includes/backend/header-admin.php';
?>