Ejemplo n.º 1
0
 public function getBatchCallHtml()
 {
     $this->batchHtmlCalled = true;
     $out = "<!-- ## BEGIN " . __CLASS__ . '::' . __METHOD__ . " ## -->\n";
     // Make a call for each slot.
     $this->slotsToCall = AdEngine::getInstance()->getSlotNamesForProvider($this->provider_id);
     $out .= '<script type="text/javascript">' . "\n";
     if (!$this->iframeRendering) {
         foreach ($this->slotsToCall as $slotname) {
             $out .= 'GA_googleAddSlot("' . $this->adManagerId . '","' . $slotname . '");' . "\n";
             // Set up key values
             $out .= $this->getProviderValues($slotname);
         }
     }
     // ###### Our custom key values
     // Always pass the hub as a key value
     $out .= $this->getTargetingValue('hub', $this->getHub()) . "\n";
     // And skin
     $out .= $this->getTargetingValue('skin_name', RequestContext::getMain()->getSkin()->getSkinName()) . "\n";
     // And languages
     $out .= 'GA_googleAddAttr("cont_lang", wgContentLanguage);' . "\n";
     $out .= 'GA_googleAddAttr("user_lang", wgUserLanguage);' . "\n";
     // And dbname
     $out .= 'GA_googleAddAttr("dbname", wgDB);' . "\n";
     // ###### Ad Sense attributes
     $out .= $this->getAdSenseAttr() . "\n" . '</script>' . "\n";
     // Make the call for all the ads
     if (!$this->iframeRendering) {
         $out .= '<script type="text/javascript">GA_googleFetchAds();</script>' . "\n";
     }
     $out .= "<!-- ## END " . __CLASS__ . '::' . __METHOD__ . " ## -->\n";
     return $out;
 }
 function execute()
 {
     global $wgOut, $wgUser, $wgRequest, $wgExtensionsPath, $wgOutboundScreenConfig, $wgCityId, $wgEnableOutboundScreenExt;
     $url = $wgRequest->getText('u');
     $noAutoRedirect = $wgRequest->getText('noredirect') == 1 ? true : false;
     $loggedIn = $wgUser->isLoggedIn();
     if (trim($url) == "") {
         // Nowhere to go.  Display an appropriate explanation (nowhere to go).
         $wgOut->addWikiText(wfMsg('outbound-screen-already-logged-in-no-link'));
     } else {
         if ($wgOutboundScreenConfig['anonsOnly'] == true && $loggedIn || empty($wgEnableOutboundScreenExt)) {
             $wgOut->redirect(htmlspecialchars_decode($url));
             return true;
         } else {
             // output only template content
             $wgOut->setArticleBodyOnly(true);
             // render template
             $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
             // Need to have the skinname correct before calling Athena.
             $skin = RequestContext::getMain()->getSkin();
             $skinName = get_class($skin);
             // this may not be set yet (and needs to be before setupUserCss in order for the right CSS$
             if ($skin->getSkinName() == '') {
                 $skin->skinname = strtolower(substr($skinName, 4));
             }
             $adSlots = array('INVISIBLE' => AdEngine::getInstance()->getAd('EXIT_STITIAL_INVISIBLE', array('ghostwriter' => true)), 'BOXAD_1' => AdEngine::getInstance()->getAd('EXIT_STITIAL_BOXAD_1', array('ghostwriter' => true)), 'BOXAD_2' => AdEngine::getInstance()->getAd('EXIT_STITIAL_BOXAD_2', array('ghostwriter' => true)));
             $oTmpl->set_vars(array('adSlots' => $adSlots));
             switch ($this->adLayoutMode) {
                 case 'V1':
                     $adTemplate = 'adLayoutV1';
                     break;
                 case 'V2':
                     $adTemplate = 'adLayoutV2';
                     break;
                 case 'V3':
                     $adTemplate = 'adLayoutV3';
                     break;
                 case 'V4':
                     $adTemplate = 'adLayoutV4';
                     break;
                 case 'V5':
                     $adTemplate = 'adLayoutV5';
                     break;
                 case 'CLASSIC':
                 default:
                     $adTemplate = 'adLayoutClassic';
             }
             $athenaInitStuff = AdProviderAthena::getInstance()->getSetupHtml();
             $adCode = $oTmpl->render($adTemplate);
             $loginMsg = wfMsgExt('outbound-screen-login-text', array('parseinline', 'content'));
             $pageBarMsg = wfMsg('outbound-screen-you-are-leaving');
             $oTmpl->set_vars(array('adCode' => $adCode, 'athenaInitStuff' => $athenaInitStuff, 'loginMsg' => $loginMsg, 'pageBarMsg' => $pageBarMsg, 'pageType' => 'exitPage', 'redirectDelay' => $noAutoRedirect ? 0 : $this->redirectDelay, 'skip' => wfMsg('interstitial-skip-ad'), 'url' => htmlspecialchars_decode($url)));
             // just output content of template
             $wgOut->clearHTML();
             $wgOut->addHTML($oTmpl->render('page'));
         }
     }
 }
 function execute($par)
 {
     global $wgRequest, $wgOut;
     global $wgAdsInterstitialsEnabled;
     global $wgUser;
     $url = trim($wgRequest->getVal('u'));
     $noAutoRedirect = $wgRequest->getText('noredirect') == 1 ? true : false;
     if ($wgAdsInterstitialsEnabled && !$wgUser->isLoggedIn()) {
         $COOKIE_KEY = "IntPgCounter";
         $pageCounter = isset($_COOKIE[$COOKIE_KEY]) ? $_COOKIE[$COOKIE_KEY] : 0;
         // By incrementing the count even for interstitials, we can know when to avoid repeated interstitials for tabbed-browsing.
         // In the calculations for when to display the interstitial, however, this is not considered a "page" (we add 1 to wgAdsInterstitialsPagesBetweenAds to accomplish this).
         global $wgCookiePath, $wgCookieDomain;
         setcookie($COOKIE_KEY, $pageCounter + 1, 0, $wgCookiePath, $wgCookieDomain);
         // If the user shouldn't be seeing an interstitial on this pv, then assume that we are only here because of the user opening many tabs and just redirect to destination right away.
         global $wgAdsInterstitialsPagesBeforeFirstAd;
         global $wgAdsInterstitialsPagesBetweenAds;
         $numToSkip = 2;
         // skip the interstitial and the page it was blocking as candidates
         if ($url != "" && !($wgAdsInterstitialsPagesBeforeFirstAd == $pageCounter - 1 || $pageCounter > $wgAdsInterstitialsPagesBeforeFirstAd && ($pageCounter - $wgAdsInterstitialsPagesBeforeFirstAd - 1) % ($wgAdsInterstitialsPagesBetweenAds + $numToSkip) == 0)) {
             return $this->redirectTo($url);
         }
         $redirectDelay = empty($wgAdsInterstitialsDurationInSeconds) ? INTERSTITIAL_DEFAULT_DURATION_IN_SECONDS : $wgAdsInterstitialsDurationInSeconds;
         // Set up the CSS
         $wgOut->setArticleBodyOnly(true);
         $skin = RequestContext::getMain()->getSkin();
         $skinName = get_class($skin);
         // this may not be set yet (and needs to be before setupUserCss in order for the right CSS file to be included)
         if ($skin->getSkinName() == '') {
             $skin->skinname = substr($skinName, 4);
         }
         if ($skinName == 'SkinMonaco') {
             $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
             $adSlots = array('INVISIBLE' => '&nbsp;', 'BOXAD_1' => AdEngine::getInstance()->getAd('SPECIAL_INTERSTITIAL_BOXAD_1'), 'BOXAD_2' => '&nbsp;');
             $oTmpl->set_vars(array('adSlots' => $adSlots));
             $adTemplate = 'adLayoutClassic';
             $athenaInitStuff = AdProviderAthena::getInstance()->getSetupHtml();
             $adCode = $oTmpl->render($adTemplate);
             $oTmpl->set_vars(array('adCode' => $adCode, 'athenaInitStuff' => $athenaInitStuff, 'pageType' => 'interstitial', 'redirectDelay' => $noAutoRedirect ? 0 : $this->redirectDelay, 'skip' => wfMsg('interstitial-skip-ad'), 'url' => $url));
             $wgOut->clearHTML();
             $wgOut->addHTML($oTmpl->render('page'));
         } else {
             return $this->redirectTo($url);
         }
     } else {
         if ($url == "") {
             // Nowhere to go.  Display an appropriate explanation (either wgAdsInterstitialsEnabled is false or the user is logged in).
             if ($wgUser->isLoggedIn()) {
                 $wgOut->addWikiText(wfMsg('interstitial-already-logged-in-no-link') . wfMsg('interstitial-link-away'));
             } else {
                 $wgOut->addWikiText(wfMsg('interstitial-disabled-no-link') . wfMsg('interstitial-link-away'));
             }
         } else {
             // Since interstitials aren't enabled or the user is logged in, just redirect to the destination URL immediately.
             return $this->redirectTo($url);
         }
     }
 }
Ejemplo n.º 4
0
 private function getKadId($slotname)
 {
     $adtype = AdEngine::getInstance()->getAdType($slotname);
     if (isset($this->kadids[$adtype])) {
         return $this->kadids[$adtype];
     } else {
         return false;
     }
 }
 public function index()
 {
     $this->wf->profileIn(__METHOD__);
     if (!$this->wg->Title->isSpecialPage()) {
         $this->response->setVal('adSlot', AdEngine::getInstance()->getAd('MOBILE_TOP_LEADERBOARD'));
     } else {
         $this->skipRendering();
     }
     $this->wf->profileOut(__METHOD__);
 }
Ejemplo n.º 6
0
function WidgetLeftNav($id, $params)
{
    global $wgEnableLeftNavWidget;
    wfProfileIn(__METHOD__);
    # control display with this variable
    if (empty($wgEnableLeftNavWidget)) {
        wfProfileOut(__METHOD__);
        return '';
    }
    $ret = array();
    # do not wrap widget in box
    $ret['nowrap'] = true;
    # get ad code
    $ret['body'] = "<div style='margin-bottom: 10px'>" . AdEngine::getInstance()->getPlaceholderIframe('LEFT_NAV_205x400') . "</div>";
    wfProfileOut(__METHOD__);
    return $ret;
}
Ejemplo n.º 7
0
	function getTopAdCode(){
	        echo AdEngine::getInstance()->getSetupHtml();

		global $wgOut, $wgEnableIframeAds, $wgEnableTandemAds, $wgEnableFAST_HOME2;
		$topAdCode = '';
		if ($wgOut->isArticle()){
			if (WikiaPageType::isMainPage()){
				$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('HOME_TOP_LEADERBOARD');
				if ($wgEnableFAST_HOME2) {
					$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('HOME_TOP_RIGHT_BOXAD');
				}
			} else if ( WikiaPageType::isContentPage()){
				$topAdCode = AdEngine::getInstance()->getPlaceHolderIframe('TOP_LEADERBOARD');
			}
		} elseif (WikiaPageType::isSearch()) {
			$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('TOP_LEADERBOARD');
			$topAdCode .= AdEngine::getInstance()->getPlaceHolderIframe('TOP_RIGHT_BOXAD');
		}
		return $topAdCode;
	}
Ejemplo n.º 8
0
	public function addWikiaVars(&$obj, &$tpl) {
		parent::addWikiaVars($obj, $tpl);

		AdEngine::getInstance()->setLoadType('inline');

		$spotlights = AdEngine::getInstance()->getSetupHtml() .
'<div id="wikia_header" style="display:none"></div>
<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>' .
AdEngine::getInstance()->getDelayedIframeLoadingCode();

		$tpl->set('ads-column', $spotlights );
		return true;
	}
Ejemplo n.º 9
0
				</td>
			</tr>
			</table>
		</div>
	</div><!-- Closing "wikia_page" -->
	<div id="widget_sidebar">
		Left Skyscraper 1:
		<?php 
echo AdEngine::getInstance()->getPlaceHolderDiv("LEFT_SKYSCRAPER_1", false);
?>
		<p>
		Left Spotlight:
		<?php 
echo AdEngine::getInstance()->getPlaceHolderDiv("LEFT_SPOTLIGHT_1");
?>

		<p>
		Left Skyscraper 2:
		<?php 
echo AdEngine::getInstance()->getPlaceHolderDiv("LEFT_SKYSCRAPER_2", false);
?>
	
	</div>
  </div><!-- Closing bodyContent -->
</div><!--Closing "monaco_shrinkwrap" -->
<?php 
echo AdEngine::getInstance()->getDelayedLoadingCode();
?>
</body>
</html>
Ejemplo n.º 10
0
	public function executeIndex(array $params) {
		global $wgEnableShinyAdsSelfServeUrl, $wgShinyAdsSelfServeUrl;

		if(self::$config === null) {
			$this->configure();
		}

		$this->slotname = $params['slotname'];
		$this->selfServeUrl = null;
		if ($wgEnableShinyAdsSelfServeUrl && $wgShinyAdsSelfServeUrl) {
			if (array_search($this->slotname, self::$slotsDisplayShinyAdSelfServe) !== FALSE) {
				if (!(AdEngine::getInstance()->getAdProvider($this->slotname) instanceof AdProviderNull)) {	// will we show an ad?
					$this->selfServeUrl = $wgShinyAdsSelfServeUrl;
				}
			}
		}

		if(isset(self::$config[$this->slotname])) {
			if (AdEngine::getInstance()->getProviderNameForSlotname($this->slotname) == 'AdDriver') {
				$this->ad = AdEngine::getInstance()->getAd($this->slotname, $params);
			}
			elseif (AdEngine::getInstance()->getProviderNameForSlotname($this->slotname) == 'LiftDNA') {
				$this->ad = AdEngine::getInstance()->getPlaceHolderDiv($this->slotname);
			}
			elseif (AdEngine::getInstance()->getProviderNameForSlotname($this->slotname) == 'DARTGP' ||
					AdEngine::getInstance()->getProviderNameForSlotname($this->slotname) == 'AdEngine2' ||
					AdEngine::getInstance()->getProviderNameForSlotname($this->slotname) == 'GamePro') {
				$this->ad = AdEngine::getInstance()->getAd($this->slotname);
			}
			else {
				if (in_array($this->slotname, self::$slotsUseGetAd)) {
					$this->ad = AdEngine::getInstance()->getAd($this->slotname);
				}
				else {
					$this->ad = AdEngine::getInstance()->getPlaceHolderIframe($this->slotname);
				}
			}
		}
		wfRunHooks('AfterAdModuleExecute', array( &$this ));

	}
Ejemplo n.º 11
0
<section class="WikiaLatestEarnedBadgesModule module">
	<?php 
echo AdEngine::getInstance()->getPlaceHolderIframe("ACHIEVEMENTS_BOXAD");
?>
	<h1 class="achievements-title"><?php 
echo wfMsg('achievements-recent-earned-badges');
?>
</h1>
	
	<ul class="recent-badges badges">
		<?php 
echo $app->getView('LatestEarnedBadges', 'ListBadges', array('badges' => $recents, 'displayMode' => 'LatestBadges'))->render();
?>
	</ul>

	<?php 
echo Wikia::specialPageLink('WikiActivity', 'oasis-more', 'more');
?>
</section>
Ejemplo n.º 12
0
 public function getAd($ad_pos)
 {
     global $wgAdServingType, $wgShowAds, $wgUseAdServer, $wgUseDARTOnMainPage;
     //$wgUseDARTOnMainPAge = true;
     if (empty($wgUseDARTOnMainPage)) {
         if ($ad_pos == 'HOME_TOP_LEADERBOARD') {
             $ad_pos = 'FAST_HOME1';
         }
         if ($ad_pos == 'HOME_TOP_RIGHT_BOXAD') {
             $ad_pos = 'FAST_HOME2';
         }
     }
     if (substr($ad_pos, 0, 4) == 'HOME') {
         $this->adsDisplayed[] = array($ad_pos, AdEngine::getInstance()->getAd($ad_pos));
         return "<!-- {$ad_pos} -->" . '<div id="adSpace' . (count($this->adsDisplayed) - 1) . '"' . ($ad_pos == 'HOME_TOP_LEADERBOARD' || $ad_pos == 'HOME_TOP_RIGHT_BOXAD' ? ' class="' . $ad_pos . '"' : '') . '>&nbsp;</div>';
     }
     if (isset($this->adsConfig[$ad_pos]) && !empty($wgShowAds) && !empty($wgUseAdServer)) {
         $ad = $this->adsConfig[$ad_pos];
         if (is_array($ad)) {
             if ($ad['server'] == 'L') {
                 return "<!-- adserver={$ad['server']} {$ad_pos} {$ad['zone']} -->\n<script type='text/javascript'><!--//<![CDATA[\nvar m3_u = 'http://wikia-ads.wikia.com/www/delivery/ajs.php';\nvar m3_r = Math.floor(Math.random()*99999999999);\nif(!document.MAX_used) document.MAX_used = ',';\ndocument.write(\"<scr\"+\"ipt type='text/javascript' src='\"+m3_u);\ndocument.write(\"?zoneid={$ad['zone']}\");\ndocument.write('&amp;cb=' + m3_r);\nif (document.MAX_used != ',') document.write(\"&amp;exclude=\" + document.MAX_used);\ndocument.write(\"&amp;loc=\" + escape(window.location));\nif(document.referrer) document.write(\"&amp;referer=\" + escape(document.referrer));\nif(document.context) document.write(\"&context=\" + escape(document.context));\nif(document.mmm_fo) document.write(\"&amp;mmm_fo=1\");\ndocument.write(\"'><\\/scr\"+\"ipt>\");\n//]]>--></script>";
             } else {
                 if ($ad['server'] == 'H') {
                     return "<!-- adserver={$ad['server']} {$ad_pos} {$ad['zone']} -->\n<script type='text/javascript'><!--//<![CDATA[\nvar m3_u = 'http://d.openx.org/ajs.php';\nvar m3_r = Math.floor(Math.random()*99999999999);\nif(!document.MAX_used) document.MAX_used = ',';\ndocument.write(\"<scr\"+\"ipt type='text/javascript' src='\"+m3_u);\ndocument.write(\"?zoneid={$ad['zone']}\");\ndocument.write('&amp;cb=' + m3_r);\nif(document.MAX_used != ',') document.write(\"&amp;exclude=\" + document.MAX_used);\ndocument.write (\"&amp;loc=\" + escape(window.location));\nif(document.referrer) document.write(\"&amp;referer=\" + escape(document.referrer));\nif(document.context) document.write(\"&context=\" + escape(document.context));\nif(document.mmm_fo) document.write(\"&amp;mmm_fo=1\");\ndocument.write (\"'><\\/scr\"+\"ipt>\");\n//]]>--></script>";
                 }
             }
         } else {
             return $ad;
         }
     }
 }
				<span class="carousel-arrow next button secondary"></span>
				<span class="carousel-arrow previous button secondary"></span>
	 			<div id="LightboxCarouselContainer" class="LightboxCarouselContainer">
	 				<div>
	 					<ul class="carousel">
	 					</ul>
	 				</div>
	 			</div>
			</div>
		</div>
		<?php 
if ($showAds) {
    ?>
			<div id="MODAL_RECTANGLE" class="wikia-ad noprint">
				<?php 
    echo AdEngine::getInstance()->getAd('MODAL_RECTANGLE', array('ghostwriter' => true));
    ?>
			</div>
		<?php 
}
?>
	</div>

	<div class="more-info">
	</div>

	<div class="share">
	</div>

	<script id="LightboxPhotoTemplate" class="template" type="text/template">
		<img src="{{imageUrl}}" height="{{imageHeight}}" >
Ejemplo n.º 14
0
function wfCategoryPageWithAds(&$cat)
{
    global $wgOut;
    global $wgUser;
    if ($wgUser->isAnon()) {
        $wgOut->addHTML(AdEngine::getInstance()->getPlaceHolderDiv('ANSWERSCAT_LEADERBOARD_A'));
    }
    $article = new Article($cat->mTitle);
    $article->view();
    if (NS_CATEGORY == $cat->mTitle->getNamespace()) {
        global $wgOut, $wgRequest;
        $from = $wgRequest->getVal('from');
        $until = $wgRequest->getVal('until');
        $viewer = new CategoryWithAds($cat->mTitle, $from, $until);
        $wgOut->addHTML($viewer->getHTML());
    }
    return false;
}
Ejemplo n.º 15
0
	/**
	 * 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);
	}
Ejemplo n.º 16
0
 /**
  * wlee 2011/01/28
  * With the advent of AdConfig.js, this function is no longer maintained.
  * All DART URL development should be done in AdConfig.js only.
  *
  * Wikia's standard invocation of DART, in an iframe, has been changed to
  * use AdConfig.js.
  *
  * This function exists only to support AdProviderDART::getAd() [the JS
  * invocation of DART]. As of this date, there is no good reason to call getAd().
  * I hope that we can someday deprecate getAd() this function, and all
  * the helper functions involved in creating the DART url.
  */
 public function getUrl($slotname, $slot)
 {
     wfProfileIn(__METHOD__);
     // Manipulate DART sizes for values it expects
     switch ($slot['size']) {
         case '300x250':
             $slot['size'] = '300x250,300x600';
             break;
         case '600x250':
             $slot['size'] = '600x250,300x250';
             break;
         case '728x90':
             $slot['size'] = '728x90,468x60';
             break;
         case '160x600':
             $slot['size'] = '160x600,120x600';
             break;
         case '0x0':
             $slot['size'] = '1x1';
             break;
     }
     /* Nick wrote: Note, be careful of the order of the key values. From Dart Webmaster guide:
      * 	Order of multiple key-values in DART ad tags:  For best performance, DoubleClick recommends
      * 	that reserved key-values be placed as the last attributes in the DART ad tags, after any custom key-
      * 	values. In particular, the following key-values must be used in the following order:
      * 	sz=widthxheight
      * 	tile=value or ptile=value
      * 	ord=value
      * 	The ord=value key-value must be the last attribute in the DART ad tag.
      *
      * 	Note that we also have an "endtag", which slightly contradicts the above, but apparently that's ok.
      * 	endtag=$ is for forwarding requests to other DART ad networks, ala Gamepro.
      */
     static $rand;
     if (empty($rand)) {
         // This should be the same for every ad on the page
         $rand = mt_rand();
     }
     global $wgTitle;
     if (is_object($wgTitle) && method_exists($wgTitle, 'getText')) {
         $wpage = 'wpage=' . str_replace(array("%27", "%22", "%3b"), "_", $wgTitle->getPartialURL()) . ';';
     } else {
         $wpage = '';
     }
     $src = 'direct';
     $tile = $this->getTileKV($slotname);
     $mtfIFPath = '';
     $ord = $rand;
     if (AdEngine::getInstance()->getProviderNameForSlotname($slotname) == 'AdDriver') {
         $src = 'driver';
         $tile = 'tile=N;';
         $ord = 'N';
     } else {
         $mtfIFPath .= 'mtfIFPath=/extensions/wikia/AdEngine/;';
         // http://www.google.com/support/richmedia/bin/answer.py?hl=en&answer=117857, http://www.google.com/support/richmedia/bin/answer.py?hl=en&answer=117427
     }
     $url = 'http://ad.doubleclick.net/';
     $url .= $this->getAdType() . '/';
     $url .= $this->getFirstChunk() . ';';
     $url .= 's1=' . $this->getZone1() . ';';
     // this seems redundant
     $url .= 's2=' . $this->getZone2() . ';';
     $url .= $this->getProviderValues($slot);
     $url .= $this->getArticleKV();
     $url .= $this->getDomainKV($_SERVER['HTTP_HOST']);
     $url .= 'pos=' . $slotname . ';';
     $url .= $wpage;
     $url .= $this->getKeywordsKV();
     $url .= 'dis=N;';
     // screen resolution (used only by AdDriver)
     $url .= 'hasp=N;';
     // page has prefooter ads? (used only by AdDriver)
     $url .= "qcseg=N;";
     // wlee: placeholder for JS that sets the real key-value. See self::getIframeFillFunctionDefinition()
     $url .= "impct=N;";
     // impression count for current session (used only by AdDriver)
     $url .= $this->getLocKV($slotname);
     $url .= $this->getDcoptKV($slotname);
     $url .= $mtfIFPath;
     $url .= "src={$src};";
     $url .= "sz=" . $slot['size'] . ';';
     $url .= 'mtfInline=true;';
     // http://www.google.com/support/richmedia/bin/answer.py?hl=en&answer=182220
     $url .= $tile;
     // special "end" delimiter, this is for when we redirect ads to other places. Per Michael
     $url .= 'endtag=$;';
     $url .= "ord=" . $ord . "?";
     // See note above, ord MUST be last. Also note that DART told us to put the ? at the end
     wfProfileOut(__METHOD__);
     return $url;
 }
echo wfMsg('gamingcalendar-today');
?>
</a>
	</div>

   <script type="text/template" id="GamingCalendarWeekTemplate">
			<h1>
				<span>##week-caption##</span>
				##startmonth## ##start## &ndash; ##endmonth## ##end##
			</h1>
			<div class="scroll-up"><img src="<?php 
echo $wgBlankImgUrl;
?>
" height="0" width="0"></div>
			<div class="list">
				<ul>##items##</ul>
			</div>
			<div class="scroll-down"><img src="<?php 
echo $wgBlankImgUrl;
?>
" height="0" width="0"></div>
   </script>
  
   <div id="INVISIBLE_MODAL" class="wikia-ad noprint">
<?php 
echo AdEngine::getInstance()->getAd('INVISIBLE_MODAL', array('ghostwriter' => true));
?>
   </div>
</div>
<div id="GamingCalendarSkinLeft" class="GamingCalendarSkin GamingCalendarSkinLeft"><a href="" target="_blank"></a></div>
<div id="GamingCalendarSkinRight" class="GamingCalendarSkin GamingCalendarSkinRight"><a href="" target="_blank"></a></div>
Ejemplo n.º 18
0
    function execute($par)
    {
        global $wgRequest, $wgOut;
        $action = Skin::makeSpecialUrl('Keyword');
        $label = wfMsgExt('keyword-label', array('parseinline'));
        $submit = wfMsg('keyword-submit');
        $specialKeywordCommonUrl = Skin::makeSpecialUrl('Keyword', 'target=common');
        $list = wfMsg('keyword-keywords-list', $specialKeywordCommonUrl);
        $post = '<p />
			<form action="' . self::$specialKeywordUrl . "\" method=\"get\">\n\t\t\t{$label}\n\t\t\t<input type=\"text\" name=\"kw\" size=\"40\" maxlength=\"80\" />\n\t\t\t<input type=\"submit\" value=\"{$submit}\" />\n\t\t\t</form><p />\n\t\t\t{$list}<p />";
        $output = '';
        $this->setHeaders();
        $wgOut->setRobotPolicy('index,follow');
        // Google
        //TODO: "summary" is hardcoded in German, should this whole block be moved to message?
        $google = '<table border="1" cellspacing="0" cellpadding="4" style="float:right; margin:0 0 .5em 1em;
		 width:260px; background:#fff; border-collapse:collapse; border:1px solid #999;
		 font-size:smaller; line-height:1.5; " summary="Anzeigen"><tr><td align="center" height="250" style="background:#ffffff;">';
        $google .= AdEngine::getInstance()->getAd('WEBSITEWIKI_KEYWORDS');
        $google .= '</td></tr></table>';
        # Get request data from, e.g.
        $kwp = $wgRequest->getText('kw');
        $tar = $wgRequest->getText('target');
        $doall = $wgRequest->getText('all');
        $kwt = substr(strstr($wgRequest->getVal('title'), '/'), 1);
        $kw = $kwp ? $kwp : $kwt;
        # Do stuff
        $dbr = wfGetDB(DB_SLAVE, 'vslow');
        if ($tar == 'common') {
            $wgOut->setPagetitle(wfMsg('keyword-common-page-title'));
            $label = wfMsg('keyword-common-label');
            $wgOut->addHTML("{$label}<ol>\n");
            $res = $dbr->doQuery('SELECT kw_word, kw_count FROM kw_keywords ORDER BY kw_count DESC LIMIT 100');
            while ($res && ($row = mysql_fetch_row($res))) {
                $kword = $row[0];
                $kcount = $row[1];
                $output .= '<li>' . $this->kwlink($kword) . " ({$kcount})</li>\n";
            }
            $output .= "</ol>\n";
            $wgOut->addHTML($google . $output);
            return;
        }
        if (!isset($kw) || strlen($kw) < 2) {
            $wgOut->addHTML($post);
            return;
        }
        $keyword = strtolower(trim(str_replace('_', ' ', $kw)));
        $gnkeyword = $keyword;
        $keyword[0] = strtoupper($keyword[0]);
        $wgOut->setPagetitle(wfMsg('keyword-page-title', $keyword));
        $kw = $dbr->strencode(strtolower(trim(str_replace('_', ' ', $kw))));
        $res = $dbr->doQuery('SELECT COUNT(*) FROM kw_keywords');
        if ($res && ($row = mysql_fetch_row($res))) {
            $diffkeys = $row[0];
        } else {
            $wgOut->addWikiMsg('keyword-bad-length');
            return;
        }
        $res = $dbr->doQuery('SELECT kw_count FROM kw_keywords ORDER BY kw_count DESC LIMIT 1');
        if ($res && ($row = mysql_fetch_row($res))) {
            $maxkeycount = $row[0];
        } else {
            $wgOut->addWikiMsg('keyword-bad-length');
            return;
        }
        $res = $dbr->doQuery("SELECT kw_count, kw_id FROM kw_keywords WHERE kw_word='{$kw}'");
        if ($res && ($row = mysql_fetch_row($res))) {
            $thiskeycount = $row[0];
            $thiskeyid = $row[1];
        } else {
            $wgOut->addWikiMsg('keyword-not-used', $keyword);
            return;
        }
        $thisrelcomm = round($thiskeycount / $maxkeycount * 100, 2);
        $output .= '<ul>';
        $output .= wfMsg('keyword-description', $keyword, $gnkeyword, $specialKeywordCommonUrl);
        $res = $dbr->doQuery("SELECT kw_page,kw_ptype FROM kw_page WHERE kw_key = {$thiskeyid} LIMIT 50;");
        // 50 was 100
        $similpages = array();
        $porncount = 0;
        while ($res && ($row = mysql_fetch_row($res))) {
            $similpages[] = $row[0];
            $porncount += $row[1];
        }
        // $output .= "<li>npc = $porncount</li>\n";
        $similstring = '(';
        foreach ($similpages as $spage) {
            $similstring .= $spage . ",";
        }
        $similstring .= '0)';
        $res = $dbr->doQuery("SELECT kw_word FROM kw_keywords,kw_page WHERE kw_page IN {$similstring} AND kw_key=kw_id GROUP BY kw_key ORDER BY COUNT(kw_key) DESC LIMIT 15 OFFSET 1");
        while ($res && ($row = mysql_fetch_row($res))) {
            $sameword = $row[0];
            $output .= '<li>' . $this->kwlink($sameword) . "</li>\n";
        }
        $output .= "</ul></li>\n";
        if (!$doall && $thiskeycount > 25) {
            srand($thiskeyid);
            $off = rand(0, $thiskeycount - 25);
            $ua = wfMsg('keyword-incl');
            $alleanz = ' [<a href="?all=1"' . wfMsg('keyword-show-all') . '</a>]';
            $limi = "LIMIT 25 OFFSET {$off}";
        } else {
            $ua = '';
            $off = 0;
            $alleanz = '';
            $limi = '';
        }
        // randomized, slow $res = $dbr->doQuery("select page_title from kw_page,page where kw_key=$thiskeyid and page_id=kw_page order by rand($thiskeyid) limit 25");
        $res = $dbr->doQuery("SELECT page_title FROM kw_page, page WHERE kw_key={$thiskeyid} AND page_id=kw_page {$limi}");
        $usedOn = wfMsg('keyword-used-on', $keyword, $alleanz);
        $output .= "<li>{$usedOn}</li>\n</ul>\n<ul>\n";
        while ($res && ($row = mysql_fetch_row($res))) {
            $pgtitle = $row[0];
            $output .= '<li><a href="/' . htmlspecialchars($pgtitle) . "\">{$pgtitle}</a></li>\n";
        }
        $output .= "</ul></li>\n";
        $output .= "</ul>\n";
        //		$output .= "KW: $kw num $diffkeys this $thiskeycount id $thiskeyid max $maxkeycount\n";
        if ($porncount == 0) {
            $wgOut->addHTML($google . $output);
        } else {
            $wgOut->addHTML($output);
        }
    }
Ejemplo n.º 19
0
<? if (!$wg->NoExternals) { ?>
<section<? if (!empty($sectionId)) { ?> id="<?= $sectionId ?>"<? } ?>>
	<div class="header-container">
		<h1><?= wfMsg($titleMsg) ?></h1>
		<?= F::app()->renderView('RandomWiki', 'Index') ?>
	</div>
	<?= AdEngine::getInstance()->getLazyLoadableAdGroup($adGroupName, $adslots) ?>
	<ul<? if (!empty($adGroupName)) { ?> id="<?= $adGroupName ?>"<? if ($useLazyLoadAdClass) { ?> class="<?= AdEngine::lazyLoadAdClass ?><?= $wg->EnableSpotlightsV2_Footer ? ' SPOTLIGHT_FOOTER' : '' ?>"<? } } ?>>
		<? for ($i=0; $i<$n_adslots; $i++) { ?>
		<li class="WikiaSpotlight item-<?= $i+1 ?>" id="<?= ( isset($adslots[$i]) ) ? $adslots[$i] : 'SPOTLIGHT_FOOTER_FORCED_'.$i; ?>">
			<?
			if ( empty( $forceContent[$i] ) ) {
				echo AdEngine::getInstance()->getAd( $adslots[$i] );
			} else {
				echo $forceContent[$i];
			}  ?>
		</li>
		<? } ?>
	</ul>
</section>
<? } /* end !wgNoExternals */ ?>
Ejemplo n.º 20
0
<div id="hub-side-box">
	<?php 
$hidetopblogs = '';
if (!$wgUser->isAllowed('corporatepagemanager')) {
    // normal user that will have it disabled/enabled
    if (!$data['var_feeds']['topblogs']) {
        $hidetopblogs = 'class="hiddenSection"';
    }
}
?>
	<?php 
if (AutoHubsPagesHelper::showAds()) {
    /* move to AdEngine, use hooks */
    ?>
	<div id='CORP_TOP_RIGHT_BOXAD' style='margin-top:-15px'><?php 
    echo AdEngine::getInstance()->getAd('CORP_TOP_RIGHT_BOXAD');
    ?>
</div>
	<?php 
}
?>


	<section id="hub-blogs"<?php 
echo $hidetopblogs;
?>
>
		<h1><?php 
echo wfMsg('hub-blog-header', $data['title']);
?>
</h1>
Ejemplo n.º 21
0
			echo F::app()->renderView('Ad', 'Index', array('slotname' => 'INVISIBLE_2'));
		}
	}
?>

<? if( $jsAtBottom ): ?>
	<!--[if lt IE 8]>
		<script src="<?= $wg->ResourceBasePath ?>/resources/wikia/libraries/json2/json2.js"></script>
	<![endif]-->

	<!--[if lt IE 9]>
		<script src="<?= $wg->ResourceBasePath ?>/resources/wikia/libraries/html5/html5.min.js"></script>
	<![endif]-->

	<!-- Combined JS files and head scripts -->
	<?= $jsFiles ?>
<? endif ?>

<?= AdEngine::getInstance()->getDelayedIframeLoadingCode() ?>

<script type="text/javascript">/*<![CDATA[*/while(wgAfterContentAndJS.length>0){wgAfterContentAndJS.shift()();}/*]]>*/</script>

<?= $bottomScripts ?>
<?= $cssPrintLinks ?>

</body>

<?= wfReportTime() . "\n" ?>
<?= F::app()->renderView('Ad', 'Config') ?>

</html>