本文整理汇总了PHP中Forum::getBrowseCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Forum::getBrowseCount方法的具体用法?PHP Forum::getBrowseCount怎么用?PHP Forum::getBrowseCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forum
的用法示例。
在下文中一共展示了Forum::getBrowseCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Forum
<?php
if (!$page->users->isLoggedIn()) {
$page->show403();
}
$forum = new Forum(['Settings' => $page->settings]);
if ($page->isPostBack()) {
$forum->add(0, $page->users->currentUserId(), $_POST["addSubject"], $_POST["addMessage"]);
header("Location:" . WWW_TOP . "/forum");
exit;
}
$offset = isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset']) ? $_REQUEST["offset"] : 0;
$results = array();
$results = $forum->getBrowseRange($offset, ITEMS_PER_PAGE);
$page->smarty->assign('pagertotalitems', $forum->getBrowseCount());
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', WWW_TOP . "/forum?offset=");
$page->smarty->assign('pagerquerysuffix', "#results");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$page->smarty->assign('results', $results);
$page->meta_title = "Forum";
$page->meta_keywords = "forum,chat,posts";
$page->meta_description = "Forum";
$page->content = $page->smarty->fetch('forum.tpl');
$page->render();
示例2: Forum
<?php
require_once WWW_DIR . "/lib/forum.php";
$forum = new Forum();
if (!$users->isLoggedIn()) {
$page->show403();
}
if ($page->isPostBack()) {
$forum->add(0, $users->currentUserId(), $_POST["addSubject"], $_POST["addMessage"]);
header("Location:" . WWW_TOP . "/forum");
die;
}
$browsecount = $forum->getBrowseCount();
$offset = isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset']) ? $_REQUEST["offset"] : 0;
$results = array();
$results = $forum->getBrowseRange($offset, ITEMS_PER_PAGE);
$page->smarty->assign('pagertotalitems', $browsecount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', WWW_TOP . "/forum?offset=");
$page->smarty->assign('pagerquerysuffix', "#results");
$pager = $page->smarty->fetch($page->getCommonTemplate("pager.tpl"));
$page->smarty->assign('pager', $pager);
$page->smarty->assign('results', $results);
$page->meta_title = "Forum";
$page->meta_keywords = "forum,chat,posts";
$page->meta_description = "Forum";
$page->content = $page->smarty->fetch('forum.tpl');
$page->render();