本文整理汇总了PHP中Video::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::getInstance方法的具体用法?PHP Video::getInstance怎么用?PHP Video::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionDisplay
public function actionDisplay()
{
$id = Request::getVar('id', null);
$alias = Request::getVar('alias', null);
$model = Video::getInstance();
if ($id == null or $id == "") {
if ($alias != null and $alias != "") {
$obj_item = $model->getItemByAlias($alias);
} else {
header("Location: /");
}
} else {
$obj_item = $model->getItem($id);
}
$items = $model->getItems($obj_item['catID'], true, 4);
$items2 = $model->getItems($obj_item['catID'], false, 9);
$obj_category = $model->getCategory($obj_item['catID']);
$data['item'] = $obj_item;
$data['items'] = $items;
$data['items2'] = $items2;
$data['category'] = $obj_category;
$page_title = $obj_item['title'];
$page_keyword = $obj_item['metakey'] != "" ? $obj_item['metakey'] : $page_title;
$page_description = $obj_item['metadesc'] != "" ? $obj_item['metadesc'] : $page_title;
setSysConfig("seopage.title", $page_title);
setSysConfig("seopage.keyword", $page_keyword);
setSysConfig("seopage.description", $page_description);
Request::setVar('alias', $obj_category['alias']);
$this->render('default', $data);
}
示例2: actionEdit
public function actionEdit()
{
$cid = Request::getVar('cid', "");
setSysConfig("sidebar.display", 0);
$this->addIconToolbar("Save", Router::buildLink("videos", array('layout' => 'save')), "save");
$this->addIconToolbar("Apply", Router::buildLink("videos", array('layout' => 'apply')), "apply");
$this->addBarTitle("Video <small>[Edit]</small>", "user");
$this->addIconToolbar("Close", Router::buildLink("videos", array('layout' => 'cancel')), "cancel");
$this->pageTitle = "Edit video";
$model = Video::getInstance();
$item = $model->getItem($cid);
global $user;
if (!($bool = $user->modifyChecking($item->created_by))) {
$obj_users = YiiUser::getInstance();
$item_user = $obj_users->getUser($item->created_by);
YiiMessage::raseNotice("Your account not have permission to edit resource of: {$item_user->username}");
$this->redirect(Router::buildLink("article"));
return false;
}
$list = $model->getListEdit($item);
$this->render('edit', array("item" => $item, "list" => $list));
}
示例3: actionBlog
public function actionBlog()
{
$model = Video::getInstance();
$catAlias = Request::getVar('alias', null);
$catID = Request::getVar("id");
$currentPage = Request::getVar('page', 1);
$limit = 12;
$data['alias'] = $catAlias;
$obj_category = $model->getCategory($catID, $catAlias);
if ($obj_category == false) {
$this->redirect(Router::buildLink('videos'));
}
if ($currentPage == 1) {
$data['items'] = $model->getItems($obj_category['id'], true, 5);
}
$start = ($currentPage - 1) * $limit;
$data['items2'] = $model->getItems($obj_category['id'], false, $limit, $start);
if ($obj_category['total'] > $start + $limit) {
$page = $currentPage + 1;
} else {
$page = $currentPage - 1;
}
$catAlias = $obj_category['alias'];
$params = array("view" => "category", "id" => $obj_category['id'], "alias" => $obj_category['alias'], "page" => $page);
$obj_category['pagemore'] = Router::buildLink('videos', $params);
$page_title = $obj_category['title'];
if ($currentPage > 1) {
$page_title = $page_title . " trang {$currentPage}";
}
$page_keyword = $obj_category['metakey'] != "" ? $obj_category['metakey'] : $page_title;
$page_description = $obj_category['metadesc'] != "" ? $obj_category['metadesc'] : $page_title;
setSysConfig("seopage.title", $page_title);
setSysConfig("seopage.keyword", $page_keyword);
setSysConfig("seopage.description", $page_description);
$data['category'] = $obj_category;
$this->render('blog', $data);
}