/** * Gets a random casual game if RandomGameUnit extension is installed. * @return HTML or nothing */ function getRandomCasualGame() { if (function_exists('wfGetRandomGameUnit')) { return wfGetRandomGameUnit(); } else { return ''; } }
/** * Template filter callback for Nimbus skin. * Takes an associative array of data set from a SkinTemplate-based * class, and a wrapper for MediaWiki's localization database, and * outputs a formatted page. */ public function execute() { global $wgContLang, $wgLogo, $wgOut, $wgStylePath, $wgTitle, $wgUser; global $wgLangToCentralMap, $wgSupressPageTitle, $wgSupressSubTitle, $wgSupressPageCategories; global $wgUserLevels; $this->skin = $this->data['skin']; // This trick copied over from Monaco.php to allow localized central wiki URLs $central_url = !empty($wgLangToCentralMap[$wgContLang->getCode()]) ? $wgLangToCentralMap[$wgContLang->getCode()] : 'http://www.shoutwiki.com/'; $register_link = SpecialPage::getTitleFor('Userlogin', 'signup'); $login_link = SpecialPage::getTitleFor('Userlogin'); $logout_link = SpecialPage::getTitleFor('Userlogout'); $profile_link = Title::makeTitle(NS_USER, $wgUser->getName()); $main_page_link = Title::newMainPage(); $recent_changes_link = SpecialPage::getTitleFor('Recentchanges'); $top_fans_link = SpecialPage::getTitleFor('TopUsers'); $special_pages_link = SpecialPage::getTitleFor('Specialpages'); $help_link = Title::newFromText(wfMsgForContent('helppage')); $upload_file = SpecialPage::getTitleFor('Upload'); $what_links_here = SpecialPage::getTitleFor('Whatlinkshere'); $preferences_link = SpecialPage::getTitleFor('Preferences'); $watchlist_link = SpecialPage::getTitleFor('Watchlist'); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); $this->html('headelement'); ?> <div id="container"> <div id="header"> <div id="sw-logo"> <a href="<?php echo $central_url; ?> "> <img src="<?php echo $wgStylePath; ?> /Nimbus/nimbus/sw_logo.png" alt="" /> </a> <span id="sw-category">ShoutWiki</span> </div> <div id="sw-more-category"> <div class="positive-button"><span><?php echo wfMsg('nimbus-more-wikis'); ?> </span></div> </div> <div id="more-wikis-menu" style="display:none;"> <?php $more_wikis = $this->buildMoreWikis(); $x = 1; foreach ($more_wikis as $link) { $ourClass = ''; if ($x == count($more_wikis)) { $ourClass = ' class="border-fix"'; } echo "<a href=\"{$link['href']}\"" . $ourClass . ">{$link['text']}</a>\n"; if ($x > 1 && $x % 2 == 0) { echo '<div class="cleared"></div>' . "\n"; } $x++; } ?> </div><!-- #more-wikis-menu --> <div id="wiki-login"> <?php if ($wgUser->isLoggedIn()) { echo '<div id="login-message">' . wfMsg('nimbus-welcome', '<b>' . $wgUser->getName() . '</b>') . '</div> <a class="positive-button" href="' . $profile_link->escapeFullURL() . '" rel="nofollow"><span>' . wfMsg('nimbus-profile') . '</span></a> <a class="negative-button" href="' . $logout_link->escapeFullURL() . '"><span>' . wfMsg('nimbus-logout') . '</span></a>'; } else { echo '<a class="positive-button" href="' . $register_link->escapeFullURL() . '" rel="nofollow"><span>' . wfMsg('nimbus-signup') . '</span></a> <a class="positive-button" href="' . $login_link->escapeFullURL() . '" id="nimbusLoginButton"><span>' . wfMsg('nimbus-login') . '</span></a>'; } ?> </div><!-- #wiki-login --> </div><!-- #header --> <div id="site-header"> <div id="site-logo"> <a href="<?php echo $main_page_link->escapeFullURL(); ?> " rel="nofollow"> <img src="<?php echo $wgLogo; ?> " alt="" /> </a> </div> </div> <div id="side-bar"> <div id="navigation"> <div id="navigation-title"><?php echo wfMsg('navigation'); ?> </div> <script type="text/javascript"> var submenu_array = new Array(); var menuitem_array = new Array(); var submenuitem_array = new Array(); </script> <?php $this->navmenu_array = array(); $this->navmenu = $this->getNavigationMenu(); echo $this->printMenu(0); ?> <div id="other-links-container"> <div id="other-links"> <?php // Only show the link to Special:TopUsers if wAvatar class exists and $wgUserLevels is an array if (class_exists('wAvatar') && is_array($wgUserLevels)) { echo '<a href="' . $top_fans_link->escapeFullURL() . '">' . wfMsg('topusers') . '</a>'; } ?> <a href="<?php echo $recent_changes_link->escapeFullURL(); ?> "><?php echo wfMsg('recentchanges'); ?> </a> <div class="cleared"></div> <?php if ($wgUser->isLoggedIn()) { ?> <a href="<?php echo $watchlist_link->escapeFullURL(); ?> "><?php echo wfMsg('watchlist'); ?> </a> <a href="<?php echo $preferences_link->escapeFullURL(); ?> "><?php echo wfMsg('preferences'); ?> </a> <div class="cleared"></div> <?php } ?> <a href="<?php echo $help_link->escapeFullURL(); ?> "><?php echo wfMsg('help'); ?> </a> <a href="<?php echo $special_pages_link->escapeFullURL(); ?> "><?php echo wfMsg('specialpages'); ?> </a> <div class="cleared"></div> </div> </div> </div> <div id="search-box"> <div id="search-title"><?php echo wfMsg('search'); ?> </div> <form method="get" action="<?php echo $this->text('wgScript'); ?> " name="search_form" id="searchform"> <input id="searchInput" type="text" class="search-field" name="search" value="<?php echo wfMsg('nimbus-search'); ?> " onclick="this.value=''" /> <input type="image" src="<?php echo $wgStylePath; ?> /Nimbus/nimbus/search_button.gif" class="search-button" alt="search" /> </form> <div class="cleared"></div> <div class="bottom-left-nav"> <?php if (function_exists('wfRandomCasualGame')) { echo wfGetRandomGameUnit(); } ?> <div class="bottom-left-nav-container"> <h2><?php echo wfMsg('nimbus-didyouknow'); ?> </h2> <?php echo $wgOut->parse('{{Didyouknow}}'); ?> </div> <?php if (function_exists('wfRandomImageByCategory')) { $randomImage = $wgOut->parse('<randomimagebycategory width="200" categories="Featured Image" />', false); echo '<div class="bottom-left-nav-container"> <h2>' . wfMsg('nimbus-featuredimage') . '</h2>' . $randomImage . '</div>'; } if (function_exists('wfRandomFeaturedUser')) { $randomUser = $wgOut->parse('<randomfeatureduser period="weekly" />', false); echo '<div class="bottom-left-nav-container"> <h2>' . wfMsg('nimbus-featureduser') . '</h2>' . $randomUser . '</div>'; } ?> </div> </div> </div> <div id="body-container"> <?php echo $this->actionBar(); ?> <div id="article"> <div id="mw-js-message" style="display:none;"></div> <div id="article-body"> <?php if ($this->data['sitenotice']) { ?> <div id="siteNotice"><?php $this->html('sitenotice'); ?> </div><?php } ?> <div id="article-text" class="clearfix"> <?php if (!$wgSupressPageTitle) { ?> <h1 class="pagetitle"><?php $this->html('title'); ?> </h1><?php } ?> <?php if (!$wgSupressSubTitle) { ?> <p class='subtitle'><?php $this->msg('tagline'); ?> </p><?php } ?> <?php if ($this->data['undelete']) { ?> <div id="contentSub2"><?php $this->html('undelete'); ?> </div><?php } ?> <?php if ($this->data['newtalk']) { ?> <div class="usermessage"><?php $this->html('newtalk'); ?> </div><?php } ?> <!-- start content --> <?php $this->html('bodytext'); ?> <?php if ($this->data['printfooter']) { ?> <div class="printfooter"><?php $this->html('printfooter'); ?> </div><?php } ?> <?php $this->html('debughtml'); ?> <?php if ($this->data['catlinks'] && !$wgSupressPageCategories) { $this->html('catlinks'); } ?> <!-- end content --> <?php if ($this->data['dataAfterContent']) { $this->html('dataAfterContent'); } ?> </div> </div> </div> </div> <?php echo $this->footer(); ?> </div><!-- #container --> <?php $this->printTrail(); echo Html::closeElement('body'); echo Html::closeElement('html'); wfRestoreWarnings(); }
/** * Get a random casual game, if this feature is enabled in BlogPage config * and the RandomGameUnit extension is installed. * * @return String: HTML or nothing */ function getRandomCasualGame() { global $wgBlogPageDisplay; if ($wgBlogPageDisplay['games'] == false || !function_exists('wfGetRandomGameUnit')) { return ''; } return wfGetRandomGameUnit(); }
/** * Gets a random casual game if RandomGameUnit extension is installed and * this feature is enabled in $wgLinkPageDisplay. * * @return HTML or nothing */ function getRandomCasualGame() { global $wgLinkPageDisplay; if (!$wgLinkPageDisplay['games']) { return ''; } if (function_exists('wfGetRandomGameUnit')) { return wfGetRandomGameUnit(); } else { return ''; } }