From d868d563f5f32acdecd208628e8e8e469e7ea95d Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Tue, 18 Jul 2017 09:56:24 +0200 Subject: [PATCH] start of tracking tag --- modules/invite/sponsor.php | 64 +++++++++++++++++----------- modules/landingpages/home_footer.tpl | 8 ++++ 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/modules/invite/sponsor.php b/modules/invite/sponsor.php index ecb86f36..05cdebe5 100644 --- a/modules/invite/sponsor.php +++ b/modules/invite/sponsor.php @@ -4,35 +4,47 @@ include(dirname(__FILE__).'/../../init.php'); if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) { - setcookie('554b43403edef30d31412286d5098965', $sponsor, time() + 3600 * 24 * 365, '/', '.bebeboutik.com'); + setcookie('554b43403edef30d31412286d5098965', $sponsor, time() + 3600 * 24 * 365, '/', '.bebeboutik.com'); - $email = base64_decode(strrev(substr($sponsor, 12))); - if(count(Db::getInstance()->ExecuteS(' - SELECT `id_customer` - FROM `'._DB_PREFIX_.'customer` - WHERE `email` = "'.pSQL($email).'" - ')) > 0) { - if(Configuration::get('PS_CIPHER_ALGORITHM')) { - $cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); - } else { - $cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); - } + $email = base64_decode(strrev(substr($sponsor, 12))); + if(count(Db::getInstance()->ExecuteS(' + SELECT `id_customer` + FROM `'._DB_PREFIX_.'customer` + WHERE `email` = "'.pSQL($email).'" + ')) > 0) { + if(Configuration::get('PS_CIPHER_ALGORITHM')) { + $cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + } else { + $cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); + } - $url = parse_url($_SERVER['REQUEST_URI']); - $gclid = Tools::getIsset('gclid')?'&gclid='.Tools::getValue('gclid'):''; - if(Tools::getIsset('lpes')) { - $lp = Tools::getValue('lpes'); - if( _THEME_NAME_ !== 'site_mobile') { - Tools::redirect('?sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($lp)? '&lpes='.$lp: '').$gclid); - } - } + $url = parse_url($_SERVER['REQUEST_URI']); + $gclid = Tools::getIsset('gclid')?'&gclid='.Tools::getValue('gclid'):''; + if(Tools::getIsset('lpes')) { + $lp = Tools::getValue('lpes'); + if( _THEME_NAME_ !== 'site_mobile') { + Tools::redirect('?sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($lp)? '&lpes='.$lp: '').$gclid); + } + } - if(Tools::getIsset('lp')) { - $lp = Tools::getValue('lp'); - } - Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: '').$gclid); - // Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '')); - } + if(Tools::getIsset('lp')) { + $lp = Tools::getValue('lp'); + } + + if(!class_exists('AntTrackingTag')){ + include_once(_PS_MODULE_DIR_.'/ant_trackingtag/models/AntTrackingTag.php'); + } + $tags = AntTrackingTag::getTags(); + $url_tag =''; + foreach ($tags as $tag) { + if(Tools::getIsset($tag['tag'])) { + $value = Tools::getValue($tag['tag']); + $url_tag .='&'.$tag['tag'].'='.$value; + } + } + Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: '').$url_tag.$gclid); + // Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '')); + } } Tools::redirect(); diff --git a/modules/landingpages/home_footer.tpl b/modules/landingpages/home_footer.tpl index 3c000f08..040b8d89 100644 --- a/modules/landingpages/home_footer.tpl +++ b/modules/landingpages/home_footer.tpl @@ -40,6 +40,14 @@ }); + +
{if isset($newsletter) && $newsletter}