Example #1
0
$twig->addGlobal("image_item", $imageServer . "Type/");
$twig->addGlobal("image_ship", $imageServer . "Render/");
$twig->addGlobal("siteurl", $baseAddr);
$twig->addGlobal("fullsiteurl", $fullAddr);
$twig->addGlobal("requesturi", $_SERVER["REQUEST_URI"]);
$twig->addGlobal("topad", zKillboard::top());
$twig->addGlobal("bottomad", zKillboard::bottom());
$twig->addGlobal("mobiletopad", zKillboard::mobileTop());
$twig->addGlobal("mobilebottomad", zKillboard::mobileBottom());
$twig->addGlobal("igbtopad", zKillboard::igbTop());
$twig->addGlobal("igbbottomad", zKillboard::igbBottom());
$twig->addGlobal("analytics", zKillboard::analytics());
$twig->addGlobal("disqusLoad", $disqus);
if ($disqus) {
    $twig->addGlobal("disqusShortName", $disqusShortName);
    $twig->addglobal("disqus", Disqus::init());
}
$detect = new Mobile_Detect();
$twig->addGlobal("isMobile", $detect->isMobile() ? true : false);
$twig->addGlobal("isTablet", $detect->isTablet() ? true : false);
$twig->addExtension(new UserGlobals());
$twig->addFunction(new Twig_SimpleFunction("pageTimer", "Util::pageTimer"));
$twig->addFunction(new Twig_SimpleFunction("queryCount", "Db::getQueryCount"));
$twig->addFunction(new Twig_SimpleFunction("isActive", "Util::isActive"));
$twig->addFunction(new Twig_SimpleFunction("firstUpper", "Util::firstUpper"));
$twig->addFunction(new Twig_SimpleFunction("pluralize", "Util::pluralize"));
$twig->addFunction(new Twig_SimpleFunction("calcX", "Util::calcX"));
$twig->addFunction(new Twig_SimpleFunction("calcY", "Util::calcY"));
$twig->addFunction(new Twig_SimpleFunction("formatIsk", "Util::formatIsk"));
$twig->addFunction(new Twig_SimpleFunction("shortNum", "Util::formatIsk"));
$twig->addFunction(new Twig_SimpleFunction("shortString", "Util::shortString"));
Example #2
0
$twig->addGlobal('igbtopad', Google::ad($topCaPub, $topAdSlot, $adWidth = 728, $adHeight = 90));
$twig->addGlobal('igbbottomad', Google::ad($bottomCaPub, $bottomAdSlot, $adWidth = 728, $adHeight = 90));
$twig->addGlobal('analytics', Google::analytics($analyticsID, $analyticsName));
$disqus &= UserConfig::get('showDisqus', true);
$twig->addGlobal('disqusLoad', $disqus);
$noAdPages = array('/account/', '/moderator/', '/ticket', '/register/', '/information/', '/login');
foreach ($noAdPages as $noAdPage) {
    $showAds &= !Util::startsWith($uri, $noAdPage);
    $showAds &= $userShowAds;
}
$twig->addglobal('showAnalytics', $showAnalytics);
if ($disqus) {
    $twig->addGlobal('disqusShortName', $disqusShortName);
}
if ($disqusSSO) {
    $twig->addglobal('disqusSSO', Disqus::init());
}
// User's account balance
$twig->addGlobal('accountBalance', $accountBalance);
$twig->addGlobal('adFreeMonthCost', $adFreeMonthCost);
// Display a banner?
$banner = false;
// Db::queryField('select banner from zz_subdomains where (subdomain = :server or alias = :server)', 'banner', array(':server' => $_SERVER['SERVER_NAME']), 60);
if ($banner) {
    $banner = str_replace('http://i.imgur.com/', 'https://i.imgur.com/', $banner);
    $banner = str_replace('http://imgur.com/', 'https://imgur.com/', $banner);
    //$twig->addGlobal("headerImage", $banner);
}
$twig->addGlobal('showAds', $userShowAds);
$_SERVER['SERVER_NAME'] = 'zkillboard.com';
//Subdomains::getSubdomainParameters($_SERVER['SERVER_NAME']);
Example #3
0
 /**
  * Generate the module
  */
 protected function compile()
 {
     $this->Template->buffer = \Disqus::generateComments($this->disqus_shortname, $this->disqus_identifier);
 }