示例#1
0
 $name = $_FILES['uploadvideo']['name'];
 $type = $_FILES['uploadvideo']['type'];
 //$size=$_FILES['uploadvideo']['size'];
 $cname = str_replace(" ", "_", $name);
 if (empty($contestId)) {
     //echo "<script>alert('Select contest name')</script>";
     $error = "Select contest name";
 } elseif (empty($url) && empty($name)) {
     //echo "<script>alert('You must input url or file name')</script>";
     $error = "You must input url or file name for video";
 } elseif (empty($title)) {
     //echo "<script>alert('You must input video title')</script>";
     $error = "You must input video title";
 }
 if (!empty($url) && !empty($title)) {
     $videoHost = videoType($url);
     if ($videoHost == 'youtube') {
         $videoId = parse_youtube($url);
     } elseif ($videoHost == 'vimeo') {
         $videoId = parse_vimeo($url);
     } else {
         $videoId = '';
     }
     $sql = "INSERT INTO tblvideo(name,type,videourl,title,description,length,ratings,add_date,aprove,userid,contestid) VALUE('" . $cname . "','" . $videoHost . "','" . $videoId . "','" . $title . "','" . $description . "','none','',now(),'no','" . $userId . "','" . $contestId . "')";
     $result = mysqli_query($db_conx, $sql);
     //echo "Your video has been successfully uploaded";
     if ($result) {
         //echo "<script>alert('One New Video Inserted Succesful')</script>";
         $success = "Your video has been successfully added";
     }
 } elseif (!empty($name) && empty($url) && !empty($title)) {
<?php

require_once "admin_conn.php";
require_once "collect/tools/ContentManager.php";
//chkLogin();
$type = be("all", "type");
if (!isNum($type)) {
    //	topicVideo();
    //	bandanVideo();
    //	lunboVideo();
} else {
    $type = intval($type);
    videoType($type);
}
dispseObj();
function videoType($type)
{
    writetofile("checkVod.txt", 'Start to check item for vod type{=}' . $type);
    global $db, $template, $cache;
    $sql = "SELECT count(*)  FROM {pre}vod where d_topic=0 and  d_hide !=-100 and d_play_check=0 and  d_type=" . $type;
    $nums = $db->getOne($sql);
    $app_pagenum = 20;
    $pagecount = ceil($nums / $app_pagenum);
    for ($i = 1; $i <= $pagecount; $i++) {
        writetofile("checkVod.txt", 'check item for vod type{=}' . $type . '{=}Total{=}' . $pagecount . '{=}' . $i);
        $sql = "SELECT d_id,d_name,d_playfrom,webUrls \n\t    FROM {pre}vod where d_topic=0 and  d_hide !=-100 and d_play_check=0 and d_type=" . $type . "  limit " . $app_pagenum * ($i - 1) . "," . $app_pagenum;
        $rs = $db->query($sql);
        checkWebUrls($rs);
        unset($rs);
    }
    writetofile("checkVod.txt", 'End to check item  for vod type{=}' . $type);