本文整理汇总了PHP中NewsStory::get方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsStory::get方法的具体用法?PHP NewsStory::get怎么用?PHP NewsStory::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsStory
的用法示例。
在下文中一共展示了NewsStory::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: NewsStory
<?php
global $cgi;
loader_import('news.Story');
loader_import('news.Functions');
$story = new NewsStory();
if (!empty($parameters['story'])) {
// view story
$obj = $story->get($parameters['story']);
if (!$obj) {
echo template_simple('not_found.spt', array('error' => $story->error));
return;
}
if (!empty($parameters['highlight'])) {
loader_import('saf.Misc.Search');
$obj->body = search_bar($parameters['highlight'], '/index/news-search-action') . search_highlight($obj->body, $parameters['highlight']);
$obj->highlight = $parameters['highlight'];
}
$pages = news_page_split($obj->body);
if (!$cgi->pagenum) {
$cgi->pagenum = 1;
}
$obj->body = news_page_nav($pages, $cgi->pagenum, $obj->id, $parameters['highlight']);
$obj->pagenum = $cgi->pagenum;
if (appconf('comments')) {
$obj->comments = true;
loader_import('news.Comment');
$c = new NewsComment();
$c->orderBy('ts asc');
$obj->commentList = $c->find($obj->id);
if (!$obj->commentList) {
示例2: template_simple
<?php
loader_import('news.Story');
loader_import('news.Functions');
$s = new NewsStory();
$story = $s->get($parameters['story']);
$story->show_thumb = $parameters['thumb'];
$story->show_date = $parameters['date'];
$story->show_summary = $parameters['summary'];
echo template_simple('sidebar_single.spt', $story);