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


PHP Video::Update方法代码示例

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


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

示例1: PageContent

include "../inc/classes/Video.php";
include "../inc/classes/Helpers.php";
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'sort') {
    $objVideo = new Video();
    $objVideo->SortValues(substr($_REQUEST['action'], 1), substr($_REQUEST['action'], 0, 1));
    unset($objVideo);
} elseif (isset($_REQUEST['dragsort'])) {
    // handle drag sort ajax request:
    $objVideo = new Video($_REQUEST['id']);
    $new_sort_order = $_REQUEST['idx'] * 10 + 5;
    if ($new_sort_order > $objVideo->SortOrder) {
        $new_sort_order += 10;
        // increasing sort order so must add another 10
    }
    $objVideo->SortOrder = $new_sort_order;
    $objVideo->Update();
    echo "success";
    exit;
    // just exit since this is an ajax request
}
include "includes/pagetemplate.php";
function PageContent()
{
    ?>
    
        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                // fix to preserve width of cells
                var fixHelper = function(e, ui) {
开发者ID:brandfeverinc,项目名称:coke-cooler,代码行数:31,代码来源:video_list.php

示例2: Video

                $VideosInDB = Video::Filter($Videos, $ModelID, $Set->getID(), $matches['Name'] . $matches['Number'] . $matches['Suffix']);
                if ($VideosInDB) {
                    $VideoInDB = $VideosInDB[0];
                    $cis = CacheImage::Filter($CacheImages, NULL, NULL, NULL, NULL, NULL, $VideoInDB->getID());
                    CacheImage::DeleteMulti($cis, $CurrentUser);
                } else {
                    $VideoInDB = new Video();
                    $VideoInDB->setSet($Set);
                }
                $VideoInDB->setFileName($matches['Prefix'] . $matches['Name'] . $matches['Number'] . $matches['Suffix']);
                $VideoInDB->setFileExtension($matches['Extension']);
                $VideoInDB->setFileSize($FileInfo->getSize());
                $VideoInDB->setFileCheckSum(Utils::CalculateMD5($FileInfo->getRealPath()));
                $VideoInDB->setFileCRC32(Utils::CalculateCRC32($FileInfo->getRealPath()));
                if (!$VideoInDB->getID() && $CurrentUser->hasPermission(RIGHT_VIDEO_ADD)) {
                    Video::Insert($VideoInDB, $CurrentUser);
                } else {
                    if ($CurrentUser->hasPermission(RIGHT_VIDEO_EDIT)) {
                        Video::Update($VideoInDB, $CurrentUser);
                    }
                }
            }
        }
    }
    $infoSuccess = new Info($lang->g('MessageVideosImported'));
    Info::AddInfo($infoSuccess);
    if (isset($argv) && $argc > 0) {
        $bi->Finish();
    }
}
HTMLstuff::RefererRedirect();
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:import_video.php

示例3: foreach

         if ($Set->Videos) {
             foreach ($Set->Videos->Video as $Video) {
                 $VideoInDb = Video::Filter($VideosInDb, $Model2Process->getID(), $Set2Process->getID(), (string) $Video->attributes()->name);
                 if ($VideoInDb) {
                     $VideoInDb = $VideoInDb[0];
                 }
                 /* @var $Video2Process Video */
                 $Video2Process = $VideoInDb ? $VideoInDb : new Video();
                 $Video2Process->setSet($Set2Process);
                 $Video2Process->setFileName((string) $Video->attributes()->name);
                 $Video2Process->setFileExtension((string) $Video->attributes()->extension);
                 $Video2Process->setFileSize((int) $Video->attributes()->filesize);
                 $Video2Process->setFileCheckSum((string) $Video->attributes()->checksum);
                 $Video2Process->setFileCRC32((string) $Video->attributes()->crc32);
                 if ($Video2Process->getID()) {
                     Video::Update($Video2Process, $CurrentUser);
                 } else {
                     Video::Insert($Video2Process, $CurrentUser);
                 }
                 $videotags = Tag::GetTagArray((string) $Video->attributes()->tags);
                 $Tag2AllThisVideo = Tag2All::Filter($Tag2AllThisSet, NULL, $Model2Process->getID(), $Set2Process->getID(), NULL, $Video2Process->getID());
                 Tag2All::HandleTags($videotags, $Tag2AllThisVideo, $TagsInDB, $CurrentUser, $Model2Process->getID(), $Set2Process->getID(), NULL, $Video2Process->getID(), FALSE);
             }
         }
     }
 }
 if ($fileToProcess != 'setup_data.xml') {
     unlink(realpath($fileToProcess));
 }
 $infoSuccess = new Info($lang->g('MessageXMLImported'));
 Info::AddInfo($infoSuccess);
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:setup_data.php

示例4: Exception

    $target = UPLOAD_PATH . '/temp/' . $video->filename . '.' . $extension;
    Plugin::Trigger('upload.ajax.before_move_video');
    if (!@move_uploaded_file($_FILES['upload']['tmp_name'], $target)) {
        App::Alert('Error During Video Upload', 'The raw video file transfer failed. Video File: ' . $target);
        throw new Exception(Language::GetText('error_uploadify_system', array('host' => HOST)));
    }
    ### Change permissions on raw video file
    Plugin::Trigger('upload.ajax.before_change_permissions');
    try {
        Filesystem::Open();
        Filesystem::SetPermissions($target, 0644);
        Filesystem::Close();
    } catch (Exception $e) {
        App::Alert('Error During Video Upload', $e->getMessage());
        throw new Exception(Language::GetText('error_uploadify_system', array('host' => HOST)));
    }
    ### Update video information
    $data = array('status' => 'pending conversion', 'original_extension' => $extension);
    Plugin::Trigger('upload.ajax.before_update_video');
    $video->Update($data);
    ### Initilize Encoder
    $cmd_output = $config->debug_conversion ? CONVERSION_LOG : '/dev/null';
    Plugin::Trigger('upload.ajax.before_encode');
    $converter_cmd = 'nohup ' . Settings::Get('php') . ' ' . DOC_ROOT . '/cc-core/system/encode.php --video="' . $video->video_id . '" >> ' . $cmd_output . ' 2>&1 &';
    exec($converter_cmd);
    Plugin::Trigger('upload.ajax.encode');
    // Output success message
    exit(json_encode(array('result' => 1, 'msg' => '')));
} catch (Exception $e) {
    exit(json_encode(array('result' => 0, 'msg' => $e->getMessage())));
}
开发者ID:KmServer,项目名称:CumulusClips,代码行数:31,代码来源:upload.ajax.php

示例5: switch

$message = null;
$sub_header = null;
// Verify content type was provided
if (!empty($_GET['status']) && in_array($_GET['status'], array('video', 'member', 'comment'))) {
    $type = $_GET['status'];
} else {
    $type = 'video';
}
### Handle "Ban" record
if (!empty($_GET['ban']) && is_numeric($_GET['ban'])) {
    switch ($type) {
        case 'video':
            $video = new Video($_GET['ban']);
            if ($video->found) {
                Flag::FlagDecision($video->video_id, $type, true);
                $video->Update(array('status' => 'banned'));
                $message = 'Video has been banned';
                $message_type = 'success';
            }
            break;
        case 'member':
            $user = new User($_GET['ban']);
            if ($user->found) {
                Flag::FlagDecision($user->user_id, $type, true);
                $user->UpdateContentStatus('banned');
                $user->Update(array('status' => 'banned'));
                $message = 'Member has been banned';
                $message_type = 'success';
            }
            break;
        case 'comment':
开发者ID:KmServer,项目名称:CumulusClips,代码行数:31,代码来源:flags.php

示例6: header

}
if (array_key_exists('hidAction', $_POST) && $_POST['hidAction'] == 'VideoView') {
    $Video->setFileName(Utils::NullIfEmpty($_POST['txtFilename']));
    $Video->setFileExtension(Utils::NullIfEmpty($_POST['txtFileExtension']));
    $Video->setFileSize(intval($_POST['txtFilesize']));
    $Video->setFileCheckSum(Utils::NullIfEmpty($_POST['txtFileChecksum']));
    $Video->setFileCRC32(Utils::NullIfEmpty($_POST['txtFileCRC32']));
    $tags = Tag::GetTagArray($_POST['txtTags']);
    if ($Video->getID()) {
        if ($DeleteVideo) {
            if (Video::Delete($Video, $CurrentUser)) {
                header('location:' . $ReturnURL);
                exit;
            }
        } else {
            if (Video::Update($Video, $CurrentUser)) {
                Tag2All::HandleTags($tags, $TagsThisVideo, $TagsInDB, $CurrentUser, $ModelID, $SetID, NULL, $Video->getID(), NULL);
                header('location:' . $ReturnURL);
                exit;
            }
        }
    } else {
        if (Video::Insert($Video, $CurrentUser)) {
            Tag2All::HandleTags($tags, $TagsThisVideo, $TagsInDB, $CurrentUser, $ModelID, $SetID, NULL, $Video->getID());
            header('location:' . $ReturnURL);
            exit;
        }
    }
}
echo HTMLstuff::HtmlHeader(sprintf('%1$s - %2$s %3$s - %4$s', $Model->GetShortName(TRUE), $lang->g('NavigationSet'), $Set->getName(), $lang->g('NavigationVideos')), $CurrentUser);
?>
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:video_view.php

示例7: Video

try {
    /////////////////////////////////////////////////////////////
    //                        STEP 1                           //
    //               Validate Requested Video                  //
    /////////////////////////////////////////////////////////////
    // Debug Log
    $config->debug_conversion ? App::Log(CONVERSION_LOG, 'Validating requested video...') : null;
    ### Validate requested video
    $video = new Video($video_id);
    if (!Video::Exist(array('video_id' => $video_id, 'status' => 'pending conversion'))) {
        throw new Exception("An invalid video was passed to the video encoder.");
    }
    // Debug Log
    $config->debug_conversion ? App::Log(CONVERSION_LOG, 'Establishing variables...') : null;
    ### Retrieve video information
    $video->Update(array('status' => 'processing'));
    $debug_log = LOG . '/' . $video->filename . '.log';
    $raw_video = UPLOAD_PATH . '/temp/' . $video->filename . '.' . $video->original_extension;
    $flv = UPLOAD_PATH . '/flv/' . $video->filename . '.flv';
    $mobile_temp = UPLOAD_PATH . '/mobile/' . $video->filename . '_temp.mp4';
    $mobile = UPLOAD_PATH . '/mobile/' . $video->filename . '.mp4';
    $thumb = UPLOAD_PATH . '/thumbs/' . $video->filename . '.jpg';
    Plugin::Trigger('encode.load_video');
    // Debug Log
    $config->debug_conversion ? App::Log(CONVERSION_LOG, 'Verifying raw video exists...') : null;
    ### Verify Raw Video Exists
    if (!file_exists($raw_video)) {
        throw new Exception("The raw video file does not exists. The id of the video is: {$video->video_id}");
    }
    // Debug Log
    $config->debug_conversion ? App::Log(CONVERSION_LOG, 'Verifying raw video was valid size...') : null;
开发者ID:KmServer,项目名称:CumulusClips,代码行数:31,代码来源:encode.php


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