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


PHP Statistics::countUsers方法代码示例

本文整理汇总了PHP中Statistics::countUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP Statistics::countUsers方法的具体用法?PHP Statistics::countUsers怎么用?PHP Statistics::countUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Statistics的用法示例。


在下文中一共展示了Statistics::countUsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

     break;
 case 'coursebylanguage':
     Statistics::printCourseByLanguageStats();
     break;
 case 'courselastvisit':
     Statistics::printCourseLastVisit();
     break;
 case 'users':
     // total amount of users
     $teachers = $students = array();
     $countInvisible = isset($_GET['count_invisible_courses']) ? intval($_GET['count_invisible_courses']) : null;
     Statistics::printStats(get_lang('NumberOfUsers'), array(get_lang('Teachers') => Statistics::countUsers(COURSEMANAGER, null, $countInvisible), get_lang('Students') => Statistics::countUsers(STUDENT, null, $countInvisible)));
     foreach ($course_categories as $code => $name) {
         $name = str_replace(get_lang('Department'), "", $name);
         $teachers[$name] = Statistics::countUsers(COURSEMANAGER, $code, $countInvisible);
         $students[$name] = Statistics::countUsers(STUDENT, $code, $countInvisible);
     }
     // docents for each course category
     Statistics::printStats(get_lang('Teachers'), $teachers);
     // students for each course category
     Statistics::printStats(get_lang('Students'), $students);
     break;
 case 'recentlogins':
     echo '<h2>' . sprintf(get_lang('LastXDays'), '15') . '</h2>';
     echo '<canvas class="col-md-12" id="canvas" height="100px" style="margin-bottom: 20px"></canvas>';
     Statistics::printRecentLoginStats();
     Statistics::printRecentLoginStats(true);
     break;
 case 'logins':
     Statistics::printLoginStats($_GET['type']);
     break;
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:index.php

示例2: check_system_version

/**
 * Check if the current installation is up to date
 * The code is borrowed from phpBB and slighlty modified
 * @author The phpBB Group <support@phpbb.com> (the code)
 * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University (the modifications)
 * @author Yannick Warnier <ywarnier@beeznest.org> for the move to HTTP request
 * @copyright (C) 2001 The phpBB Group
 * @return string language string with some layout (color)
 */
function check_system_version()
{
    global $_configuration;
    $system_version = trim($_configuration['system_version']);
    // the chamilo version of your installation
    if (ini_get('allow_url_fopen') == 1) {
        // The number of courses
        $number_of_courses = Statistics::countCourses();
        // The number of users
        $number_of_users = Statistics::countUsers();
        $number_of_active_users = Statistics::countUsers(null, null, null, true);
        // The number of sessions
        $number_of_sessions = Statistics::countSessions();
        $data = array('url' => api_get_path(WEB_PATH), 'campus' => api_get_setting('platform.site_name'), 'contact' => api_get_setting('admin.administrator_email'), 'version' => $system_version, 'numberofcourses' => $number_of_courses, 'numberofusers' => $number_of_users, 'numberofactiveusers' => $number_of_active_users, 'numberofsessions' => $number_of_sessions, 'donotlistcampus' => api_get_setting('platform.donotlistcampus'), 'organisation' => api_get_setting('platform.institution'), 'language' => api_get_setting('language.platform_language'), 'adminname' => api_get_setting('admin.administrator_name') . ' ' . api_get_setting('admin.administrator_surname'), 'ip' => $_SERVER['REMOTE_ADDR']);
        $version = null;
        // version.php has been updated to include the version in an HTTP header
        // called "X-Chamilo-Version", so that we don't have to worry about
        // issues with the content not being returned by fread for some reason
        $res = _http_request('version.chamilo.org', 80, '/version.php', $data, 5, null, true);
        $lines = preg_split('/\\r\\n/', $res);
        foreach ($lines as $line) {
            $elements = preg_split('/:/', $line);
            // extract the X-Chamilo-Version header from the version.php response
            if (strcmp(trim($elements[0]), 'X-Chamilo-Version') === 0) {
                $version = trim($elements[1]);
            }
        }
        if (substr($res, 0, 5) != 'Error') {
            if (empty($version)) {
                $version_info = $res;
            } else {
                $version_info = $version;
            }
            if ($system_version != $version_info) {
                $output = '<br /><span style="color:red">' . get_lang('YourVersionNotUpToDate') . '. ' . get_lang('LatestVersionIs') . ' <b>Chamilo ' . $version_info . '</b>. ' . get_lang('YourVersionIs') . ' <b>Chamilo ' . $system_version . '</b>. ' . str_replace('http://www.chamilo.org', '<a href="http://www.chamilo.org">http://www.chamilo.org</a>', get_lang('PleaseVisitOurWebsite')) . '</span>';
            } else {
                $output = '<br /><span style="color:green">' . get_lang('VersionUpToDate') . ': Chamilo ' . $version_info . '</span>';
            }
        } else {
            $output = '<span style="color:red">' . get_lang('ImpossibleToContactVersionServerPleaseTryAgain') . '</span>';
        }
    } else {
        $output = '<span style="color:red">' . get_lang('AllowurlfopenIsSetToOff') . '</span>';
    }
    return $output;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:55,代码来源:admin.ajax.php

示例3: get_global_information_data

 /**
  * Get global information data
  * @return array
  */
 function get_global_information_data()
 {
     // Two-dimensional array with data about the system
     $path = api_get_path(WEB_CODE_PATH);
     // Check total number of users
     $global_info = array(array(get_lang('CountUsers'), '<a href="' . $path . 'admin/user_list.php">' . Statistics::countUsers() . '</a>'), array(get_lang('NumberOfUsersActive'), '<a href="' . $path . 'admin/user_list.php?keyword_firstname=&amp;keyword_lastname=&amp;keyword_username=&amp;keyword_email=&amp;keyword_officialcode=&amp;keyword_status=%25&amp;keyword_active=1&amp;submit=&amp;_qf__advanced_search=">' . Statistics::countUsers(null, null, null, true) . '</a>'), array(get_lang('NumberOfCoursesTotal'), '<a href="' . $path . 'admin/course_list.php">' . Statistics::countCourses() . '</a>'), array(get_lang('NumberOfCoursesPublic'), '<a href="' . $path . 'admin/course_list.php?keyword_code=&amp;keyword_title=&amp;keyword_language=%25&amp;keyword_category=&amp;keyword_visibility=' . COURSE_VISIBILITY_OPEN_WORLD . '&amp;keyword_subscribe=%25&amp;keyword_unsubscribe=%25&amp;submit=&amp;_qf__advanced_course_search=">' . Statistics::countCoursesByVisibility(COURSE_VISIBILITY_OPEN_WORLD) . '</a>'), array(get_lang('NumberOfCoursesOpen'), '<a href="' . $path . 'admin/course_list.php?keyword_code=&amp;keyword_title=&amp;keyword_language=%25&amp;keyword_category=&amp;keyword_visibility=' . COURSE_VISIBILITY_OPEN_PLATFORM . '&amp;keyword_subscribe=%25&amp;keyword_unsubscribe=%25&amp;submit=&amp;_qf__advanced_course_search=">' . Statistics::countCoursesByVisibility(COURSE_VISIBILITY_OPEN_PLATFORM) . '</a>'), array(get_lang('NumberOfCoursesPrivate'), '<a href="' . $path . 'admin/course_list.php?keyword_code=&amp;keyword_title=&amp;keyword_language=%25&amp;keyword_category=&amp;keyword_visibility=' . COURSE_VISIBILITY_REGISTERED . '&amp;keyword_subscribe=%25&amp;keyword_unsubscribe=%25&amp;submit=&amp;_qf__advanced_course_search=">' . Statistics::countCoursesByVisibility(COURSE_VISIBILITY_REGISTERED) . '</a>'), array(get_lang('NumberOfCoursesClosed'), '<a href="' . $path . 'admin/course_list.php?keyword_code=&amp;keyword_title=&amp;keyword_language=%25&amp;keyword_category=&amp;keyword_visibility=' . COURSE_VISIBILITY_CLOSED . '&amp;keyword_subscribe=%25&amp;keyword_unsubscribe=%25&amp;submit=&amp;_qf__advanced_course_search=">' . Statistics::countCoursesByVisibility(COURSE_VISIBILITY_CLOSED) . '</a>'), array(get_lang('NumberOfCoursesHidden'), '<a href="' . $path . 'admin/course_list.php?keyword_code=&amp;keyword_title=&amp;keyword_language=%25&amp;keyword_category=&amp;keyword_visibility=' . COURSE_VISIBILITY_HIDDEN . '&amp;keyword_subscribe=%25&amp;keyword_unsubscribe=%25&amp;submit=&amp;_qf__advanced_course_search=">' . Statistics::countCoursesByVisibility(COURSE_VISIBILITY_HIDDEN) . '</a>'));
     return $global_info;
 }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:12,代码来源:block_global_info.class.php


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