function Ach_GetHTMLAfterBody($skin, &$html) { wfProfileIn(__METHOD__); global $wgOut, $wgTitle, $wgUser; if ($wgUser->isLoggedIn() && !$wgUser->getOption('hidepersonalachievements')) { if ($wgTitle->getNamespace() == NS_SPECIAL && array_shift(SpecialPageFactory::resolveAlias($wgTitle->getDBkey())) == 'MyHome') { $awardingService = new AchAwardingService(); $awardingService->awardCustomNotInTrackBadge($wgUser, BADGE_WELCOME); } if ((!empty($_SESSION['achievementsNewBadges']) || 5 == rand(1, 20)) && get_class(RequestContext::getMain()->getSkin()) != 'SkinMonobook') { // this works only for Wikia and only in current varnish configuration if (!headers_sent()) { header('X-Pass-Cache-Control: no-store, private, no-cache, must-revalidate'); } $notificationService = new AchNotificationService(); $wgOut->addHTML($notificationService->getNotifcationHTML($wgUser)); if (isset($_SESSION['achievementsNewBadges'])) { unset($_SESSION['achievementsNewBadges']); } } } wfProfileOut(__METHOD__); return true; }