private function checkBanner(Pap_Contexts_Tracking $context, Pap_Common_Banner $banner) { if ($this->isAccountRecognizedNotFromDefault($context) && $banner->getAccountId() != $context->getAccountId()) { $context->debug("Banner with Id: ".$banner->getId()." and name '".$banner->getName()."' cannot be used with accountId: '". $context->getAccountId() ."'!"); throw new Gpf_Exception("Banner is from differen account"); } if (!is_null($context->getCampaignObject()) && $context->getCampaignObject()->getId() != $banner->getCampaignId()) { $context->debug("Banner with Id: ".$banner->getId()." cannot be used (it is from different campaign as recognized campaign)!"); throw new Gpf_Exception("Banner is from different campaign as recognized campaign!"); } }
public function getBannerInWrapper($bannercode, Pap_Common_Banner $banner, Pap_Common_User $user){ $wrapper = new Pap_Db_BannerWrapper(); $wrapper->setId($banner->getWrapperId()); $wrapper->load(); $code = $wrapper->getCode(); $code = $this->replaceConstant(self::CONST_WIDTH, $banner->getWidth(), $code); $code = $this->replaceConstant(self::CONST_HEIGHT, $banner->getHeight(), $code); $code = $this->replaceConstant(self::CONST_HTML, $bannercode, $code); $code = $this->replaceConstant(self::CONST_NAME, $banner->getName(), $code); $code = $this->replaceConstant(self::CONST_BANNERID, $banner->getId(), $code); $completeUrl = $banner->getBannerScriptUrl($user) . '&' . self::URL_PARAM_WRAPPER . '=' . self::URL_VALUE_INNERPAGE; if($banner->getDynamicLink() != '') { $completeUrl .= '&'. Pap_Db_Table_CachedBanners::DYNAMIC_LINK . '=' . urlencode($banner->getDynamicLink()); } $code = $this->replaceConstant(self::CONST_HTMLCOMPL, $completeUrl, $code); $code = $this->replaceConstant(self::CONST_HTMLCOMPL_ENCODED, urlencode($completeUrl), $code); $code = $this->replaceConstant(self::CONST_HTMLCLEAN, $banner->getBannerScriptUrl($user) . '&' . self::URL_PARAM_WRAPPER . '=' . self::URL_VALUE_CLEAN, $code); $code = $this->replaceConstant(self::CONST_CLICKURL, $banner->getClickUrl($user), $code); $code = $this->replaceConstant(self::CONST_TARGETURL, $banner->getDestinationUrl($user), $code); $code = $this->replaceConstant(self::CONST_HTMLJSURL, $banner->getBannerScriptUrl($user), $code); $code = $this->replaceConstant(self::CONST_SEOSTRING, $banner->getSeoString(), $code); return Pap_Common_Banner::cleanIncompleteCode($code); }