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


PHP SiteStats::activeUsers方法代码示例

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


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

示例1: execute

 public function execute($par)
 {
     $this->setHeaders();
     $this->getOutput()->addModuleStyles('mediawiki.special');
     $this->edits = SiteStats::edits();
     $this->good = SiteStats::articles();
     $this->images = SiteStats::images();
     $this->total = SiteStats::pages();
     $this->users = SiteStats::users();
     $this->activeUsers = SiteStats::activeUsers();
     $this->hook = '';
     $text = Xml::openElement('table', ['class' => 'wikitable mw-statistics-table']);
     # Statistic - pages
     $text .= $this->getPageStats();
     # Statistic - edits
     $text .= $this->getEditStats();
     # Statistic - users
     $text .= $this->getUserStats();
     # Statistic - usergroups
     $text .= $this->getGroupStats();
     # Statistic - other
     $extraStats = [];
     if (Hooks::run('SpecialStatsAddExtra', [&$extraStats, $this->getContext()])) {
         $text .= $this->getOtherStats($extraStats);
     }
     $text .= Xml::closeElement('table');
     # Customizable footer
     $footer = $this->msg('statistics-footer');
     if (!$footer->isBlank()) {
         $text .= "\n" . $footer->parse();
     }
     $this->getOutput()->addHTML($text);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:33,代码来源:SpecialStatistics.php

示例2: execute

 public function execute($par)
 {
     global $wgMemc, $wgDisableCounters, $wgMiserMode;
     $this->setHeaders();
     $this->getOutput()->addModuleStyles('mediawiki.special');
     $this->views = SiteStats::views();
     $this->edits = SiteStats::edits();
     $this->good = SiteStats::articles();
     $this->images = SiteStats::images();
     $this->total = SiteStats::pages();
     $this->users = SiteStats::users();
     $this->activeUsers = SiteStats::activeUsers();
     $this->hook = '';
     # Staticic - views
     $viewsStats = '';
     if (!$wgDisableCounters) {
         $viewsStats = $this->getViewsStats();
     }
     # Set active user count
     if (!$wgMiserMode) {
         $key = wfMemcKey('sitestats', 'activeusers-updated');
         // Re-calculate the count if the last tally is old...
         if (!$wgMemc->get($key)) {
             $dbw = wfGetDB(DB_MASTER);
             SiteStatsUpdate::cacheUpdate($dbw);
             $wgMemc->set($key, '1', 24 * 3600);
             // don't update for 1 day
         }
     }
     $text = Xml::openElement('table', array('class' => 'wikitable mw-statistics-table'));
     # Statistic - pages
     $text .= $this->getPageStats();
     # Statistic - edits
     $text .= $this->getEditStats();
     # Statistic - users
     $text .= $this->getUserStats();
     # Statistic - usergroups
     $text .= $this->getGroupStats();
     $text .= $viewsStats;
     # Statistic - popular pages
     if (!$wgDisableCounters && !$wgMiserMode) {
         $text .= $this->getMostViewedPages();
     }
     # Statistic - other
     $extraStats = array();
     if (wfRunHooks('SpecialStatsAddExtra', array(&$extraStats))) {
         $text .= $this->getOtherStats($extraStats);
     }
     $text .= Xml::closeElement('table');
     #<Wikia>
     wfRunHooks("CustomSpecialStatistics", array(&$this, &$text));
     #</Wikia>
     # Customizable footer
     $footer = wfMessage('statistics-footer');
     if (!$footer->isBlank()) {
         $text .= "\n" . $footer->parse();
     }
     $this->getOutput()->addHTML($text);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:59,代码来源:SpecialStatistics.php

示例3: execute

 public function execute($par)
 {
     global $wgOut, $wgMemc;
     global $wgDisableCounters, $wgMiserMode;
     $this->setHeaders();
     $this->views = SiteStats::views();
     $this->edits = SiteStats::edits();
     $this->good = SiteStats::articles();
     $this->images = SiteStats::images();
     $this->total = SiteStats::pages();
     $this->users = SiteStats::users();
     $this->activeUsers = SiteStats::activeUsers();
     $this->admins = SiteStats::numberingroup('sysop');
     $this->hook = '';
     # Staticic - views
     $viewsStats = '';
     if (!$wgDisableCounters) {
         $viewsStats = $this->getViewsStats();
     }
     # Set active user count
     if (!$wgMiserMode) {
         $key = wfMemcKey('sitestats', 'activeusers-updated');
         // Re-calculate the count if the last tally is old...
         if (!$wgMemc->get($key)) {
             $dbw = wfGetDB(DB_MASTER);
             SiteStatsUpdate::cacheUpdate($dbw);
             $wgMemc->set($key, '1', 24 * 3600);
             // don't update for 1 day
         }
     }
     $text = Xml::openElement('table', array('class' => 'wikitable mw-statistics-table'));
     # Statistic - pages
     $text .= $this->getPageStats();
     # Statistic - edits
     $text .= $this->getEditStats();
     # Statistic - users
     $text .= $this->getUserStats();
     # Statistic - usergroups
     $text .= $this->getGroupStats();
     $text .= $viewsStats;
     # Statistic - popular pages
     if (!$wgDisableCounters && !$wgMiserMode) {
         $text .= $this->getMostViewedPages();
     }
     # Statistic - other
     $extraStats = array();
     if (wfRunHooks('SpecialStatsAddExtra', array(&$extraStats))) {
         $text .= $this->getOtherStats($extraStats);
     }
     $text .= Xml::closeElement('table');
     # Customizable footer
     $footer = wfMsgExt('statistics-footer', array('parseinline'));
     if (!wfEmptyMsg('statistics-footer', $footer) && $footer != '') {
         $text .= "\n" . $footer;
     }
     $wgOut->addHTML($text);
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:57,代码来源:SpecialStatistics.php

示例4: execute

 public function execute($par)
 {
     global $wgOut, $wgRequest, $wgMessageCache;
     global $wgDisableCounters, $wgMiserMode;
     $wgMessageCache->loadAllMessages();
     $this->setHeaders();
     $this->views = SiteStats::views();
     $this->edits = SiteStats::edits();
     $this->good = SiteStats::articles();
     $this->images = SiteStats::images();
     $this->total = SiteStats::pages();
     $this->users = SiteStats::users();
     $this->activeUsers = SiteStats::activeUsers();
     $this->admins = SiteStats::numberingroup('sysop');
     $this->numJobs = SiteStats::jobs();
     # Staticic - views
     $viewsStats = '';
     if (!$wgDisableCounters) {
         $viewsStats = $this->getViewsStats();
     }
     # Set active user count
     if (!$wgMiserMode) {
         $dbw = wfGetDB(DB_MASTER);
         SiteStatsUpdate::cacheUpdate($dbw);
     }
     # Do raw output
     if ($wgRequest->getVal('action') == 'raw') {
         $this->doRawOutput();
     }
     $text = Xml::openElement('table', array('class' => 'mw-statistics-table'));
     # Statistic - pages
     $text .= $this->getPageStats();
     # Statistic - edits
     $text .= $this->getEditStats();
     # Statistic - users
     $text .= $this->getUserStats();
     # Statistic - usergroups
     $text .= $this->getGroupStats();
     $text .= $viewsStats;
     # Statistic - popular pages
     if (!$wgDisableCounters && !$wgMiserMode) {
         $text .= $this->getMostViewedPages();
     }
     $text .= Xml::closeElement('table');
     # Customizable footer
     $footer = wfMsgExt('statistics-footer', array('parseinline'));
     if (!wfEmptyMsg('statistics-footer', $footer) && $footer != '') {
         $text .= "\n" . $footer;
     }
     $wgOut->addHTML($text);
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:51,代码来源:SpecialStatistics.php

示例5: execute

 public function execute($par)
 {
     global $wgMemc;
     $miserMode = $this->getConfig()->get('MiserMode');
     $this->setHeaders();
     $this->getOutput()->addModuleStyles('mediawiki.special');
     $this->edits = SiteStats::edits();
     $this->good = SiteStats::articles();
     $this->images = SiteStats::images();
     $this->total = SiteStats::pages();
     $this->users = SiteStats::users();
     $this->activeUsers = SiteStats::activeUsers();
     $this->hook = '';
     # Set active user count
     if (!$miserMode) {
         $key = wfMemcKey('sitestats', 'activeusers-updated');
         // Re-calculate the count if the last tally is old...
         if (!$wgMemc->get($key)) {
             $dbw = wfGetDB(DB_MASTER);
             SiteStatsUpdate::cacheUpdate($dbw);
             $wgMemc->set($key, '1', 24 * 3600);
             // don't update for 1 day
         }
     }
     $text = Xml::openElement('table', array('class' => 'wikitable mw-statistics-table'));
     # Statistic - pages
     $text .= $this->getPageStats();
     # Statistic - edits
     $text .= $this->getEditStats();
     # Statistic - users
     $text .= $this->getUserStats();
     # Statistic - usergroups
     $text .= $this->getGroupStats();
     # Statistic - other
     $extraStats = array();
     if (Hooks::run('SpecialStatsAddExtra', array(&$extraStats, $this->getContext()))) {
         $text .= $this->getOtherStats($extraStats);
     }
     $text .= Xml::closeElement('table');
     # Customizable footer
     $footer = $this->msg('statistics-footer');
     if (!$footer->isBlank()) {
         $text .= "\n" . $footer->parse();
     }
     $this->getOutput()->addHTML($text);
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:46,代码来源:SpecialStatistics.php

示例6: register

 function register()
 {
     global $wgContLang, $wgNamespaceAliases, $wgDisableCounters;
     $lib = array('getNsIndex' => array($this, 'getNsIndex'), 'pagesInCategory' => array($this, 'pagesInCategory'), 'pagesInNamespace' => array($this, 'pagesInNamespace'), 'usersInGroup' => array($this, 'usersInGroup'), 'interwikiMap' => array($this, 'interwikiMap'));
     $info = array('siteName' => $GLOBALS['wgSitename'], 'server' => $GLOBALS['wgServer'], 'scriptPath' => $GLOBALS['wgScriptPath'], 'stylePath' => $GLOBALS['wgStylePath'], 'currentVersion' => SpecialVersion::getVersion());
     if (!self::$namespacesCache || self::$namespacesCacheLang !== $wgContLang->getCode()) {
         $namespaces = array();
         $namespacesByName = array();
         foreach ($wgContLang->getFormattedNamespaces() as $ns => $title) {
             $canonical = MWNamespace::getCanonicalName($ns);
             $namespaces[$ns] = array('id' => $ns, 'name' => $title, 'canonicalName' => strtr($canonical, '_', ' '), 'hasSubpages' => MWNamespace::hasSubpages($ns), 'hasGenderDistinction' => MWNamespace::hasGenderDistinction($ns), 'isCapitalized' => MWNamespace::isCapitalized($ns), 'isContent' => MWNamespace::isContent($ns), 'isIncludable' => !MWNamespace::isNonincludable($ns), 'isMovable' => MWNamespace::isMovable($ns), 'isSubject' => MWNamespace::isSubject($ns), 'isTalk' => MWNamespace::isTalk($ns), 'defaultContentModel' => MWNamespace::getNamespaceContentModel($ns), 'aliases' => array());
             if ($ns >= NS_MAIN) {
                 $namespaces[$ns]['subject'] = MWNamespace::getSubject($ns);
                 $namespaces[$ns]['talk'] = MWNamespace::getTalk($ns);
                 $namespaces[$ns]['associated'] = MWNamespace::getAssociated($ns);
             } else {
                 $namespaces[$ns]['subject'] = $ns;
             }
             $namespacesByName[strtr($title, ' ', '_')] = $ns;
             if ($canonical) {
                 $namespacesByName[$canonical] = $ns;
             }
         }
         $aliases = array_merge($wgNamespaceAliases, $wgContLang->getNamespaceAliases());
         foreach ($aliases as $title => $ns) {
             if (!isset($namespacesByName[$title]) && isset($namespaces[$ns])) {
                 $ct = count($namespaces[$ns]['aliases']);
                 $namespaces[$ns]['aliases'][$ct + 1] = $title;
                 $namespacesByName[$title] = $ns;
             }
         }
         $namespaces[NS_MAIN]['displayName'] = wfMessage('blanknamespace')->inContentLanguage()->text();
         self::$namespacesCache = $namespaces;
         self::$namespacesCacheLang = $wgContLang->getCode();
     }
     $info['namespaces'] = self::$namespacesCache;
     $info['stats'] = array('pages' => (int) SiteStats::pages(), 'articles' => (int) SiteStats::articles(), 'files' => (int) SiteStats::images(), 'edits' => (int) SiteStats::edits(), 'views' => $wgDisableCounters ? null : (int) SiteStats::views(), 'users' => (int) SiteStats::users(), 'activeUsers' => (int) SiteStats::activeUsers(), 'admins' => (int) SiteStats::numberingroup('sysop'));
     return $this->getEngine()->registerInterface('mw.site.lua', $lib, $info);
 }
开发者ID:sammykumar,项目名称:TheVRForums,代码行数:39,代码来源:SiteLibrary.php

示例7: appendStatistics

 protected function appendStatistics($property)
 {
     global $wgDisableCounters;
     $data = array();
     $data['pages'] = intval(SiteStats::pages());
     $data['articles'] = intval(SiteStats::articles());
     if (!$wgDisableCounters) {
         $data['views'] = intval(SiteStats::views());
     }
     $data['edits'] = intval(SiteStats::edits());
     $data['images'] = intval(SiteStats::images());
     $data['users'] = intval(SiteStats::users());
     $data['activeusers'] = intval(SiteStats::activeUsers());
     $data['admins'] = intval(SiteStats::numberingroup('sysop'));
     $data['jobs'] = intval(SiteStats::jobs());
     return $this->getResult()->addValue('query', $property, $data);
 }
开发者ID:laiello,项目名称:media-wiki-law,代码行数:17,代码来源:ApiQuerySiteinfo.php

示例8: numberofactiveusers

 public static function numberofactiveusers($parser, $raw = null)
 {
     return self::formatRaw(SiteStats::activeUsers(), $raw);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:4,代码来源:CoreParserFunctions.php

示例9: getVariableValue


//.........这里部分代码省略.........
             break;
         case 'currenttime':
             $value = $pageLang->time(wfTimestamp(TS_MW, $ts), false, false);
             break;
         case 'currenthour':
             $value = $pageLang->formatNum(MWTimestamp::getInstance($ts)->format('H'), true);
             break;
         case 'currentweek':
             # @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
             # int to remove the padding
             $value = $pageLang->formatNum((int) MWTimestamp::getInstance($ts)->format('W'));
             break;
         case 'currentdow':
             $value = $pageLang->formatNum(MWTimestamp::getInstance($ts)->format('w'));
             break;
         case 'localdayname':
             $value = $pageLang->getWeekdayName((int) MWTimestamp::getLocalInstance($ts)->format('w') + 1);
             break;
         case 'localyear':
             $value = $pageLang->formatNum(MWTimestamp::getLocalInstance($ts)->format('Y'), true);
             break;
         case 'localtime':
             $value = $pageLang->time(MWTimestamp::getLocalInstance($ts)->format('YmdHis'), false, false);
             break;
         case 'localhour':
             $value = $pageLang->formatNum(MWTimestamp::getLocalInstance($ts)->format('H'), true);
             break;
         case 'localweek':
             # @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
             # int to remove the padding
             $value = $pageLang->formatNum((int) MWTimestamp::getLocalInstance($ts)->format('W'));
             break;
         case 'localdow':
             $value = $pageLang->formatNum(MWTimestamp::getLocalInstance($ts)->format('w'));
             break;
         case 'numberofarticles':
             $value = $pageLang->formatNum(SiteStats::articles());
             break;
         case 'numberoffiles':
             $value = $pageLang->formatNum(SiteStats::images());
             break;
         case 'numberofusers':
             $value = $pageLang->formatNum(SiteStats::users());
             break;
         case 'numberofactiveusers':
             $value = $pageLang->formatNum(SiteStats::activeUsers());
             break;
         case 'numberofpages':
             $value = $pageLang->formatNum(SiteStats::pages());
             break;
         case 'numberofadmins':
             $value = $pageLang->formatNum(SiteStats::numberingroup('sysop'));
             break;
         case 'numberofedits':
             $value = $pageLang->formatNum(SiteStats::edits());
             break;
         case 'numberofviews':
             global $wgDisableCounters;
             $value = !$wgDisableCounters ? $pageLang->formatNum(SiteStats::views()) : '';
             break;
         case 'currenttimestamp':
             $value = wfTimestamp(TS_MW, $ts);
             break;
         case 'localtimestamp':
             $value = MWTimestamp::getLocalInstance($ts)->format('YmdHis');
             break;
         case 'currentversion':
             $value = SpecialVersion::getVersion();
             break;
         case 'articlepath':
             return $wgArticlePath;
         case 'sitename':
             return $wgSitename;
         case 'server':
             return $wgServer;
         case 'servername':
             $serverParts = wfParseUrl($wgServer);
             return $serverParts && isset($serverParts['host']) ? $serverParts['host'] : $wgServer;
         case 'scriptpath':
             return $wgScriptPath;
         case 'stylepath':
             return $wgStylePath;
         case 'directionmark':
             return $pageLang->getDirMark();
         case 'contentlanguage':
             global $wgLanguageCode;
             return $wgLanguageCode;
         case 'cascadingsources':
             $value = CoreParserFunctions::cascadingsources($this);
             break;
         default:
             $ret = null;
             wfRunHooks('ParserGetVariableValueSwitch', array(&$this, &$this->mVarCache, &$index, &$ret, &$frame));
             return $ret;
     }
     if ($index) {
         $this->mVarCache[$index] = $value;
     }
     return $value;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:101,代码来源:Parser.php

示例10: appendStatistics

 protected function appendStatistics($property)
 {
     global $wgDisableCounters;
     $data = array();
     $data['pages'] = intval(SiteStats::pages());
     $data['articles'] = intval(SiteStats::articles());
     if (!$wgDisableCounters) {
         $data['views'] = intval(SiteStats::views());
     }
     $data['edits'] = intval(SiteStats::edits());
     $data['images'] = intval(SiteStats::images());
     $data['users'] = intval(SiteStats::users());
     $data['activeusers'] = intval(SiteStats::activeUsers());
     $data['admins'] = intval(SiteStats::numberingroup('sysop'));
     $data['jobs'] = intval(SiteStats::jobs());
     // Wikia change begin
     // @author macbre
     wfRunHooks('APIQuerySiteInfoStatistics', array($this, &$data));
     // Wikia change end
     return $this->getResult()->addValue('query', $property, $data);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:21,代码来源:ApiQuerySiteinfo.php

示例11: getVariableValue


//.........这里部分代码省略.........
             // *after* a revision ID has been assigned. This is for null edits.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONYEAR}} used, setting vary-revision...\n");
             return substr($this->getRevisionTimestamp(), 0, 4);
         case 'revisiontimestamp':
             // Let the edit saving system know we should parse the page
             // *after* a revision ID has been assigned. This is for null edits.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONTIMESTAMP}} used, setting vary-revision...\n");
             return $this->getRevisionTimestamp();
         case 'revisionuser':
             // Let the edit saving system know we should parse the page
             // *after* a revision ID has been assigned. This is for null edits.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONUSER}} used, setting vary-revision...\n");
             return $this->getRevisionUser();
         case 'namespace':
             return str_replace('_', ' ', $wgContLang->getNsText($this->mTitle->getNamespace()));
         case 'namespacee':
             return wfUrlencode($wgContLang->getNsText($this->mTitle->getNamespace()));
         case 'talkspace':
             return $this->mTitle->canTalk() ? str_replace('_', ' ', $this->mTitle->getTalkNsText()) : '';
         case 'talkspacee':
             return $this->mTitle->canTalk() ? wfUrlencode($this->mTitle->getTalkNsText()) : '';
         case 'subjectspace':
             return $this->mTitle->getSubjectNsText();
         case 'subjectspacee':
             return wfUrlencode($this->mTitle->getSubjectNsText());
         case 'currentdayname':
             return $this->mVarCache[$index] = $wgContLang->getWeekdayName(gmdate('w', $ts) + 1);
         case 'currentyear':
             return $this->mVarCache[$index] = $wgContLang->formatNum(gmdate('Y', $ts), true);
         case 'currenttime':
             return $this->mVarCache[$index] = $wgContLang->time(wfTimestamp(TS_MW, $ts), false, false);
         case 'currenthour':
             return $this->mVarCache[$index] = $wgContLang->formatNum(gmdate('H', $ts), true);
         case 'currentweek':
             // @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
             // int to remove the padding
             return $this->mVarCache[$index] = $wgContLang->formatNum((int) gmdate('W', $ts));
         case 'currentdow':
             return $this->mVarCache[$index] = $wgContLang->formatNum(gmdate('w', $ts));
         case 'localdayname':
             return $this->mVarCache[$index] = $wgContLang->getWeekdayName($localDayOfWeek + 1);
         case 'localyear':
             return $this->mVarCache[$index] = $wgContLang->formatNum($localYear, true);
         case 'localtime':
             return $this->mVarCache[$index] = $wgContLang->time($localTimestamp, false, false);
         case 'localhour':
             return $this->mVarCache[$index] = $wgContLang->formatNum($localHour, true);
         case 'localweek':
             // @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
             // int to remove the padding
             return $this->mVarCache[$index] = $wgContLang->formatNum((int) $localWeek);
         case 'localdow':
             return $this->mVarCache[$index] = $wgContLang->formatNum($localDayOfWeek);
         case 'numberofarticles':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::articles());
         case 'numberoffiles':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::images());
         case 'numberofusers':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::users());
         case 'numberofactiveusers':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::activeUsers());
         case 'numberofpages':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::pages());
         case 'numberofadmins':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::numberingroup('sysop'));
         case 'numberofedits':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::edits());
         case 'numberofviews':
             return $this->mVarCache[$index] = $wgContLang->formatNum(SiteStats::views());
         case 'currenttimestamp':
             return $this->mVarCache[$index] = wfTimestamp(TS_MW, $ts);
         case 'localtimestamp':
             return $this->mVarCache[$index] = $localTimestamp;
         case 'currentversion':
             return $this->mVarCache[$index] = SpecialVersion::getVersion();
         case 'sitename':
             return $wgSitename;
         case 'server':
             return $wgServer;
         case 'servername':
             return $wgServerName;
         case 'scriptpath':
             return $wgScriptPath;
         case 'directionmark':
             return $wgContLang->getDirMark();
         case 'contentlanguage':
             global $wgContLanguageCode;
             return $wgContLanguageCode;
         default:
             $ret = null;
             if (wfRunHooks('ParserGetVariableValueSwitch', array(&$this, &$this->mVarCache, &$index, &$ret))) {
                 return $ret;
             } else {
                 return null;
             }
     }
 }
开发者ID:josephdye,项目名称:wikireader,代码行数:101,代码来源:Parser.php

示例12: getVariableValue


//.........这里部分代码省略.........
             $value = $pageLang->formatNum(gmdate('Y', $ts), true);
             break;
         case 'currenttime':
             $value = $pageLang->time(wfTimestamp(TS_MW, $ts), false, false);
             break;
         case 'currenthour':
             $value = $pageLang->formatNum(gmdate('H', $ts), true);
             break;
         case 'currentweek':
             # @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
             # int to remove the padding
             $value = $pageLang->formatNum((int) gmdate('W', $ts));
             break;
         case 'currentdow':
             $value = $pageLang->formatNum(gmdate('w', $ts));
             break;
         case 'localdayname':
             $value = $pageLang->getWeekdayName($localDayOfWeek + 1);
             break;
         case 'localyear':
             $value = $pageLang->formatNum($localYear, true);
             break;
         case 'localtime':
             $value = $pageLang->time($localTimestamp, false, false);
             break;
         case 'localhour':
             $value = $pageLang->formatNum($localHour, true);
             break;
         case 'localweek':
             # @bug 4594 PHP5 has it zero padded, PHP4 does not, cast to
             # int to remove the padding
             $value = $pageLang->formatNum((int) $localWeek);
             break;
         case 'localdow':
             $value = $pageLang->formatNum($localDayOfWeek);
             break;
         case 'numberofarticles':
             $value = $pageLang->formatNum(SiteStats::articles());
             break;
         case 'numberoffiles':
             $value = $pageLang->formatNum(SiteStats::images());
             break;
         case 'numberofusers':
             $value = $pageLang->formatNum(SiteStats::users());
             break;
         case 'numberofactiveusers':
             $value = $pageLang->formatNum(SiteStats::activeUsers());
             break;
         case 'numberofpages':
             $value = $pageLang->formatNum(SiteStats::pages());
             break;
         case 'numberofadmins':
             $value = $pageLang->formatNum(SiteStats::numberingroup('sysop'));
             break;
         case 'numberofedits':
             $value = $pageLang->formatNum(SiteStats::edits());
             break;
         case 'numberofviews':
             $value = $pageLang->formatNum(SiteStats::views());
             break;
         case 'currenttimestamp':
             $value = wfTimestamp(TS_MW, $ts);
             break;
         case 'localtimestamp':
             $value = $localTimestamp;
             break;
         case 'currentversion':
             $value = SpecialVersion::getVersion();
             break;
         case 'articlepath':
             return $wgArticlePath;
         case 'sitename':
             return $wgSitename;
         case 'server':
             return $wgServer;
         case 'servername':
             $serverParts = wfParseUrl($wgServer);
             return $serverParts && isset($serverParts['host']) ? $serverParts['host'] : $wgServer;
         case 'scriptpath':
             return $wgScriptPath;
         case 'stylepath':
             return $wgStylePath;
         case 'directionmark':
             return $pageLang->getDirMark();
         case 'contentlanguage':
             global $wgLanguageCode;
             return $wgLanguageCode;
         default:
             $ret = null;
             if (wfRunHooks('ParserGetVariableValueSwitch', array(&$this, &$this->mVarCache, &$index, &$ret, &$frame))) {
                 return $ret;
             } else {
                 return null;
             }
     }
     if ($index) {
         $this->mVarCache[$index] = $value;
     }
     return $value;
 }
开发者ID:laiello,项目名称:media-wiki-law,代码行数:101,代码来源:Parser.php

示例13: appendStatistics

 protected function appendStatistics($property)
 {
     $data = array();
     $data['pages'] = intval(SiteStats::pages());
     $data['articles'] = intval(SiteStats::articles());
     if (!$this->getConfig()->get('DisableCounters')) {
         $data['views'] = intval(SiteStats::views());
     }
     $data['edits'] = intval(SiteStats::edits());
     $data['images'] = intval(SiteStats::images());
     $data['users'] = intval(SiteStats::users());
     $data['activeusers'] = intval(SiteStats::activeUsers());
     $data['admins'] = intval(SiteStats::numberingroup('sysop'));
     $data['jobs'] = intval(SiteStats::jobs());
     wfRunHooks('APIQuerySiteInfoStatisticsInfo', array(&$data));
     return $this->getResult()->addValue('query', $property, $data);
 }
开发者ID:Habatchii,项目名称:wikibase-for-mediawiki,代码行数:17,代码来源:ApiQuerySiteinfo.php

示例14: appendStatistics

 protected function appendStatistics($property)
 {
     $data = [];
     $data['pages'] = intval(SiteStats::pages());
     $data['articles'] = intval(SiteStats::articles());
     $data['edits'] = intval(SiteStats::edits());
     $data['images'] = intval(SiteStats::images());
     $data['users'] = intval(SiteStats::users());
     $data['activeusers'] = intval(SiteStats::activeUsers());
     $data['admins'] = intval(SiteStats::numberingroup('sysop'));
     $data['jobs'] = intval(SiteStats::jobs());
     Hooks::run('APIQuerySiteInfoStatisticsInfo', [&$data]);
     return $this->getResult()->addValue('query', $property, $data);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:14,代码来源:ApiQuerySiteinfo.php

示例15: loadSiteStats

 public function loadSiteStats()
 {
     global $wgDisableCounters;
     self::$siteStatsLoaded = true;
     return array(array('pages' => (int) SiteStats::pages(), 'articles' => (int) SiteStats::articles(), 'files' => (int) SiteStats::images(), 'edits' => (int) SiteStats::edits(), 'views' => $wgDisableCounters ? null : (int) SiteStats::views(), 'users' => (int) SiteStats::users(), 'activeUsers' => (int) SiteStats::activeUsers()));
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:6,代码来源:SiteLibrary.php


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