private function getDestinationUrl(Pap_Common_Banner $banner = null, $specialDestinationUrl = '', Pap_Common_User $user = null) { if ($specialDestinationUrl != '') { return $specialDestinationUrl; } if ($banner != null) { return $banner->getDestinationUrl($user); } return Gpf_Settings::get(Pap_Settings::MAIN_SITE_URL); }
private function replaceVariables($affiliate, Pap_Common_Banner $banner, $channelcode, $content) { $this->userFields->setUser($affiliate); $content = $this->userFields->replaceUserConstantsInText($content); if ($channelcode == null) { $channelcode = ''; } $content = Pap_Common_UserFields::replaceCustomConstantInText(Pap_Features_ZipBanner_UserFields::CHANNELID,$channelcode,$content); $content = $banner->replaceBannerConstants($content, $affiliate); $content = $banner->replaceUserConstants($content, $affiliate); $content = $banner->replaceUrlConstants($content, $affiliate, null, $banner->getDestinationUrl()); return $content; }
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); }