Beispiel #1
0
<?php
/**
 * Banner preview for affiliate
 */

require_once 'bootstrap.php';

Gpf_Session::create(new Pap_Tracking_ModuleBase());
$bannerViewer = new Pap_Tracking_BannerViewer();
echo $bannerViewer->previewHover();

?>
Beispiel #2
0
 public function getBannerScriptUrl(Pap_Common_User $user)
 {
     return Pap_Tracking_BannerViewer::getBannerScriptUrl($user->getRefId(), $this->getId(), $this->getChannelId(), $this->getParentBannerId());
 }
 public function fillCachedBanner(Pap_Db_CachedBanner $cachedBanner, Pap_Common_User $user) {
     $this->parseRotatorBannerDescription();
     $bannerIdToShow = $this->getBannerIdToShow();
     foreach ($this->rotatedBanners as $row) {
         $bannerId = $row->get(Pap_Db_Table_BannersInRotators::ROTATED_BANNER_ID);
         $rank = $row->get(Pap_Db_Table_BannersInRotators::RANK);
         $banner = $this->bannerFactory->getBanner($bannerId);
         $banner->setParentBannerId($this->getId());
         $this->setBannerChannel($banner, $cachedBanner->getChannel());
         if ($bannerIdToShow == $bannerId) {
             $cachedBanner->setCode($banner->getCompleteCode($user, ''));
             $cachedBanner->setRank($rank);
             $cachedBanner->setValidFrom($row->get(Pap_Db_Table_BannersInRotators::VALID_FROM));
             $cachedBanner->setValidUntil($row->get(Pap_Db_Table_BannersInRotators::VALID_UNTIL));
             continue;
         }
         $rotCachedBanner = clone $cachedBanner;
         $rotCachedBanner->setValidFrom($row->get(Pap_Db_Table_BannersInRotators::VALID_FROM));
         $rotCachedBanner->setValidUntil($row->get(Pap_Db_Table_BannersInRotators::VALID_UNTIL));
         $rotCachedBanner->setCode($banner->getCompleteCode($user, ''));
         Pap_Tracking_BannerViewer::addJavascriptCode($rotCachedBanner);
         $rotCachedBanner->setRank($rank);
         try {
             $rotCachedBanner->save();
         } catch (Gpf_DbEngine_Row_ConstraintException $e) {
             // cached banner was saved already by other script
         }
     }
 }
Beispiel #4
0
<?php
/**
 * Hover banner
 */

require_once 'bootstrap.php';

Gpf_Session::create(new Pap_Tracking_ModuleBase());
$bannerViewer = new Pap_Tracking_BannerViewer();
echo $bannerViewer->showHover();

?>
Beispiel #5
0
<?php
require_once 'lib/fast_init.php';
require_once 'lib/banner_viewer.php';

$settings = new Lib_SettingFile();
$settings->load();

$bannerViewer = new Lib_BannerViewer($settings);

if ($bannerViewer->displayBanner()) {
    exit;
}

require_once 'bootstrap.php';
@include_once('../include/Compiled/Core.php');
@include_once('../include/Compiled/Banner.php');

Gpf_Session::create(new Pap_Tracking_ModuleBase(), null, false);
$bannerViewerNormal = new Pap_Tracking_BannerViewer();

$cachedBanner = new Pap_Db_CachedBanner();
foreach ($bannerViewer->getBannerParams() as $key => $value) {
    $cachedBanner->set($key, $value);
}
$bannerViewerNormal->show($cachedBanner);

?>
Beispiel #6
0
 public function getPreview(Pap_Common_User $user) {
     return '<iframe src="'.
     Pap_Tracking_BannerViewer::getBannerScriptUrl('preview',$this->getId(),$this->getChannelId(),$this->getParentBannerId())
     .'" width = "'.($this->getWidth()+15).'" height= "'.($this->getHeight()+15).'" frameborder=0></iframe>';
 }