示例#1
0
 protected function setVariableValues() {
     $this->setVariable(self::AFF_NAME, trim($this->user->getFirstName()) . ' ' . trim($this->user->getLastName()));
     $this->setVariable(self::AFF_REFID, trim($this->user->getRefId()));
     $this->setVariable(self::AFF_EMAIL, trim($this->user->getEmail()));
     $this->setVariable(self::AFF_IP, Gpf_Http::getRemoteIp());
     
     $this->setVariable(AutoResponsePlus_Config::NAME, $this->getSettingForSubject(AutoResponsePlus_Config::NAME));
     $this->setVariable(AutoResponsePlus_Config::PASSWORD, $this->getSettingForSubject(AutoResponsePlus_Config::PASSWORD));
     $this->setVariable(AutoResponsePlus_Config::AUTORESPONDER_ADDRESS, $this->getSettingForSubject(AutoResponsePlus_Config::AUTORESPONDER_ADDRESS));
     $this->setVariable(AutoResponsePlus_Config::HTML, (Gpf_Settings::get(AutoResponsePlus_Config::HTML) == Gpf::YES ? 'html' : 'plain'));
     $this->setVariable(AutoResponsePlus_Config::TRACKING_TAB, $this->getSettingForSubject(AutoResponsePlus_Config::TRACKING_TAB));
     $this->setVariable(AutoResponsePlus_Config::DROP_RULES, (Gpf_Settings::get(AutoResponsePlus_Config::DROP_RULES) == Gpf::YES ? 'yes' : 'no'));
 }
示例#2
0
 /**
  * @param Pap_Common_User $user
  * @return string
  */
 public function getDescription(Pap_Common_User $user) {
     if ($user->getType() == Pap_Application::ROLETYPE_MERCHANT) {
         $description = $this->get(Pap_Db_Table_Banners::DATA1);
     } else {
         $description = $this->get(Pap_Db_Table_Banners::DATA2);
     }
     
     $description = str_replace('$Affiliate_id', $user->getId(), $description);
     $description = str_replace('$Affiliate_refid', $user->getRefId(), $description);
     $description = str_replace('$Affiliate_name', $user->getName(), $description);
     $description = str_replace('$Affiliate_username', $user->getUserName(), $description);
     
     return $description;
 }
 public function getSrcCode(Pap_Common_Banner $banner, Pap_Common_User $user, Pap_Db_Channel $channel = null, $data1 = '', $data2 = ''){
     $code = $this->getScriptUrl("imp.php");
     $code .= "?".Pap_Tracking_Request::getAffiliateClickParamName()."=".$user->getRefId();
     $code .= "&".Pap_Tracking_Request::getBannerClickParamName()."=".$banner->getId();
     if ($banner->getParentBannerId() != null) {
         $code .= "&".Pap_Tracking_Request::getRotatorBannerParamName()."=".$banner->getParentBannerId();
     }
     if($channel != null && is_object($channel)) {
         $code .= "&".Pap_Tracking_Request::getChannelParamName()."=".$channel->getValue();
     }
     if($data1 != '') {
         $code .= "&".Pap_Tracking_Request::getExtraDataParamName(1)."=".$data1;
     }
     if($data2 != '') {
         $code .= "&".Pap_Tracking_Request::getExtraDataParamName(2)."=".$data2;
     }
     
     return $code;
 }
示例#4
0
 public function getHtaccessCode(Pap_Common_User $user = null) {
     $code  = '# Start Post Affiliate Site Replication Code'."\n";
     $code .= 'RewriteEngine on'."\n\n";
     if ($user == null) {
         $code .= 'RewriteCond %{REQUEST_FILENAME} !-d'."\n";
         $code .= 'RewriteCond %{REQUEST_FILENAME} !-f'."\n";
         $code .= 'RewriteRule ^([^/]+)/(.*) '.Gpf_Paths::getInstance()->getFullScriptsUrl().'page.php?a_aid=$1&a_bid='.$this->getId().'&a_file=$2 [L,P,QSA]'."\n";
         $code .= "\n";
         $code .= 'RewriteCond %{REQUEST_FILENAME} !-d'."\n";
         $code .= 'RewriteCond %{REQUEST_FILENAME} !-f'."\n";
         $code .= 'RewriteRule ^([^/]+) '.Gpf_Paths::getInstance()->getFullScriptsUrl().'page.php?a_aid=$1&a_bid='.$this->getId().'&a_redir=Y [L,P,QSA]'."\n";
     } else {
         $code .= 'RewriteCond %{REQUEST_FILENAME} !-d'."\n";
         $code .= 'RewriteCond %{REQUEST_FILENAME} !-f'."\n";
         $code .= 'RewriteRule ^(.*) '.Gpf_Paths::getInstance()->getFullScriptsUrl().'page.php?a_aid='.$user->getRefId().'&a_bid='.$this->getId().'&a_file=$1 [P,QSA]'."\n";
     }
     $code .= "\n";
     $code .= '# End of Post Affiliate Site Replication Code'."\n";
     return $code;
 }
    public function getUserFieldValue($code) {
        if($this->user == null) {
            throw new Gpf_Exception("You have to set User before getting user fields value!");
        }

        if($code == 'refid') {
            return $this->user->getRefId();
        } else if($code == 'firstname') {
            return $this->user->getFirstName();
        } else if($code == 'lastname') {
            return $this->user->getLastName();
        } else if($code == 'password') {
            return $this->user->getPassword();
        } else if($code == 'username') {
            return $this->user->getUserName();
        } else if($this->isCountryCode($code)){
            return $this->getCountryName($this->user->get($code));
        }
        try {
            return $this->user->get($code);
        } catch (Gpf_Exception $e) {
        }
        return '';
    }
示例#6
0
 public function getBannerScriptUrl(Pap_Common_User $user)
 {
     return Pap_Tracking_BannerViewer::getBannerScriptUrl($user->getRefId(), $this->getId(), $this->getChannelId(), $this->getParentBannerId());
 }
    /**
     * @return String seo style click url
     */
    public function getModRewriteClickUrl(Pap_Common_Banner $banner = null,
                                           Pap_Common_User $user,
                                           $specialDesturl = '',
                                           Pap_Db_Channel $channel = null,
                                           $siteUrl = null) {

       	$prefix = Gpf_Settings::get(Pap_Settings::MOD_REWRITE_PREFIX_SETTING_NAME);
        $separator = Gpf_Settings::get(Pap_Settings::MOD_REWRITE_SEPARATOR_SETTING_NAME);
        $suffix = Gpf_Settings::get(Pap_Settings::MOD_REWRITE_SUFIX_SETTING_NAME);
        if ($siteUrl === null) {
            $siteUrl = Gpf_Settings::get(Pap_Settings::MAIN_SITE_URL);
        }

        if($siteUrl[strlen($siteUrl)-1] != '/') {
            $siteUrl .= '/';
        }
        $clickUrl = $siteUrl;
        $clickUrl .= $prefix.$user->getRefId();
        if ($banner != null) {
            $clickUrl .= $separator.$banner->getId();
        }
        if($channel != null && is_object($channel)) {
            $clickUrl .= $separator.$channel->getValue();
        }

        $clickUrl .= $suffix;

        return $clickUrl;
    }