当前位置: 首页>>代码示例>>PHP>>正文


PHP cmsUser::getCountAllUsers方法代码示例

本文整理汇总了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;
}
开发者ID:4uva4ek,项目名称:svato,代码行数:52,代码来源:module.php

示例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;
}
开发者ID:deltas1,项目名称:icms1,代码行数:16,代码来源:module.php

示例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;
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:21,代码来源:module.php


注:本文中的cmsUser::getCountAllUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。