コード例 #1
0
ファイル: index.php プロジェクト: shiyake/php-ihome
 //if($video['type']!="video/x-flv")	{
 //		showmessage("请上传FLV格式视频文件","plugin.php?pluginid=video&ac=upload");
 //	}
 if (!strstr($image['type'], "image")) {
     showmessage("封面请上传图片格式文件", "plugin.php?pluginid=video&ac=upload");
 }
 if (!$abstract) {
     showmessage("请填写视频简介", "plugin.php?pluginid=video&ac=upload");
 }
 if (!$desc) {
     showmessage("请填写视频描述", "plugin.php?pluginid=video&ac=upload");
 }
 if (!$title) {
     showmessage("请填写视频标题", "plugin.php?pluginid=video&ac=upload");
 }
 $video_detail = video_save($video, $title, $desc, $abstract);
 pic_save($image, 0, $title);
 $sql = "SELECT * FROM " . tname("pic") . " WHERE title='" . $title . "' order by dateline desc limit 1";
 $picid = 0;
 $query = $_SGLOBAL['db']->query($sql);
 while ($row = $_SGLOBAL['db']->fetch_array($query)) {
     $picid = $row['picid'];
 }
 if ($video_detail && is_array($video_detail)) {
     include_once S_ROOT . './source/function_feed.php';
     feed_publish($video_detail['id'], 'videoid');
 }
 $sql = "UPDATE " . tname("video") . " SET picid = " . $picid . " WHERE id = " . $video_detail['id'];
 $_SGLOBAL['db']->query($sql);
 showmessage("视频已经成功上传", "plugin.php?pluginid=video");
 exit;
コード例 #2
0
ファイル: cp_video.php プロジェクト: shiyake/php-ihome
$desc = $_POST['desc'];
$file = $_FILES['uploadvideo'];
if ($file) {
    if (strlen($title) > 40) {
        showmessage("标题过长了,请控制在20汉字以内!");
    }
    if (strlen($title) < 4) {
        showmessage("标题过短!请在2个汉字以上20汉字以下!");
    }
    if (strlen($desc) > 400) {
        showmessage("内容过长了,请控制在200汉字以内!");
    }
    if (strlen($desc) > 20) {
        showmessage("内容过短,请在10个汉字以上!");
    }
    $title = getstr($title, 40, 1, 1, 1);
    //标题为20个字
    $desc = getstr($desc, 400, 1, 1, 1);
    //描述为200个字
} else {
    showmessage('no_file');
}
if (submitcheck('uploadflv')) {
    $videosave = video_save($file, $title, $desc);
    //写个上传视频的函数--上传视频
    if ($videosave && is_array($videosave)) {
        //--上传视频成功之后,增加feed就算大功告成了
        feed_publish($videosave['id'], 'videoid');
        //--发布feed
    }
}