本文整理汇总了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);
}