示例#1
0
 /**
  * Show the special page
  *
  * @param $par Mixed: parameter passed to the page or null
  */
 public function execute($par)
 {
     global $wgOut, $wgLang, $wgRCMaxAge;
     $this->setHeaders();
     $up = new ActiveUsersPager();
     # getBody() first to check, if empty
     $usersbody = $up->getBody();
     $s = Html::rawElement('div', array('class' => 'mw-activeusers-intro'), wfMsgExt('activeusers-intro', array('parsemag', 'escape'), $wgLang->formatNum(ceil($wgRCMaxAge / 86400))));
     $s .= $up->getPageHeader();
     if ($usersbody) {
         $s .= $up->getNavigationBar();
         $s .= Html::rawElement('ul', array(), $usersbody);
         $s .= $up->getNavigationBar();
     } else {
         $s .= Html::element('p', array(), wfMsg('activeusers-noresult'));
     }
     $wgOut->addHTML($s);
 }
示例#2
0
 /**
  * Show the special page
  *
  * @param string $par Parameter passed to the page or null
  */
 public function execute($par)
 {
     $days = $this->getConfig()->get('ActiveUserDays');
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->wrapWikiMsg("<div class='mw-activeusers-intro'>\n\$1\n</div>", array('activeusers-intro', $this->getLanguage()->formatNum($days)));
     // Mention the level of cache staleness...
     $dbr = wfGetDB(DB_SLAVE, 'recentchanges');
     $rcMax = $dbr->selectField('recentchanges', 'MAX(rc_timestamp)', '', __METHOD__);
     if ($rcMax) {
         $cTime = $dbr->selectField('querycache_info', 'qci_timestamp', array('qci_type' => 'activeusers'), __METHOD__);
         if ($cTime) {
             $secondsOld = wfTimestamp(TS_UNIX, $rcMax) - wfTimestamp(TS_UNIX, $cTime);
         } else {
             $rcMin = $dbr->selectField('recentchanges', 'MIN(rc_timestamp)');
             $secondsOld = time() - wfTimestamp(TS_UNIX, $rcMin);
         }
         if ($secondsOld > 0) {
             $out->addWikiMsg('cachedspecial-viewing-cached-ttl', $this->getLanguage()->formatDuration($secondsOld));
         }
     }
     $up = new ActiveUsersPager($this->getContext(), null, $par);
     # getBody() first to check, if empty
     $usersbody = $up->getBody();
     $out->addHTML($up->getPageHeader());
     if ($usersbody) {
         $out->addHTML($up->getNavigationBar() . Html::rawElement('ul', array(), $usersbody) . $up->getNavigationBar());
     } else {
         $out->addWikiMsg('activeusers-noresult');
     }
 }
 /**
  * Show the special page
  *
  * @param $par Mixed: parameter passed to the page or null
  */
 public function execute($par)
 {
     global $wgActiveUserDays;
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->wrapWikiMsg("<div class='mw-activeusers-intro'>\n\$1\n</div>", array('activeusers-intro', $this->getLanguage()->formatNum($wgActiveUserDays)));
     $up = new ActiveUsersPager($this->getContext(), null, $par);
     # getBody() first to check, if empty
     $usersbody = $up->getBody();
     $out->addHTML($up->getPageHeader());
     if ($usersbody) {
         $out->addHTML($up->getNavigationBar() . Html::rawElement('ul', array(), $usersbody) . $up->getNavigationBar());
     } else {
         $out->addWikiMsg('activeusers-noresult');
     }
 }
 /**
  * Show the special page
  *
  * @param string $par Parameter passed to the page or null
  */
 public function execute($par)
 {
     $days = $this->getConfig()->get('ActiveUserDays');
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->wrapWikiMsg("<div class='mw-activeusers-intro'>\n\$1\n</div>", array('activeusers-intro', $this->getLanguage()->formatNum($days)));
     // Occasionally merge in new updates
     $seconds = min(self::mergeActiveUsers(600, $days), $days * 86400);
     // Mention the level of staleness
     $out->addWikiMsg('cachedspecial-viewing-cached-ttl', $this->getLanguage()->formatDuration($seconds));
     $up = new ActiveUsersPager($this->getContext(), null, $par);
     # getBody() first to check, if empty
     $usersbody = $up->getBody();
     $out->addHTML($up->getPageHeader());
     if ($usersbody) {
         $out->addHTML($up->getNavigationBar() . Html::rawElement('ul', array(), $usersbody) . $up->getNavigationBar());
     } else {
         $out->addWikiMsg('activeusers-noresult');
     }
 }