本文整理汇总了PHP中CGlobal::news_details方法的典型用法代码示例。如果您正苦于以下问题:PHP CGlobal::news_details方法的具体用法?PHP CGlobal::news_details怎么用?PHP CGlobal::news_details使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGlobal
的用法示例。
在下文中一共展示了CGlobal::news_details方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct()
{
Form::Form('NewsDetailForm');
$id = Url::get('news_id', 0);
if ($id) {
if (!CGlobal::$news_details) {
CGlobal::$news_details = DB::select("news", "id={$id}");
}
if (CGlobal::$news_details && (CGlobal::$news_details['status'] == 1 || CGlobal::$news_details['status'] == 0 && User::have_permit(ADMIN_NEWS))) {
$this->news = CGlobal::$news_details;
}
}
if (!$this->news) {
Url::redirect('news_list', array('news_catid', 'azname'));
} else {
DB::query("UPDATE news SET view_num=view_num+1 WHERE id =" . $this->news['id']);
}
$news_title = $this->news['title'];
$catid = $this->news['news_catid'];
$str_keywords = '';
$str_catSub = '';
$meta_keywords = '';
$meta_desc = '';
if (isset(CGlobal::$allNewsCategories[$catid])) {
$news_title .= " - " . CGlobal::$allNewsCategories[$catid]['name'];
$curMainCat = CGlobal::$allNewsCategories[$catid];
$str_catSub = $curMainCat['name'];
if ($curMainCat['keywords']) {
$meta_keywords .= ($meta_keywords ? ', ' : '') . $curMainCat['keywords'];
}
if ($curMainCat['description']) {
$meta_desc .= ($meta_desc ? ', ' : '') . $curMainCat['description'];
}
}
if ($this->news['brief']) {
CGlobal::$meta_desc = AZLib::cleanHtml($this->news['brief']);
} elseif ($meta_desc != '') {
CGlobal::$meta_desc = $meta_desc;
}
if ($meta_keywords != '') {
CGlobal::$keywords = $meta_keywords;
} elseif ($str_catSub != '') {
CGlobal::$keywords = $str_catSub;
}
CGlobal::$website_title = stripslashes($news_title) . ' - Tin tức';
//CGlobal::$website_title = AznetLib::subString($news_title,0,100,true);
// $this->link_css('style/aznet/jquery.lightbox.css');
// $this->link_js('javascript/jquery/lightbox/jquery.lightbox.js');
}