本文整理汇总了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'));
}
示例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);
}
示例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'));
}
示例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);
}
示例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");
}
示例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;
}
}
示例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));
}
示例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;
}
示例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;
}
示例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'));
}
示例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;
}
示例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');
}
示例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();
}
示例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;
}
示例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;
}