本文整理汇总了PHP中cmsUser::getCountAllUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::getCountAllUsers方法的具体用法?PHP cmsUser::getCountAllUsers怎么用?PHP cmsUser::getCountAllUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsUser
的用法示例。
在下文中一共展示了cmsUser::getCountAllUsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mod_user_stats
function mod_user_stats($module_id, $cfg)
{
$inDB = cmsDatabase::getInstance();
cmsCore::loadLanguage('components/users');
global $_LANG;
if (!isset($cfg['show_total'])) {
$cfg['show_total'] = 1;
}
if (!isset($cfg['show_online'])) {
$cfg['show_online'] = 1;
}
if (!isset($cfg['show_gender'])) {
$cfg['show_gender'] = 1;
}
if (!isset($cfg['show_city'])) {
$cfg['show_city'] = 1;
}
$total_usr = cmsUser::getCountAllUsers();
if ($cfg['show_gender']) {
$gender_stats = array();
//male
$gender_stats['male'] = $inDB->rows_count('cms_users u INNER JOIN cms_user_profiles p ON p.user_id = u.id', "u.is_locked = 0 AND u.is_deleted = 0 AND p.gender = 'm'");
//female
$gender_stats['female'] = $inDB->rows_count('cms_users u INNER JOIN cms_user_profiles p ON p.user_id = u.id', "u.is_locked = 0 AND u.is_deleted = 0 AND p.gender = 'f'");
//unknown
$gender_stats['unknown'] = $total_usr - $gender_stats['male'] - $gender_stats['female'];
}
if ($cfg['show_city']) {
$sql = "SELECT IF (p.city != '', p.city, '{$_LANG['NOT_DECIDE']}') city, COUNT( p.user_id ) count\n FROM cms_users u\n LEFT JOIN cms_user_profiles p ON p.user_id = u.id\n WHERE u.is_locked =0 AND u.is_deleted =0\n GROUP BY p.city";
$rs = $inDB->query($sql);
$city_stats = array();
if ($inDB->num_rows($rs)) {
while ($row = $inDB->fetch_assoc($rs)) {
if ($row['city'] != $_LANG['NOT_DECIDE']) {
$row['href'] = '/users/city/' . urlencode($row['city']);
} else {
$row['href'] = '';
}
$row['city'] = icms_ucfirst(mb_strtolower($row['city']));
$city_stats[] = $row;
}
}
}
if ($cfg['show_online']) {
$people = cmsUser::getOnlineCount();
}
if ($cfg['show_bday']) {
$bday = cmsUser::getBirthdayUsers();
}
cmsPage::initTemplate('modules', 'mod_user_stats')->assign('cfg', $cfg)->assign('total_usr', $total_usr)->assign('gender_stats', $gender_stats)->assign('city_stats', $city_stats)->assign('usr_online', cmsUser::sessionGet('usr_online'))->assign('people', $people)->assign('bday', $bday)->display('mod_user_stats.tpl');
return true;
}
示例2: mod_lastreg
function mod_lastreg($mod, $cfg)
{
$inDB = cmsDatabase::getInstance();
cmsCore::loadModel('users');
$model = new cms_model_users();
$inDB->orderBy('regdate', 'DESC');
$inDB->limitPage(1, $cfg['newscount']);
$users = $model->getUsers();
if ($cfg['view_type'] == 'list') {
$total_all = cmsUser::getCountAllUsers();
} else {
$total_all = 0;
}
cmsPage::initTemplate('modules', $cfg['tpl'])->assign('usrs', $users)->assign('cfg', $cfg)->assign('total_all', $total_all)->assign('total', sizeof($users))->display($cfg['tpl']);
return true;
}
示例3: mod_lastreg
function mod_lastreg($mod, $cfg) {
cmsCore::c('db')->orderBy('regdate', 'DESC');
cmsCore::c('db')->limitPage(1, $cfg['newscount']);
$users = cmsCore::m('users')->getUsers();
if ($cfg['view_type'] == 'list') {
$total_all = cmsUser::getCountAllUsers();
} else {
$total_all = 0;
}
cmsPage::initTemplate('modules', $cfg['tpl'])->
assign('users', $users)->
assign('cfg', $cfg)->
assign('total_all', $total_all)->
assign('total', sizeof($users))->
display();
return true;
}