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; }
} } } require_once 'bootstrap.php'; @include_once('../include/Compiled/Core.php'); Gpf_Session::create(new Pap_Tracking_ModuleBase(), null, false); $banner = new Pap_Common_Banner(); $user = new Pap_Affiliates_User(); $userId = @$_GET[$settings->get('param_name_user_id')]; try { $user = $user->loadFromId($userId); $destUrl = $banner->replaceUserConstants($destUrl, $user, 'Y'); } catch (Gpf_Exception $e) { $destUrl = $banner->removeUserConstants($destUrl, 'Y'); } $clickFieldsValues = array(); $clickFieldsValues['chan'] = @$_GET['chan']; $clickFieldsValues['extra_data1'] = @$_GET[$settings->get('param_name_extra_data1')]; $clickFieldsValues['extra_data2'] = @$_GET[$settings->get('param_name_extra_data2')]; $destUrl = $banner->replaceClickConstants($destUrl, $clickFieldsValues); @header('Location: ' . $destUrl, true, 301); $getParams = '?'; foreach ($_GET as $name => $value) { $getParams .= $name.'='.urlencode($value).'&'; }