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' => ' ', 'BOXAD_1' => AdEngine::getInstance()->getAd('SPECIAL_INTERSTITIAL_BOXAD_1'), 'BOXAD_2' => ' ');
             $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);
         }
     }
 }
Esempio n. 3
0
 private function getKadId($slotname)
 {
     $adtype = AdEngine::getInstance()->getAdType($slotname);
     if (isset($this->kadids[$adtype])) {
         return $this->kadids[$adtype];
     } else {
         return false;
     }
 }
Esempio n. 4
0
 public static function getInstance()
 {
     if (self::$instance == false) {
         $h = AdEngine::getCachedCategory();
         // ***************** Athena has been replaced by Liftium
         return self::$instance = new AdProviderLiftium();
     }
     return self::$instance;
 }
 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__);
 }
 public function getAd($slotname, $slot, $params = null)
 {
     $cwtagid = self::getCwtagid($slot);
     if (empty($cwtagid)) {
         $NullAd = new AdProviderNull("cwtagid must be supplied", true);
         return $NullAd->getAd($slotname, $slot);
     }
     $out = "<!-- " . __CLASS__ . " slot: {$slotname} -->";
     $dim = AdEngine::getHeightWidthFromSize($slot['size']);
     $url = "http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=" . $slot['size'] . "&cwpid=" . $this->cwpid . "&cwwidth=" . $dim['width'] . "&cwheight=" . $dim['height'] . "&cwpnet=1&cwtagid=" . urlencode($cwtagid);
     $out .= '<script type="text/javascript" src="' . $url . '"></script>';
     return $out;
 }
Esempio n. 7
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;
}
 /**
  * Register ad-related vars on top
  *
  * @param array $vars
  *
  * @return bool
  */
 public function onWikiaSkinTopScripts(&$vars, &$scripts)
 {
     wfProfileIn(__METHOD__);
     $wg = $this->app->wg;
     // AdEngine2.js
     $vars['adslots2'] = array();
     $vars['wgLoadAdsInHead'] = !empty($wg->LoadAdsInHead);
     $vars['wgAdsShowableOnPage'] = self::areAdsShowableOnPage();
     $vars['wgShowAds'] = $wg->ShowAds;
     // TODO remove later, legacy addriver for adsinhead=1
     $vars['adDriverLastDARTCallNoAds'] = array();
     // WikiaDartHelper.js
     if (!empty($wg->DartCustomKeyValues)) {
         $vars['wgDartCustomKeyValues'] = $wg->DartCustomKeyValues;
     }
     $cat = AdEngine::getCachedCategory();
     $vars["cityShort"] = $cat['short'];
     wfProfileOut(__METHOD__);
     return true;
 }
Esempio n. 9
0
    public function getAd($slotname, $slot, $params = null)
    {
        $dim = AdEngine::getHeightWidthFromSize($slot['size']);
        $out = "<!-- " . __CLASS__ . " slot: {$slotname} -->";
        $out .= '<script type="text/javascript">/*<![CDATA[*/
				google_ad_client = "pub-4086838842346968";
				google_ad_width	 = "' . $dim['width'] . '";
				google_ad_height = "' . $dim['height'] . '";
				google_ad_format = google_ad_width + "x" + google_ad_height + "_as";
				google_ad_type   = "text";
				google_ad_region = "region";' . "\n";
        $channel = $this->getChannel();
        $out .= 'google_ad_channel = "' . addslashes($channel) . '";' . "\n";
        /* Channel is how we do bucket tests.
         * Testing the effectiveness of google_page_url and google_hints here
         * The first test showed that hints performed better than the control and page_url
         * Now testing control vs hints alone vs hints + page_url
         */
        if ($channel == '9000000009') {
            // page_url + hints. Rumor has it these two are mutually exclusive, but we are trying it anyway.
            $out .= 'google_page_url = "' . addslashes($this->getPageUrl()) . '";' . "\n";
            $out .= $this->getGoogleHints() . "\n";
        } else {
            if ($channel == '9000000010') {
                // Control
            } else {
                if ($channel == '9000000011') {
                    // Hints alone
                    $out .= $this->getGoogleHints() . "\n";
                }
            }
        }
        $out .= '/*]]>*/</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
        return $out;
    }
Esempio n. 10
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);
        }
    }
Esempio n. 11
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;
	}
Esempio n. 12
0
	/**
	 * Return tracking code
	 */
	private function getAnalyticsCode() {
		global $wgCityId;

		return AnalyticsEngine::track('GA_Urchin', AnalyticsEngine::EVENT_PAGEVIEW) .
			AnalyticsEngine::track('GA_Urchin', 'hub', AdEngine::getCachedCategory()) .
			AnalyticsEngine::track('GA_Urchin', 'onewiki', array($wgCityId)) .
			AnalyticsEngine::track('QuantServe', AnalyticsEngine::EVENT_PAGEVIEW);
	}
Esempio n. 13
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;
	}
Esempio n. 14
0
 public function getSetupHtml($params = null)
 {
     static $called = false;
     if ($called) {
         return false;
     }
     $called = true;
     wfProfileIn(__METHOD__);
     global $wgDBname, $wgLang, $wgTitle, $wgLiftiumDevHosts, $wgDevelEnvironment;
     global $wgDartCustomKeyValues, $wgLoadAdDriverOnLiftiumInit;
     // See Liftium.js for documentation on options
     $options = array();
     $options['pubid'] = 999;
     $options['baseUrl'] = '/__varnish_liftium/';
     $options['kv_wgDBname'] = $wgDBname;
     if (is_object($wgTitle)) {
         $options['kv_article_id'] = $wgTitle->getArticleID();
         $options['kv_wpage'] = $wgTitle->getPartialURL();
     }
     $cat = AdEngine::getCachedCategory();
     $options['kv_Hub'] = $cat['name'];
     $options['kv_skin'] = RequestContext::getMain()->getSkin()->getSkinName();
     $options['kv_user_lang'] = $wgLang->getCode();
     $options['kv_cont_lang'] = $GLOBALS['wgLanguageCode'];
     $options['kv_isMainPage'] = WikiaPageType::isMainPage();
     $options['kv_page_type'] = WikiaPageType::getPageType();
     $options['geoUrl'] = "http://geoiplookup.wikia.com/";
     if (!empty($wgDartCustomKeyValues)) {
         $options['kv_dart'] = $wgDartCustomKeyValues;
     }
     $options['kv_domain'] = $_SERVER['HTTP_HOST'];
     if (!empty($params)) {
         if (isset($params['isCalledAfterOnload'])) {
             $options['isCalledAfterOnload'] = $params['isCalledAfterOnload'];
         }
         if (isset($params['hasMoreCalls'])) {
             $options['hasMoreCalls'] = $params['hasMoreCalls'];
         }
         if (isset($params['maxLoadDelay'])) {
             $options['maxLoadDelay'] = $params['maxLoadDelay'];
         }
     }
     // LiftiumOptions as json
     $out = '<script type="text/javascript">' . "\n";
     $out .= "LiftiumOptions = " . json_encode($options) . ";\n";
     $out .= '</script>';
     // Call the script
     global $wgDevelEnvironment;
     if (!empty($_GET['liftium_dev_hosts']) || !empty($wgLiftiumDevHosts)) {
         $base = "http://nick.dev.liftium.com/";
         $version = '?' . mt_rand();
         $out .= "<script type=\"text/javascript\">var liftium_dev_hosts = 1;</script>";
     } else {
         if ($wgDevelEnvironment) {
             $base = "http://liftium.wikia.com/";
             $version = '?' . mt_rand();
         } else {
             $base = "/__varnish_liftium/";
             $version = "";
         }
     }
     if ($options['kv_skin'] != 'oasis') {
         foreach (AssetsManager::getInstance()->getGroupCommonURL('liftium_ads_js') as $src) {
             $out .= '<script type="text/javascript" src="' . htmlspecialchars($src) . '"></script>' . "\n";
         }
     }
     wfProfileOut(__METHOD__);
     return $out;
 }
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>
Esempio n. 16
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>
Esempio n. 17
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;
         }
     }
 }
Esempio n. 18
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>
<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>
				<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}}" >
Esempio n. 21
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;
}
Esempio n. 22
0
 private function getHub()
 {
     $cat = AdEngine::getCachedCategory();
     return $cat['short'];
 }
Esempio n. 23
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 */ ?>
Esempio n. 24
0
    public static function getLiftiumOptionsScript()
    {
        wfProfileIn(__METHOD__);
        global $wgDBname, $wgTitle, $wgLang;
        // See Liftium.js for documentation on options
        $options = array();
        $options['pubid'] = 999;
        $options['baseUrl'] = '/__varnish_liftium/';
        $options['kv_wgDBname'] = $wgDBname;
        if (is_object($wgTitle)) {
            $options['kv_article_id'] = $wgTitle->getArticleID();
            $options['kv_wpage'] = $wgTitle->getPartialURL();
        }
        $cat = AdEngine::getCachedCategory();
        $options['kv_Hub'] = $cat['name'];
        $options['kv_skin'] = RequestContext::getMain()->getSkin()->getSkinName();
        $options['kv_user_lang'] = $wgLang->getCode();
        $options['kv_cont_lang'] = $GLOBALS['wgLanguageCode'];
        $options['kv_isMainPage'] = WikiaPageType::isMainPage();
        $options['kv_page_type'] = WikiaPageType::getPageType();
        $options['geoUrl'] = "http://geoiplookup.wikia.com/";
        if (!empty($wgDartCustomKeyValues)) {
            $options['kv_dart'] = $wgDartCustomKeyValues;
        }
        $options['kv_domain'] = $_SERVER['HTTP_HOST'];
        $js = "LiftiumOptions = " . json_encode($options) . ";\n";
        if (WikiaPageType::isSearch() || !$wgTitle->getNamespace() == NS_SPECIAL && !BodyController::isEditPage()) {
            $js .= <<<EOT
\t\t\t\tif ( !window.wgLoadAdDriverOnLiftiumInit && ( !window.Wikia.AbTest || !Wikia.AbTest.inTreatmentGroup( "AD_LOAD_TIMING", "ONLOAD" ) ) ) {
\t\t\t\t\tLiftiumOptions['hasMoreCalls'] = true;
\t\t\t\t\tLiftiumOptions['isCalledAfterOnload'] = true;
\t\t\t\t\tLiftiumOptions['maxLoadDelay'] = 6000;
\t\t\t\t}
\t\t\t\telse {
\t\t\t\t\tLiftiumOptions['autoInit'] = false;
\t\t\t\t}
EOT;
        } else {
            $js .= <<<EOT
\t\t\t\tLiftiumOptions['hasMoreCalls'] = true;
\t\t\t\tLiftiumOptions['isCalledAfterOnload'] = true;
\t\t\t\tLiftiumOptions['maxLoadDelay'] = 6000;
EOT;
        }
        $js = AssetsManagerBaseBuilder::minifyJs($js);
        $out = "\n<!-- Liftium options -->\n";
        $out .= Html::inlineScript($js) . "\n";
        wfProfileOut(__METHOD__);
        return $out;
    }
Esempio n. 25
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 ));

	}
Esempio n. 26
0
    protected static function getUrlScript($base_url, $slotname = '', $zone_id = '', $affiliate_id = '', $params = null)
    {
        wfProfileIn(__METHOD__);
        $cat = AdEngine::getCachedCategory();
        $additional_params = "";
        if (!empty($params) && is_array($params)) {
            foreach ($params as $key => $val) {
                $additional_params .= "&" . urlencode($key) . "=" . urlencode($val);
            }
        }
        $adUrlScript = <<<EOT
\tbase_url = AdProviderOpenX.getUrl("{$base_url}", "{$slotname}", "{$zone_id}", "{$affiliate_id}", "{$cat['short']}", "{$additional_params}");
EOT;
        wfProfileOut(__METHOD__);
        return $adUrlScript;
    }
Esempio n. 27
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>