当前位置: 首页>>代码示例>>PHP>>正文


PHP Video::Create方法代码示例

本文整理汇总了PHP中Video::Create方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::Create方法的具体用法?PHP Video::Create怎么用?PHP Video::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Video的用法示例。


在下文中一共展示了Video::Create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$aDropFieldTypes = array();
array_push($aDropFields, 'image_file_drop');
array_push($aDropFieldTypes, 'image');
// if form was submitted:
if ($_POST['commit'] == "Cancel") {
    header("Location:video_list.php");
    exit;
}
if ($_POST['commit'] == "Save Video") {
    if ($id == 0) {
        // add the listing
        $objVideo = new Video();
        $objVideo->Title = $_REQUEST["title"];
        $objVideo->Summary = $_REQUEST["summary"];
        $objVideo->VideoEmbed = $_REQUEST["video_embed"];
        $objVideo->Create();
        $objVideo->HandleFileUploads();
        $objVideo->HandleDropFileUploads($aDropFields[0], 'ImageFile');
        // redirect to listing list
        header("Location:video_list.php");
        exit;
    } else {
        $objVideo = new Video($_REQUEST["id"]);
        $objVideo->Title = $_REQUEST["title"];
        $objVideo->Summary = $_REQUEST["summary"];
        $objVideo->VideoEmbed = $_REQUEST["video_embed"];
        $objVideo->Update();
        $objVideo->HandleFileUploads();
        $objVideo->HandleDropFileUploads($aDropFields[0], 'ImageFile');
        // redirect to listing list
        header("Location:video_list.php");
开发者ID:brandfeverinc,项目名称:coke-cooler,代码行数:31,代码来源:video_admin.php

示例2: htmlspecialchars

    // Validate private
    if (!empty($_POST['private']) && $_POST['private'] == '1') {
        View::$vars->data['private'] = '1';
        if (!empty($_POST['private_url']) && strlen($_POST['private_url']) == 7 && !Video::Exist(array('private_url' => $_POST['private_url']))) {
            View::$vars->data['private_url'] = htmlspecialchars(trim($_POST['private_url']));
            View::$vars->private_url = View::$vars->data['private_url'];
        } else {
            View::$vars->errors['private_url'] = Language::GetText('error_private_url');
        }
    } else {
        View::$vars->data['private'] = '0';
    }
    // Validate Video Upload last (only if other fields were valid)
    if (empty(View::$vars->errors)) {
        View::$vars->data['user_id'] = View::$vars->user->user_id;
        View::$vars->data['filename'] = Video::CreateFilename();
        View::$vars->data['status'] = 'new';
        Plugin::Trigger('upload.before_create_video');
        $_SESSION['upload'] = Video::Create(View::$vars->data);
        Plugin::Trigger('upload.create_video');
        header('Location: ' . HOST . '/myaccount/upload/video/');
        exit;
    } else {
        View::$vars->message = Language::GetText('errors_below');
        View::$vars->message .= '<br /><br /> - ' . implode('<br /> - ', View::$vars->errors);
        View::$vars->message_type = 'error';
    }
}
// Output page
Plugin::Trigger('upload.before_render');
View::Render('myaccount/upload.tpl');
开发者ID:KmServer,项目名称:CumulusClips,代码行数:31,代码来源:upload.php

示例3: basename

            $private_url = $data['private_url'];
        } else {
            $errors['private_url'] = 'Invalid private URL';
        }
    } else {
        $data['private'] = '0';
    }
    // Update video if no errors were made
    if (empty($errors)) {
        // Create record
        $data['user_id'] = $admin->user_id;
        $data['original_extension'] = Functions::GetExtension($data['upload']['temp']);
        $data['filename'] = basename($data['upload']['temp'], '.' . $data['original_extension']);
        unset($data['upload']);
        $data['status'] = 'pending conversion';
        $id = Video::Create($data);
        // Begin encoding
        $cmd_output = $config->debug_conversion ? CONVERSION_LOG : '/dev/null';
        $converter_cmd = 'nohup ' . $php_path . ' ' . DOC_ROOT . '/cc-core/system/encode.php --video="' . $id . '" >> ' . $cmd_output . ' &';
        exec($converter_cmd);
        // Output message
        $message = 'Video has been created.';
        $message_type = 'success';
        unset($data);
    } else {
        $message = 'The following errors were found. Please correct them and try again.';
        $message .= '<br /><br /> - ' . implode('<br /> - ', $errors);
        $message_type = 'error';
    }
}
// Output Header
开发者ID:KmServer,项目名称:CumulusClips,代码行数:31,代码来源:videos_add.php


注:本文中的Video::Create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。