本文整理匯總了PHP中Groups::getCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP Groups::getCount方法的具體用法?PHP Groups::getCount怎麽用?PHP Groups::getCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Groups
的用法示例。
在下文中一共展示了Groups::getCount方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AdminPage
<?php
require_once './config.php';
$page = new AdminPage();
$groups = new Groups(['Settings' => $page->settings]);
$gname = "";
if (isset($_REQUEST['groupname']) && !empty($_REQUEST['groupname'])) {
$gname = $_REQUEST['groupname'];
}
$groupcount = $groups->getCount($gname);
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$groupname = isset($_REQUEST['groupname']) && !empty($_REQUEST['groupname']) ? $_REQUEST['groupname'] : '';
$page->smarty->assign('groupname', $groupname);
$page->smarty->assign('pagertotalitems', $groupcount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$groupsearch = $gname != "" ? 'groupname=' . $gname . '&' : '';
$page->smarty->assign('pagerquerybase', WWW_TOP . "/group-list.php?" . $groupsearch . "offset=");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$grouplist = $groups->getRange($offset, ITEMS_PER_PAGE, $gname);
$page->smarty->assign('grouplist', $grouplist);
$page->title = "Group List";
$page->content = $page->smarty->fetch('group-list.tpl');
$page->render();
示例2: AdminPage
<?php
require_once "config.php";
require_once WWW_DIR . "/lib/adminpage.php";
require_once WWW_DIR . "/lib/groups.php";
$page = new AdminPage();
$groups = new Groups();
$gname = "";
if (isset($_REQUEST['groupname']) && !empty($_REQUEST['groupname'])) {
$gname = $_REQUEST['groupname'];
}
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$groupname = isset($_REQUEST['groupname']) && !empty($_REQUEST['groupname']) ? $_REQUEST['groupname'] : '';
$activeonly = isset($_REQUEST['active']) && $_REQUEST['active'] == "1" ? 1 : 0;
$groupcount = $groups->getCount($gname, $activeonly == 1);
$page->smarty->assign('groupname', $groupname);
$page->smarty->assign('active', $activeonly);
$page->smarty->assign('pagertotalitems', $groupcount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$groupsearch = $gname != "" ? 'groupname=' . $gname . '&' : '';
$groupsearch .= $activeonly != "" ? 'active=' . $activeonly . '&' : '';
$page->smarty->assign('pagerquerybase', WWW_TOP . "/group-list.php?" . $groupsearch . "offset=");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$grouplist = $groups->getRange($offset, ITEMS_PER_PAGE, $gname, $activeonly == 1);
$page->smarty->assign('active_ids', array(1, 0));
$page->smarty->assign('active_names', array('Active', 'All'));
$page->smarty->assign('grouplist', $grouplist);
$page->title = "Group List";
$page->content = $page->smarty->fetch('group-list.tpl');
示例3: getActiveGroupCount
public function getActiveGroupCount()
{
$g = new Groups();
$active_groups = $g->getCount("", true);
printf('<span class="icon32 icon-blue icon-comment"></span>
<div>Active Groups</div>
<div>%s</div>', $active_groups);
}