コード例 #1
0
ファイル: AdServer.php プロジェクト: schwarer2006/wikia
 /**
  * @static
  * @return AdServer instance
  */
 public static function getInstance()
 {
     if (self::$instance === false) {
         self::$instance = new AdServer();
     }
     // New instance if skin changed
     $skin = RequestContext::getMain()->getSkin()->getSkinName();
     if ($skin != '' && $skin != self::$instance->skinName) {
         self::$instance = new AdServer();
     }
     return self::$instance;
 }
コード例 #2
0
function WidgetAdvertiserWrapAd($pos, $id)
{
    $ad = AdServer::getInstance()->getAd($pos);
    return empty($ad) ? '' : '<div id="' . $id . '_' . $pos . '" class="widgetAdvertiserAd widgetAdvertiserAd_' . $pos . '">' . $ad . '</div>';
}
コード例 #3
0
ファイル: WikiaMonoBook.php プロジェクト: schwarer2006/wikia
	/**
	 * Setup ads handling
	 */
	protected function setupAds(BaseTemplate &$tpl) {
		AdEngine::getInstance()->setLoadType('inline');

		// BugId:26735 We want spotlights regardless of whether ads have been enabled.
		$adsColumn = '<div id="column-google" class="noprint">'."\n".
			AdEngine::getInstance()->getSetupHtml() .
			'<div id="wikia_header" style="display:none"></div>'; // Hack because ads have code that referenc    es this. Awful.

		if($this->ads === false) {
			// FIXME: not used anymore?
			$tpl->set('ads_top', '');
			$tpl->set('ads_topleft', '');
			$tpl->set('ads_topright', '');
			$tpl->set('ads_bot','');

			$adsColumn .= '<!-- not USING ad server! -->'."\n".'</div>'."\n</div>\n";
		} else {
			// FIXME: not used anymore?
			$tpl->set('ads_top', AdServer::getInstance()->getAd('t'));
			$tpl->set('ads_topleft', AdServer::getInstance()->getAd('tl'));
			$tpl->set('ads_topright', AdServer::getInstance()->getAd('tr'));
			$tpl->set('ads_bot', AdServer::getInstance()->getAd('b'));

			$adsColumn .= '<!-- USING ad server! -->'."\n".
				'<div id="column-google-right">'.AdEngine::getInstance()->getAd('RIGHT_SKYSCRAPER_1').'</div></div>'."\n";
		}

		// BugId:26735 We want spotlights regardless of whether ads have been enabled.
		$adsColumn .= '<table id="spotlight_container"><tr>' .
			'<td><div>'.AdEngine::getInstance()->getPlaceHolderIframe('SPOTLIGHT_FOOTER_1').'</div></td>' .
			'<td><div>'.AdEngine::getInstance()->getPlaceHolderIframe('SPOTLIGHT_FOOTER_2').'</div></td>' .
			'<td><div>'.AdEngine::getInstance()->getPlaceHolderIframe('SPOTLIGHT_FOOTER_3').'</div></td>'.
			"</tr></table>\n".
			AdEngine::getInstance()->getDelayedIframeLoadingCode();

		// add ads column after content
		$tpl->set('ads-column', $adsColumn);
	}