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


PHP Sh404sefHelperGeneral::getUserGroups方法代码示例

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


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

示例1: buildUserLevelsList

 /**
  * Builds a select list with all possible user levels
  *
  * Adapted from JCal pro
  *
  * @param $current
  * @param $name
  * @param $autoSubmit
  * @param $addSelectAll
  * @param $selectAllTitle
  */
 public static function buildUserLevelsList($current, $name, $autoSubmit = false, $addSelectAll = false, $selectAllTitle = '', $customSubmit = '')
 {
     // get a list of available user groups
     $groups = Sh404sefHelperGeneral::getUserGroups();
     // build html options
     $data = array();
     foreach ($groups as $id => $group) {
         $data[] = array('id' => $group, 'title' => $group);
     }
     // use helper to build html
     $list = self::buildSelectList($data, $current, $name, $autoSubmit, $addSelectAll, $selectAllTitle, $customSubmit);
     // return list
     return $list;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:25,代码来源:html.php

示例2: _addCustomVars

 protected function _addCustomVars()
 {
     $this->_formatedResponse->perf = new stdClass();
     // prepare time and memory calculation
     $field = 'customVarValue' . SH404SEF_ANALYTICS_TIME_CUSTOM_VAR;
     $totalPages = 0;
     $totalTime = 0;
     $totalMemory = 0;
     // now iterate over time and memory records
     foreach ($this->_rawData['page-creation-time'] as $entry) {
         $record = intval($entry->dimension[$field]);
         // make it an int, this will remove dev data that had decimals
         // sanitize
         $record = $record < 3 ? 0 : $record;
         // we only calculate averaged on pages we have time and ram data for
         if (!empty($record)) {
             // separate time and memory
             $time = $record >> 4;
             // bits 5 and up
             $memory = $record & 15;
             // bits 1 to 4
             // aggregate
             $totalPages += $entry->pageviews;
             $totalTime += Sh404sefHelperAnalytics::declassifyTime($time) * $entry->pageviews;
             $totalMemory += Sh404sefHelperAnalytics::declassifyMemory($memory) * $entry->pageviews;
         }
     }
     // calculate averages time and ram now
     $this->_formatedResponse->perf->avgPageCreationTime = empty($totalPages) ? 0 : $totalTime / $totalPages;
     $this->_formatedResponse->perf->avgMemoryUsed = empty($totalPages) ? 0 : $totalMemory / $totalPages;
     // logged in users handling
     $field = 'customVarValue' . SH404SEF_ANALYTICS_USER_CUSTOM_VAR;
     $groups = Sh404sefHelperGeneral::getUserGroups();
     $loggedInPages = 0;
     foreach ($this->_rawData['logged-in-users'] as $entry) {
         $userType = urldecode($entry->dimension[$field]);
         // if user was logged in, any group, including "Public Frontend"
         if (in_array($userType, $groups)) {
             // include # of pages
             $loggedInPages += $entry->pageviews;
         }
     }
     $this->_formatedResponse->perf->loggedInUserRate = empty($this->_formatedResponse->global->pageviews) ? 0 : $loggedInPages / $this->_formatedResponse->global->pageviews;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:44,代码来源:analyticsgareportdashboard.php


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