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


PHP Video类代码示例

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


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

示例1: run

 public function run()
 {
     $tags = Tag::model()->findAll();
     if ($tags) {
         foreach ($tags as $tag) {
             $post = Post::model()->findAll("FIND_IN_SET(:tag, tags)", array(':tag' => $tag->tag_name));
             $image = Image::model()->findAll("FIND_IN_SET(:tag, tags)", array(':tag' => $tag->tag_name));
             $soft = Soft::model()->findAll("FIND_IN_SET(:tag, seo_keywords)", array(':tag' => $tag->tag_name));
             $video = Video::model()->findAll("FIND_IN_SET(:tag, seo_keywords)", array(':tag' => $tag->tag_name));
             if (!$post && !$image && !$soft && !$video) {
                 $tag->delete();
             } else {
                 $tag->data_count = count($post) + count($image) + count($soft);
                 $tag->save();
             }
         }
     }
     $tagdatas = TagData::model()->findAll();
     if ($tagdatas) {
         foreach ($tagdatas as $value) {
             $modelType = ModelType::model()->findByPk($value->type);
             $model = $modelType->model;
             $data = $model::model()->findByPk($value->content_id);
             if (!$data) {
                 $value->delete();
             }
         }
     }
     $this->controller->message('success', Yii::t('admin', 'Reset Tags Success'), $this->controller->createUrl('index'));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:30,代码来源:ResetAction.php

示例2: index

 public function index($page = 1)
 {
     $itemPerPage = 5;
     $videos = Video::getVideos(5, $page);
     /**/
     return View::make("pages.vote")->with('videos', $videos)->with('page', $page);
 }
开发者ID:moonlight87,项目名称:laravel,代码行数:7,代码来源:VoteController.php

示例3: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $banners = Banner::where('active', 'Y')->orderBy('id', 'desc')->get();
     $news = News::orderBy('date', 'desc')->take(5)->get();
     $videos = Video::orderBy('id', 'desc')->take(5)->get();
     return view('home', compact('banners', 'news', 'videos'));
 }
开发者ID:RelmekTaiwan,项目名称:sebamed,代码行数:12,代码来源:HomeController.php

示例4: __construct

 public function __construct(Video $video)
 {
     $this->video = $video;
     $this->details = $this->getVideoDetails();
     $this->user = DAOFactory::getUserDAO()->findById($video->getUserId());
     $this->videoTO = new VideoTO($this->video, $this->user);
 }
开发者ID:anzasolutions,项目名称:simlandia,代码行数:7,代码来源:abstractfiller.class.php

示例5: add_youtube_video

function add_youtube_video()
{
    global $config;
    require_once $config["path_to_default_site_module"] . "/models/db.php";
    require_once $config["path_to_default_site_module"] . "/models/video.php";
    $ch = curl_init("https://gdata.youtube.com/feeds/api/videos/-/preachcaster?alt=json");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    $json_string_data = curl_exec($ch);
    curl_close($ch);
    $video_data = json_decode($json_string_data, true);
    $db_conn = new db($config["db_connection"]);
    $db_resource = $db_conn->get_resource();
    $video = new Video($db_resource);
    foreach ($video_data["feed"]["entry"] as $single_video) {
        //parse out ID
        $tmp_array = explode("/", $single_video["id"]['$t']);
        $video_id = $tmp_array[count($tmp_array) - 1];
        //rxBS1E0KZQU
        //CQzUsTFqtW0
        $video_params = array("video_id" => $video_id, "author" => $single_video["author"][0]["name"]['$t'], "title" => $single_video["title"]['$t'], "description" => $single_video["content"]['$t'], "date_recorded" => isset($single_video['yt$recorded']) ? $single_video['yt$recorded']['$t'] : null, "location" => isset($single_video['yt$location']) ? $single_video['yt$location']['$t'] : null, "url" => isset($single_video['media$group']['media$player']) ? $single_video['media$group']['media$player'][0]["url"] : null, "duration" => isset($single_video['media$group']['yt$duration']) ? $single_video['media$group']['yt$duration']["seconds"] : null, "comment_url" => isset($single_video['gd$comments']) && isset($single_video['gd$comments']['gd$feedLink']) ? $single_video['gd$comments']['gd$feedLink']["href"] : null, "thumbnails" => isset($single_video['media$group']) && isset($single_video['media$group']['media$thumbnail']) ? $single_video['media$group']['media$thumbnail'] : null);
        $video->add_video($video_params, "YouTube");
    }
    die("here");
}
开发者ID:natestarner,项目名称:preachcaster,代码行数:25,代码来源:add_youtube_video.php

示例6: afficherListeVideos

 /**
  * Récupère les différentes propriétés afin de les afficher
  * @return true si le tableau n'est pas vide
  */
 function afficherListeVideos()
 {
     //requete sql
     if ($this->numpara) {
         $result = mysql_query("SELECT numvideo,legende,numparavideo,ordre FROM if_para_video WHERE numpara='{$this->numpara}' ORDER BY ordre");
         while ($row = mysql_fetch_row($result)) {
             $uneVideo = new Video();
             $uneVideo->numvideo = $row[0];
             $uneVideo->legendeVideo = $row[1];
             $uneVideo->numparavideo = $row[2];
             $uneVideo->numparavideo = $row[2];
             $uneVideo->infosVideo();
             $this->videos[] = $uneVideo;
         }
     } else {
         $result = mysql_query("SELECT numvideo FROM if_video ORDER BY nom_video");
         while ($row = mysql_fetch_row($result)) {
             $uneVideo = new Video();
             $uneVideo->numvideo = $row[0];
             $uneVideo->infosVideo();
             $this->videos[] = $uneVideo;
         }
     }
     if (count($this->videos) >= 1) {
         return true;
     }
 }
开发者ID:rcampistron,项目名称:ParagrapheCMS,代码行数:31,代码来源:ListeVideos.inc.php

示例7: run

 public function run()
 {
     $model = new Video();
     if (isset($_POST['Video'])) {
         $model->attributes = $_POST['Video'];
         //封面、文件
         $model->cover_image = isset($_POST['cover_image']) ? $_POST['cover_image'] : '';
         $model->video_file = isset($_POST['video_file']) ? $_POST['video_file'] : '';
         //标签   (前5个标签有效)
         $tags = trim($_POST['Video']['tags']);
         $unique_tags = array_unique(explode(',', str_replace(array(' ', ','), array('', ','), $tags)));
         $explodeTags = array_slice($unique_tags, 0, 5);
         $model->tags = implode(',', $explodeTags);
         $model->create_time = time();
         $model->update_time = $model->create_time;
         if ($model->save()) {
             $this->controller->message('success', Yii::t('admin', 'Add Success'), $this->controller->createUrl('index'));
         }
     }
     //判断有无栏目
     $article_cat = Catalog::model()->find('type=:type', array(':type' => $this->controller->_type));
     if (!$article_cat) {
         $this->controller->message('error', Yii::t('admin', 'No Catalog'), $this->controller->createUrl('index'));
     }
     $this->controller->render('create', array('model' => $model));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:26,代码来源:CreateAction.php

示例8: fillVideo

 public static function fillVideo(Video $video)
 {
     $videoType = DAOFactory::getVideoTypeDAO()->findById($video->getType());
     $videoTypeName = $videoType->getName() . 'Filler';
     $filler = new $videoTypeName($video);
     $video = $filler->getVideoTO();
     $video->setType($videoType->getName());
     return $video;
 }
开发者ID:anzasolutions,项目名称:simlandia,代码行数:9,代码来源:videofiller.class.php

示例9: remove

 public static function remove(Video $video)
 {
     if (!Session::get('is_admin')) {
         if ($video->user_id !== Auth::user()->id_member) {
             return false;
         }
     }
     $video->delete();
     return true;
 }
开发者ID:hristodinev,项目名称:site,代码行数:10,代码来源:Video.php

示例10: actionVideo

 public function actionVideo()
 {
     $model = new Video('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Video'])) {
         $model->attributes = $_GET['Video'];
     }
     $this->render('video', compact('model'));
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:10,代码来源:ListController.php

示例11: buildArrayVideo

 /**
  * @param array $result
  * @return ArrayObject
  */
 private function buildArrayVideo($result)
 {
     $arrayVideo = new ArrayObject();
     foreach ($result as $row) {
         $video = new Video($row['title'], $row['link'], $row['date']);
         $video->setId($row['id']);
         $arrayVideo->append($video);
     }
     return $arrayVideo;
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:14,代码来源:VideoDao.php

示例12: save_item_action

function save_item_action($data)
{
    global $fpdo;
    debug($data, 'posted data');
    $oVideo = new Video($data['path']);
    $video_id = $oVideo->get_videoID();
    $data['path'] = $video_id;
    debug($data['path'], 'posted path');
    $oItem = new Item($fpdo);
    $id = $oItem->add($data);
    debug($id, 'id');
}
开发者ID:MattCouv,项目名称:dev.batata.fr,代码行数:12,代码来源:controllers.php

示例13: smarty_cms_function_Video

function smarty_cms_function_Video($params, &$smarty)
{
    $vid = new Video();
    if (isset($params['url'])) {
        $vid->setVideoUrl($params['url']);
    }
    if (isset($params['width'])) {
        $vid->setWidth((int) $params['width']);
    }
    if (isset($params['height'])) {
        $vid->setHeight((int) $params['height']);
    }
    return $vid->getHtml();
}
开发者ID:retohugi,项目名称:CMSMS-Plugins,代码行数:14,代码来源:function.video.php

示例14: getRandomCompositionConsideringRelevance

 public function getRandomCompositionConsideringRelevance()
 {
     $composerModel = new Composer();
     $videoModel = new Video();
     $lessonCompositionModel = new LessonComposition();
     $lessonComposerModel = new LessonComposer();
     $composition['composition'] = $this->getRandomComposition();
     $composerId = $composition['composition']['composer_id'];
     $compositionId = $composition['composition']['id'];
     $composition['videos'] = $videoModel->getVideosComposition($compositionId);
     $composition['composer'] = $composerModel->getComposer($composerId);
     $composition['lessons']['composer'] = $lessonComposerModel->getLessonsComposer($composerId);
     $composition['lessons']['composition'] = $lessonCompositionModel->getLessonsComposition($compositionId);
     return $composition;
 }
开发者ID:ojoven,项目名称:amadeus,代码行数:15,代码来源:composition.php

示例15: submit

 /**
  * Actually inserts the Video into the DB if validation passes
  *
  * @param $data Array
  * @return bool
  */
 public function submit(array $data)
 {
     list($url, $provider) = $this->getUrlAndProvider($data['Video']);
     $this->video->addVideo($url, $provider, false, $data['Watch']);
     $this->getOutput()->redirect($this->video->getTitle()->getFullURL());
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:13,代码来源:SpecialAddVideo.php


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