本文整理匯總了PHP中NewsStory::updateCounter方法的典型用法代碼示例。如果您正苦於以下問題:PHP NewsStory::updateCounter方法的具體用法?PHP NewsStory::updateCounter怎麽用?PHP NewsStory::updateCounter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NewsStory
的用法示例。
在下文中一共展示了NewsStory::updateCounter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
if (!$gperm_handler->checkRight('news_view', $article->topicid(), $groups, $xoopsModule->getVar('mid'))) {
redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
exit;
}
$storypage = isset($_GET['page']) ? intval($_GET['page']) : 0;
$dateformat = news_getmoduleoption('dateformat');
$hcontent = '';
/**
* update counter only when viewing top page and when you are not the author or an admin
*/
if (empty($_GET['com_id']) && $storypage == 0) {
if (is_object($xoopsUser)) {
if ($xoopsUser->getVar('uid') == $article->uid() || news_is_admin_group()) {
// nothing ! ;-)
} else {
$article->updateCounter();
}
} else {
$article->updateCounter();
}
}
$xoopsOption['template_main'] = 'news_article.html';
include_once XOOPS_ROOT_PATH . '/header.php';
$story['id'] = $storyid;
$story['posttime'] = formatTimestamp($article->published(), $dateformat);
$story['news_title'] = $article->title();
$story['title'] = $article->textlink() . ' : ' . $article->title();
$story['topic_title'] = $article->textlink();
$story['text'] = $article->hometext();
$bodytext = $article->bodytext();
if (xoops_trim($bodytext) != '') {