/** * Creates a bar * @param $article Article * @param $outputDone bool * @param $pcache string * @return bool */ public static function renderBar(&$article, &$outputDone, &$pcache) { global $wgOnlineStatusBarCacheTime; // Update status of all users who wants to be tracked OnlineStatusBar_StatusCheck::updateStatus(); // Performace fix $title = $article->getTitle(); if ($title->getNamespace() != NS_USER && $title->getNamespace() != NS_USER_TALK) { return true; } // Retrieve status of user parsed from title $result = OnlineStatusBar::getUserInfoFromTitle($title); // In case that status can't be parsed we check if it isn't anon if ($result === false && User::isIP($title->getBaseText())) { $result = OnlineStatusBar::getAnonFromTitle($title); } // In case we were unable to get a status let's quit if ($result === false) { return true; } // Don't display status of those who don't want to show bar but only use magic if ($result->getOption('OnlineStatusBar_hide', false) == true) { return true; } $context = $article->getContext(); $context->getOutput()->addHtml(OnlineStatusBar::getStatusBarHtml()); return true; }