當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。