public function searchIndex()
 {
     global $wgRequest, $wgSitename, $wgUser;
     $lang = $this->helper->getLangForSearchResults();
     $centralUrl = $this->helper->getCentralUrlFromGlobalTitle($lang);
     $globalSearchUrl = $this->helper->getGlobalSearchUrl($centralUrl);
     $localSearchUrl = SpecialPage::getTitleFor('Search')->getFullUrl();
     $fulltext = $wgUser->getGlobalPreference('enableGoSearch') ? 0 : 'Search';
     $query = $wgRequest->getVal('search', $wgRequest->getVal('query', ''));
     $localSearchPlaceholder = html_entity_decode(wfMessage('global-navigation-local-search-placeholder', $wgSitename)->parse());
     if (WikiaPageType::isCorporatePage() && !WikiaPageType::isWikiaHub()) {
         $this->response->setVal('disableLocalSearchOptions', true);
         $this->response->setVal('defaultSearchPlaceholder', wfMessage('global-navigation-global-search')->escaped());
         $this->response->setVal('defaultSearchUrl', $globalSearchUrl);
     } else {
         $this->response->setVal('globalSearchUrl', $globalSearchUrl);
         $this->response->setVal('localSearchUrl', $localSearchUrl);
         $this->response->setVal('localSearchPlaceholder', $localSearchPlaceholder);
         $this->response->setVal('defaultSearchPlaceholder', $localSearchPlaceholder);
         $this->response->setVal('defaultSearchUrl', $localSearchUrl);
     }
     $this->response->setVal('fulltext', $fulltext);
     $this->response->setVal('query', $query);
     $this->response->setVal('lang', $lang);
 }
Пример #2
0
 public function executeIndex()
 {
     $this->setVal('specialSearchUrl', SpecialPage::getTitleFor('Search')->getFullUrl());
     $this->searchterm = $this->wg->request->getVal('search');
     if (!isset($this->searchterm)) {
         $this->searchterm = $this->request->getVal('search');
     }
     $this->noautocomplete = $this->wg->request->getVal('noautocomplete');
     if (!isset($this->noautocomplete)) {
         $this->noautocomplete = $this->request->getVal('noautocomplete');
     }
     $searchParams = [];
     if (!$this->request->getVal('nonamespaces', false)) {
         $namespaces = $this->getNamespaceFromRequest();
         foreach ($namespaces as $namespaceInt) {
             $searchParams['ns' . $namespaceInt] = 1;
         }
     }
     if ($this->wg->CityId == Wikia\Search\QueryService\Select\Dismax\Video::VIDEO_WIKI_ID) {
         $searchParams['filters[]'] = 'is_video';
         // this is required to hide images
         $searchParams['rank'] = 'default';
         // this is required to keep urls consistent between search and non-search pages
     }
     $this->searchParams = $searchParams;
     $this->fulltext = $this->wg->User->getGlobalPreference('enableGoSearch') ? 0 : 'Search';
     $this->placeholder = WikiaPageType::isWikiaHub() ? wfMessage('wikiahubs-search-placeholder')->text() : wfMessage('Tooltip-search', $this->wg->Sitename)->text();
     $this->isCrossWikiaSearch = $this->wg->request->getCheck('crossWikiaSearch');
     $this->searchFormId = $this->request->getVal('searchFormId');
 }
Пример #3
0
 public static function onWikiaMobileAssetsPackages(array &$jsHeadPackages, array &$jsBodyPackages, array &$scssPackages)
 {
     //this hook is fired only by the WikiaMobile skin, no need to check for what skin is being used
     if (F::app()->wg->EnableWikiaHubsExt && WikiaPageType::isWikiaHub()) {
         $scssPackages[] = 'wikiahubs_scss_wikiamobile';
     }
     return true;
 }
 /**
  * Check if for current page the ads can be displayed or not
  * We only want ads on regular article pages plug a few
  * special pages. The logic lays here.
  *
  * @return bool
  */
 public static function areAdsShowableOnPage()
 {
     $wg = F::app()->wg;
     $runAds = $wg->Out->isArticle() || WikiaPageType::isSearch() || WikiaPageType::isForum() || WikiaPageType::isWikiaHub();
     // Can be re-enabled after AdDriver2.js is implemented:
     // || $wg->Title->isSpecial('Leaderboard');
     return $runAds;
 }
 /**
  * Get page type for the current page (ad-wise).
  * Take into account type of the page and user status.
  * Return one of the PAGE_TYPE_* constants
  *
  * @return string
  */
 public function getPageType()
 {
     $title = null;
     if (WikiaPageType::isActionPage() || $this->wg->Request->getBool('noexternals', $this->wg->NoExternals) || $this->wg->Request->getBool('noads', false) || $this->wg->ShowAds === false || $this->wg->EnableAdEngineExt === false || !$this->app->checkSkin(['oasis', 'wikiamobile', 'venus'])) {
         $pageLevel = self::PAGE_TYPE_NO_ADS;
         return $pageLevel;
     }
     $runAds = WikiaPageType::isFilePage() || WikiaPageType::isForum() || WikiaPageType::isSearch() || WikiaPageType::isWikiaHub();
     if (!$runAds) {
         if ($this->wg->Title) {
             $title = $this->wg->Title;
             $namespace = $title->getNamespace();
             $runAds = in_array($namespace, $this->wg->ContentNamespaces) || isset($this->wg->ExtraNamespaces[$namespace]) || BodyController::isBlogListing() || BodyController::isBlogPost() || defined('NS_WIKIA_PLAYQUIZ') && $title->inNamespace(NS_WIKIA_PLAYQUIZ) || defined('NS_CATEGORY') && $namespace == NS_CATEGORY || defined('NS_PROJECT') && $namespace == NS_PROJECT || $title->isSpecial('Leaderboard') || $title->isSpecial('Maps') || $title->isSpecial('Newimages') || $title->isSpecial('Videos');
         }
     }
     if (!$runAds) {
         $pageLevel = self::PAGE_TYPE_NO_ADS;
         return $pageLevel;
     }
     $user = $this->wg->User;
     if (!$user->isLoggedIn() || $user->getGlobalPreference('showAds')) {
         // Only leaderboard, medrec and invisible on corporate sites for anonymous users
         if (WikiaPageType::isCorporatePage()) {
             $pageLevel = self::PAGE_TYPE_CORPORATE;
             return $pageLevel;
         }
         if (WikiaPageType::isSearch()) {
             $pageLevel = self::PAGE_TYPE_SEARCH;
             return $pageLevel;
         }
         if ($title && $title->isSpecial('Maps')) {
             $pageLevel = self::PAGE_TYPE_MAPS;
             return $pageLevel;
         }
         // All ads everywhere else
         $pageLevel = self::PAGE_TYPE_ALL_ADS;
         return $pageLevel;
     }
     // Logged in users get some ads on the main pages (except on the corporate sites)
     if (!WikiaPageType::isCorporatePage() && WikiaPageType::isMainPage()) {
         $pageLevel = self::PAGE_TYPE_HOMEPAGE_LOGGED;
         return $pageLevel;
     }
     // Override ad level for a (set of) specific page(s)
     // Use case: sponsor ads on a landing page targeted to Wikia editors (=logged in)
     if ($title && !empty($this->wg->PagesWithNoAdsForLoggedInUsersOverriden) && in_array($title->getDBkey(), $this->wg->PagesWithNoAdsForLoggedInUsersOverriden)) {
         $pageLevel = self::PAGE_TYPE_CORPORATE;
         return $pageLevel;
     }
     // And no other ads
     $pageLevel = self::PAGE_TYPE_NO_ADS;
     return $pageLevel;
 }
Пример #6
0
 public function executeTop()
 {
     if (WikiaPageType::isWikiaHub()) {
         $leaderboardName = 'HUB_TOP_LEADERBOARD';
     } elseif ($this->wg->EnableWikiaHomePageExt) {
         $leaderboardName = 'CORP_TOP_LEADERBOARD';
     } elseif (WikiaPageType::isMainPage()) {
         $leaderboardName = 'HOME_TOP_LEADERBOARD';
     } else {
         $leaderboardName = 'TOP_LEADERBOARD';
     }
     $this->leaderboardName = $leaderboardName;
 }
 /**
  * @desc Template for wrapper containing Weebo / Admin Toolbar
  */
 public function index()
 {
     if ($this->isWikiaBarSuppressed()) {
         $this->wgSuppressWikiaBar = true;
         OasisController::addBodyClass('nowikiabar');
     }
     $this->lang = F::app()->wg->contLang->getCode();
     if (WikiaPageType::isWikiaHub()) {
         $this->vertical = HubService::getCategoryInfoForCurrentPage()->cat_id;
     } else {
         $this->vertical = HubService::getCategoryInfoForCity(F::app()->wg->cityId)->cat_id;
     }
 }
Пример #8
0
 private function getTag()
 {
     $dbname = F::app()->wg->DBname;
     $t = F::app()->wg->Title;
     $title = $t->getText();
     if (WikiaPageType::isWikiaHub()) {
         return 'RC_WIKIA_START';
     }
     if ($dbname == 'dehauptseite') {
         if (Wikia::isMainPage()) {
             return 'RC_WIKIA_HOME';
         }
         if (strpos($title, 'Mobil') === 0) {
             return 'RC_WIKIA_MOBIL';
         }
         if (WikiaPageType::getPageType() == 'search') {
             return 'RC_WIKIA_SEARCH';
         }
         return 'RC_WIKIA_SVCE';
     }
     if ($dbname == 'de') {
         if ($t->getNamespace() == NS_FORUM) {
             return 'RC_WIKIA_PIN';
         }
         return 'RC_WIKIA_COMMUNITY';
     }
     if (strpos(F::app()->wg->DartCustomKeyValues, 'anime') !== false) {
         return 'RC_WIKIA_UGCANIME';
     }
     $cat_name = HubService::getCategoryInfoForCurrentPage()->cat_name;
     if ($cat_name == 'Entertainment') {
         return 'RC_WIKIA_UGCENT';
     }
     if ($cat_name == 'Gaming') {
         return 'RC_WIKIA_UGCGAMES';
     }
     if ($cat_name == 'Lifestyle') {
         return 'RC_WIKIA_UGCLIFESTYLE';
     }
     return 'RC_WIKIA_UGC';
 }
 public function getContext(Title $title, $skinName)
 {
     $wrapper = new GlobalStateWrapper(['wgTitle' => $title]);
     $wg = F::app()->wg;
     return $wrapper->wrap(function () use($title, $wg, $skinName) {
         $wikiFactoryHub = WikiFactoryHub::getInstance();
         $hubService = new HubService();
         $adPageTypeService = new AdEngine2PageTypeService();
         $wikiaPageType = new WikiaPageType();
         $sevenOneMediaCombinedUrl = null;
         if (!empty($wg->AdDriverUseSevenOneMedia)) {
             // TODO: implicitly gets the skin from the context!
             $sevenOneMediaCombinedUrl = ResourceLoader::makeCustomURL($wg->Out, ['wikia.ext.adengine.sevenonemedia'], 'scripts');
         }
         $monetizationServiceAds = null;
         if (!empty($wg->AdDriverUseMonetizationService) && !empty($wg->EnableMonetizationModuleExt)) {
             $monetizationServiceAds = F::app()->sendRequest('MonetizationModule', 'index')->getData()['data'];
         }
         $langCode = $title->getPageLanguage()->getCode();
         return ['opts' => $this->filterOutEmptyItems(['adsInContent' => $wg->EnableAdsInContent, 'delayBtf' => $wg->AdDriverDelayBelowTheFold, 'enableAdsInMaps' => $wg->AdDriverEnableAdsInMaps, 'pageType' => $adPageTypeService->getPageType(), 'paidAssetDropConfig' => $wg->PaidAssetDropConfig, 'showAds' => $adPageTypeService->areAdsShowableOnPage(), 'trackSlotState' => $wg->AdDriverTrackState, 'usePostScribe' => $wg->Request->getBool('usepostscribe', false)]), 'targeting' => $this->filterOutEmptyItems(['enablePageCategories' => array_search($langCode, $wg->AdPageLevelCategoryLangs) !== false, 'pageArticleId' => $title->getArticleId(), 'pageIsArticle' => !!$title->getArticleId(), 'pageIsHub' => $wikiaPageType->isWikiaHub(), 'pageName' => $title->getPrefixedDBKey(), 'pageType' => $wikiaPageType->getPageType(), 'sevenOneMediaSub2Site' => $wg->AdDriverSevenOneMediaOverrideSub2Site, 'skin' => $skinName, 'wikiCategory' => $wikiFactoryHub->getCategoryShort($wg->CityId), 'wikiCustomKeyValues' => $wg->DartCustomKeyValues, 'wikiDbName' => $wg->DBname, 'wikiDirectedAtChildren' => $wg->WikiDirectedAtChildrenByFounder || $wg->WikiDirectedAtChildrenByStaff, 'wikiIsCorporate' => $wikiaPageType->isCorporatePage(), 'wikiIsTop1000' => $wg->AdDriverWikiIsTop1000, 'wikiLanguage' => $langCode, 'wikiVertical' => $hubService->getCategoryInfoForCity($wg->CityId)->cat_name]), 'providers' => $this->filterOutEmptyItems(['monetizationService' => $wg->AdDriverUseMonetizationService, 'monetizationServiceAds' => $monetizationServiceAds, 'sevenOneMedia' => $wg->AdDriverUseSevenOneMedia, 'sevenOneMediaCombinedUrl' => $sevenOneMediaCombinedUrl, 'taboola' => $wg->AdDriverUseTaboola]), 'slots' => $this->filterOutEmptyItems(['exitstitial' => $wg->EnableOutboundScreenExt, 'exitstitialRedirectDelay' => $wg->OutboundScreenRedirectDelay, 'invisibleHighImpact' => $wg->AdDriverEnableInvisibleHighImpactSlot]), 'forcedProvider' => $wg->AdDriverForcedProvider];
     });
 }
Пример #10
0
 public static function isAdsEnabledOnWikiaHub()
 {
     global $wgHubsAdsEnabled, $wgTitle;
     if (WikiaPageType::isWikiaHub() && !empty($wgHubsAdsEnabled)) {
         if (in_array($wgTitle->getBaseText(), $wgHubsAdsEnabled)) {
             return true;
         }
     }
     return false;
 }
Пример #11
0
 public function executeIndex()
 {
     global $wgOut, $wgTitle, $wgEnableInfoBoxTest, $wgMaximizeArticleAreaArticleIds, $wgEnableAdminDashboardExt, $wgEnableWikiaHomePageExt;
     wfProfileIn(__METHOD__);
     // set up global vars
     if (is_array($wgMaximizeArticleAreaArticleIds) && in_array($wgTitle->getArticleId(), $wgMaximizeArticleAreaArticleIds)) {
         $this->wg->SuppressRail = true;
         $this->wg->SuppressPageHeader = true;
     }
     // Double-click to edit
     $this->body_ondblclick = '';
     // FIXME handling moved to OutputPage::addDefaultModules()
     // InfoBox - Testing
     $this->wg->EnableInfoBoxTest = $wgEnableInfoBoxTest;
     // Replaces ContentDisplayModule->index()
     $this->bodytext = $this->app->getSkinTemplateObj()->data['bodytext'];
     $this->railModuleList = $this->getRailModuleList();
     // this hook allows adding extra HTML just after <body> opening tag
     // append your content to $html variable instead of echoing
     // (taken from Monaco skin)
     $skin = RequestContext::getMain()->getSkin();
     $afterBodyHtml = '';
     wfRunHooks('GetHTMLAfterBody', array($skin, &$afterBodyHtml));
     $this->afterBodyHtml = $afterBodyHtml;
     // this hook is needed for SMW's factbox
     $afterContentHookText = '';
     wfRunHooks('SkinAfterContent', array(&$afterContentHookText));
     $this->afterContentHookText = $afterContentHookText;
     $this->headerModuleAction = 'Index';
     $this->headerModuleParams = array('showSearchBox' => false);
     // show user pages header on this page?
     if (self::showUserPagesHeader()) {
         $this->headerModuleName = 'UserPagesHeader';
         // is this page a blog post?
         if (self::isBlogPost()) {
             $this->headerModuleAction = 'BlogPost';
         } else {
             if (self::isBlogListing()) {
                 $this->headerModuleAction = 'BlogListing';
             }
         }
         // show corporate header on this page?
     } else {
         if (WikiaPageType::isCorporatePage() || WikiaPageType::isWikiaHub()) {
             $this->headerModuleName = 'PageHeader';
             if (self::isEditPage()) {
                 $this->headerModuleAction = 'EditPage';
             } else {
                 $this->headerModuleAction = 'Corporate';
             }
             if (WikiaPageType::isWikiaHubMain()) {
                 $this->headerModuleAction = 'Hubs';
             } elseif (WikiaPageType::isMainPage()) {
                 $this->wg->SuppressFooter = true;
                 $this->wg->SuppressArticleCategories = true;
                 $this->wg->SuppressPageHeader = true;
                 $this->wg->SuppressWikiHeader = true;
                 $this->wg->SuppressSlider = true;
             }
         } else {
             $this->headerModuleName = 'PageHeader';
             if (self::isEditPage()) {
                 $this->headerModuleAction = 'EditPage';
             }
         }
     }
     // Display Control Center Header on certain special pages
     if (!empty($wgEnableAdminDashboardExt) && AdminDashboardLogic::displayAdminDashboard($this->app, $wgTitle)) {
         $this->headerModuleName = null;
         $this->wgSuppressAds = true;
         $this->displayAdminDashboard = true;
         $this->displayAdminDashboardChromedArticle = $wgTitle->getText() != SpecialPage::getTitleFor('AdminDashboard')->getText();
     } else {
         $this->displayAdminDashboard = false;
         $this->displayAdminDashboardChromedArticle = false;
     }
     $this->railModulesExist = true;
     // use one column layout for pages with no right rail modules
     if (count($this->railModuleList) == 0 || !empty($this->wg->SuppressRail)) {
         // Special:AdminDashboard doesn't need this class, but pages chromed with it do
         if (!$this->displayAdminDashboard || $this->displayAdminDashboardChromedArticle) {
             OasisController::addBodyClass('oasis-one-column');
         }
         $this->headerModuleParams = array('showSearchBox' => true);
         $this->railModulesExist = false;
     }
     // determine if WikiaGridLayout needs to be enabled
     $this->isGridLayoutEnabled = self::isGridLayoutEnabled();
     if ($this->isGridLayoutEnabled) {
         OasisController::addBodyClass('wikia-grid');
     }
     if ($this->isOasisBreakpoints()) {
         OasisController::addBodyClass('oasis-breakpoints');
     }
     //@TODO remove this check after deprecating responsive (July 2015)
     if ($this->isResponsiveLayoutEnabled()) {
         OasisController::addBodyClass('oasis-responsive');
     }
     // if we are on a special search page, pull in the css file and don't render a header
     if ($wgTitle && $wgTitle->isSpecial('Search') && !$this->wg->WikiaSearchIsDefault) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/modules/SpecialSearch.scss"));
         $this->headerModuleName = null;
     }
     // Inter-wiki search
     if ($wgTitle && ($wgTitle->isSpecial('WikiaSearch') || $wgTitle->isSpecial('Search') && $this->wg->WikiaSearchIsDefault)) {
         $this->headerModuleName = null;
     }
     // load CSS for Special:Preferences
     if (!empty($wgTitle) && $wgTitle->isSpecial('Preferences')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialPreferences.scss'));
     }
     // load CSS for Special:Upload
     if (!empty($wgTitle) && $wgTitle->isSpecial('Upload')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialUpload.scss'));
     }
     // load CSS for Special:MultipleUpload
     if (!empty($wgTitle) && $wgTitle->isSpecial('MultipleUpload')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialMultipleUpload.scss'));
     }
     // load CSS for Special:Allpages
     if (!empty($wgTitle) && $wgTitle->isSpecial('Allpages')) {
         $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('skins/oasis/css/modules/SpecialAllpages.scss'));
     }
     // Forum Extension
     if (!empty($this->wg->EnableForumExt) && ForumHelper::isForum()) {
         $this->wg->SuppressPageHeader = true;
     }
     // MonetizationModule Extension
     if (!empty($this->wg->EnableMonetizationModuleExt)) {
         if (empty($this->wg->AdDriverUseMonetizationService)) {
             $this->monetizationModules = $this->sendRequest('MonetizationModule', 'index')->getData()['data'];
             $this->headerModuleParams['monetizationModules'] = $this->monetizationModules;
         } else {
             $this->monetizationModules = [MonetizationModuleHelper::SLOT_TYPE_IN_CONTENT => $this->app->renderView('Ad', 'Index', ['slotName' => 'MON_IN_CONTENT']), MonetizationModuleHelper::SLOT_TYPE_BELOW_CATEGORY => $this->app->renderView('Ad', 'Index', ['slotName' => 'MON_BELOW_CATEGORY'])];
         }
         $this->bodytext = MonetizationModuleHelper::insertIncontentUnit($this->bodytext, $this->monetizationModules);
     }
     $namespace = $wgTitle->getNamespace();
     // extra logic for subpages (RT #74091)
     if (!empty($this->subtitle)) {
         switch ($namespace) {
             // for user subpages add link to theirs talk pages
             case NS_USER:
                 $talkPage = $wgTitle->getTalkPage();
                 // get number of revisions for talk page
                 $service = new PageStatsService($wgTitle->getArticleId());
                 $comments = $service->getCommentsCount();
                 // render comments bubble
                 $bubble = F::app()->renderView('CommentsLikes', 'Index', array('comments' => $comments, 'bubble' => true));
                 $this->subtitle .= ' | ';
                 $this->subtitle .= $bubble;
                 $this->subtitle .= Wikia::link($talkPage);
                 break;
             case NS_USER_TALK:
                 $subjectPage = $wgTitle->getSubjectPage();
                 $this->subtitle .= ' | ';
                 $this->subtitle .= Wikia::link($subjectPage);
                 break;
         }
     }
     // bugid-70243: optionally hide navigation h1s for SEO
     $this->setVal('displayHeader', !$this->wg->HideNavigationHeaders);
     wfProfileOut(__METHOD__);
 }
Пример #12
0
	private function configure() {
		global $wgTitle, $wgContentNamespaces, $wgEnableFAST_HOME2, $wgEnableCorporatePageExt, $wgExtraNamespaces;

		self::$config = array();

		if (!AdEngine2Controller::areAdsShowableOnPage()) {
			return;
		}

		if(WikiaPageType::isWikiaHub() && AdEngine::isAdsEnabledOnWikiaHub()) {
			self::$config['HOME_TOP_LEADERBOARD'] = true;
			self::$config['TOP_BUTTON'] = true;
			return;
		}
		// Ads on corporate hub pages only
		elseif($wgEnableCorporatePageExt) {
			if (BodyController::isHubPage()) {
				self::$config['CORP_TOP_LEADERBOARD'] = true;
				self::$config['CORP_TOP_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
			}
			elseif (WikiaPageType::isSearch()) {
				if (!empty($this->wg->EnableWikiaSearchAds)) {
					// no regular ads if search ads are enabled
				} else {
					self::$config['TOP_LEADERBOARD'] = true;
					self::$config['TOP_RIGHT_BOXAD'] = true;
					self::$config['TOP_BUTTON'] = true;				
				}
			}
			return;
		}

		$namespace = $wgTitle->getNamespace();

		if(WikiaPageType::isMainPage()) {
			// main page
			self::$config['HOME_TOP_LEADERBOARD'] = true;
			self::$config['INVISIBLE_1'] = true;
			self::$config['INVISIBLE_2'] = true;
			self::$config['PREFOOTER_LEFT_BOXAD'] = true;
			self::$config['PREFOOTER_RIGHT_BOXAD'] = true;
			self::$config['HOME_INVISIBLE_TOP'] = false;	// skins used to be served from this slot, but are now served from TOP_LEADERBOARD with option dcopt=ist
			if($wgEnableFAST_HOME2) {
				self::$config['HOME_TOP_RIGHT_BOXAD'] = true;
				self::$config['TEST_HOME_TOP_RIGHT_BOXAD'] = true;
			}
			self::$config['HOME_TOP_RIGHT_BUTTON'] = true;
			self::$config['TOP_BUTTON'] = true;
		} else {
			if(in_array($namespace, $wgContentNamespaces)) {
				// content page
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TEST_TOP_RIGHT_BOXAD'] = true;
				self::$config['MIDDLE_RIGHT_BOXAD'] = true;
				self::$config['INVISIBLE_1'] = true;
				self::$config['INVISIBLE_2'] = true;
				self::$config['LEFT_SKYSCRAPER_2'] = true;
				self::$config['LEFT_SKYSCRAPER_3'] = true;
				self::$config['PREFOOTER_LEFT_BOXAD'] = true;
				self::$config['PREFOOTER_RIGHT_BOXAD'] = true;
				self::$config['INVISIBLE_TOP'] = false;	// skins used to be served from this slot, but are now served from TOP_LEADERBOARD with option dcopt=ist
				self::$config['TOP_RIGHT_BUTTON'] = true;
				self::$config['TOP_BUTTON'] = true;
			} else if($namespace == NS_FILE) {
				// file/image page
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
			} else if(WikiaPageType::isForum()) {
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
				self::$config['LEFT_SKYSCRAPER_3'] = true;
				self::$config['PREFOOTER_LEFT_BOXAD'] = true;
				self::$config['PREFOOTER_RIGHT_BOXAD'] = true;
			} else if (WikiaPageType::isSearch()) {
				// search results page
				if (empty($this->wg->EnableWikiaSearchAds)) {
					// regular ads if search ads are disabled
					self::$config['TOP_LEADERBOARD'] = true;
					self::$config['TOP_RIGHT_BOXAD'] = true;
					self::$config['TEST_TOP_RIGHT_BOXAD'] = true;
					self::$config['TOP_BUTTON'] = true;
					self::$config['LEFT_SKYSCRAPER_2'] = true;
					self::$config['LEFT_SKYSCRAPER_3'] = true;
					self::$config['PREFOOTER_LEFT_BOXAD'] = true;
					self::$config['PREFOOTER_RIGHT_BOXAD'] = true;
				}
			} else if($namespace == NS_SPECIAL) {
				if($wgTitle->isSpecial('Leaderboard')) {
					self::$config['TOP_LEADERBOARD'] = true;
					self::$config['TOP_RIGHT_BOXAD'] = true;					
					self::$config['TOP_BUTTON'] = true;
				} else if($wgTitle->isSpecial('Videos')) {
					self::$config['TOP_LEADERBOARD'] = true;
				}
			} else if($namespace == NS_CATEGORY) {
				// category page
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TEST_TOP_RIGHT_BOXAD'] = true;
				self::$config['MIDDLE_RIGHT_BOXAD'] = true;
				self::$config['LEFT_SKYSCRAPER_2'] = true;
				self::$config['PREFOOTER_LEFT_BOXAD'] = true;
				self::$config['PREFOOTER_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
			} else if($namespace == NS_PROJECT) {
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
			} else if($namespace == NS_FORUM) {
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
			} else if( BodyController::isBlogListing() ) {
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
			} else if( BodyController::isBlogPost() ) {
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_RIGHT_BOXAD'] = true;
				self::$config['TEST_TOP_RIGHT_BOXAD'] = true;
				self::$config['TOP_BUTTON'] = true;
			} else if (array_key_exists($namespace, $wgExtraNamespaces)) {
				self::$config['TOP_LEADERBOARD'] = true;
				self::$config['TOP_BUTTON'] = true;
			}
		}
	}
Пример #13
0
<?php
echo '<div class="WikiaTopAds'.$topAdsExtraClasses.'" id="WikiaTopAds">';
echo '<div class="WikiaTopAdsInner">';

if (WikiaPageType::isWikiaHub()) {
	echo F::app()->renderView('Ad', 'Index', array('slotname' => 'HOME_TOP_LEADERBOARD'));
}
elseif ($wg->EnableCorporatePageExt) {
	if (WikiaPageType::isSearch()) {
		echo F::app()->renderView('Ad', 'Index', array('slotname' => 'TOP_LEADERBOARD'));
	}
	else {
		echo F::app()->renderView('Ad', 'Index', array('slotname' => 'CORP_TOP_LEADERBOARD'));
	}
} else {
	if (in_array('leaderboard', $wg->ABTests)) {
		// no leaderboard ads
	} else {
		echo F::app()->renderView('Ad', 'Index', array('slotname' => 'TOP_LEADERBOARD'));
		echo F::app()->renderView('Ad', 'Index', array('slotname' => 'HOME_TOP_LEADERBOARD'));
	}
}
if ($wg->EnableTopButton) {
	echo F::app()->renderView('Ad', 'Index', array('slotname' => 'TOP_BUTTON'));
}

echo '</div>';
echo '</div>';
?>