Merge branch 'ticket-15629-new-landing' into develop
# Conflicts: # modules/invite/invite.php
This commit is contained in:
commit
89bc626e0c
@ -1131,7 +1131,7 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
|
||||
public function hookCreateAccountForm($params)
|
||||
{
|
||||
global $smarty, $site_version_front;
|
||||
|
||||
|
||||
if ($firstname = Tools::getValue('firstname')) {
|
||||
$_POST['firstname'] = $firstname;
|
||||
}
|
||||
@ -1149,9 +1149,9 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
|
||||
} else {
|
||||
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
|
||||
}
|
||||
|
||||
|
||||
$customer = new Customer();
|
||||
|
||||
|
||||
$explodeResult = explode('|', $cipherTool->decrypt(rawurldecode(Tools::getValue('sponsor'))));
|
||||
if ($explodeResult && count($explodeResult) > 1) {
|
||||
list($id_invite, $email) = $explodeResult;
|
||||
@ -1197,7 +1197,7 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Cookie
|
||||
$referal_email = '';
|
||||
$cName = '4598484FDSFDSREFERAL8849FDS';
|
||||
@ -1206,15 +1206,16 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor=
|
||||
} elseif (isset($_COOKIE[$cName])) {
|
||||
$referal_email = base64_decode($_COOKIE[$cName]);
|
||||
}
|
||||
|
||||
$smarty->assign('sponsor_email', $referal_email);
|
||||
|
||||
// Init cookie
|
||||
if ($_COOKIE[$cName] != base64_encode($referal_email)) {
|
||||
unset($_COOKIE[$cName]);
|
||||
}
|
||||
setcookie($cName, base64_encode($referal_email), time() + 3600 * 24, '/', 'bebeboutik.com');
|
||||
|
||||
$smarty_value = $smarty->get_template_vars('sponsor_email');
|
||||
if($smarty_value === null && $referal_email !== '') { //we prevent overwrite
|
||||
$smarty->assign('sponsor_email', $referal_email);
|
||||
}
|
||||
|
||||
return $this->display(__FILE__, 'authentication.tpl');
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,8 @@ class AdminLandingPages extends AdminTab {
|
||||
"'.pSQL(Tools::str2url($name)).'",
|
||||
"'.pSQL(Tools::getValue('text1')).'",
|
||||
"'.pSQL(Tools::getValue('text2')).'",
|
||||
"'.pSQL(Tools::getValue('tag')).'"
|
||||
"'.pSQL(Tools::getValue('tag')).'",
|
||||
"'.pSQL(Tools::getValue('parrain_email')).'"
|
||||
)
|
||||
');
|
||||
|
||||
@ -81,7 +82,8 @@ class AdminLandingPages extends AdminTab {
|
||||
`name` = "'.pSQL(Tools::str2url($name)).'",
|
||||
`text1` = "'.pSQL(Tools::getValue('text1')).'",
|
||||
`text2` = "'.pSQL(Tools::getValue('text2')).'",
|
||||
`tag` = "'.pSQL(Tools::getValue('tag'), true).'"
|
||||
`tag` = "'.pSQL(Tools::getValue('tag'), true).'",
|
||||
`parrain` = "'.pSQL(Tools::getValue('parrain_email'), true).'"
|
||||
WHERE `id_landing_page` = '.$id_landing_page.'
|
||||
');
|
||||
|
||||
@ -327,6 +329,13 @@ class AdminLandingPages extends AdminTab {
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
echo '<label>'.$this->l('Email Parrain :').'</label>
|
||||
<div class="margin-form">
|
||||
<div id="enabled" style="float: left;">
|
||||
<input name="parrain_email" type="text" value="'.($this->curlp? $this->curlp['parrain']: '').'" />
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>';
|
||||
|
||||
echo '<label>'.$this->l('Tag :').'</label>
|
||||
<div class="margin-form">
|
||||
|
@ -72,9 +72,11 @@ class LandingPages extends Module {
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`text1` VARCHAR(255) NOT NULL,
|
||||
`text2` VARCHAR(255) NOT NULL,
|
||||
`parrain` VARCHAR(255) NULL,
|
||||
PRIMARY KEY(`id_landing_page`)
|
||||
) ENGINE=MyIsam DEFAULT CHARSET=utf8
|
||||
';
|
||||
//ALTER TABLE ps_landing_page ADD parrain VARCHAR(255) NULL;
|
||||
if(!Db::getInstance()->Execute($query)) {
|
||||
return FALSE;
|
||||
}
|
||||
@ -191,6 +193,7 @@ class LandingPages extends Module {
|
||||
$id_landing_page = 0;
|
||||
$lp_text1 = '';
|
||||
$lp_text2 = '';
|
||||
$email_parrain = '';
|
||||
|
||||
if($name = Tools::getValue('lp')) {
|
||||
if($landing = Db::getInstance()->getRow('
|
||||
@ -203,10 +206,18 @@ class LandingPages extends Module {
|
||||
$lp_text1 = $landing['text1'];
|
||||
$lp_text2 = $landing['text2'];
|
||||
$tag = $landing['tag'];
|
||||
$email_parrain = $landing['parrain'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($id_landing_page > 0) {
|
||||
if ($email_parrain !== '') {
|
||||
if($smarty->get_template_vars('sponsor_email') === null){ //we prevent overwrite
|
||||
$smarty->assign(array(
|
||||
'sponsor_email' => $email_parrain
|
||||
));
|
||||
}
|
||||
}
|
||||
if (_PS_MOBILE_) {
|
||||
if (file_exists(_PS_ROOT_DIR_ . '/modules/landingpages/img/' . $id_landing_page . '_2_' . $cookie->id_lang . '.jpg')) {
|
||||
$smarty->assign(array(
|
||||
|
@ -399,7 +399,14 @@ $(function(){ldelim}
|
||||
</p>
|
||||
</fieldset>
|
||||
{$HOOK_CREATE_ACCOUNT_FORM}
|
||||
|
||||
{*MODULE invite / landingpage / referalprogram *}
|
||||
<fieldset class="account_creation" {if isset($sponsor_email)} style="display:none;" {/if}>
|
||||
<p>
|
||||
<label for="referralprogram">{l s='E-mail address of your sponsor' mod='invite'}</label>
|
||||
<input type="text" size="52" maxlength="128" class="text" id="referralprogram" name="invite" value="{if isset($sponsor_email)}{$sponsor_email|escape:'htmlall':'UTF-8'}{elseif isset($smarty.post.invite)}{$smarty.post.invite|escape:'htmlall':'UTF-8'}{elseif isset($referralprogram)}{$referralprogram|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</p>
|
||||
</fieldset>
|
||||
{*END MODULE invite / landingpage / referalprogram *}
|
||||
<script type="text/javascript">
|
||||
/* ANTADIS */
|
||||
var input = document.getElementById("referralprogram");
|
||||
|
@ -1,7 +1 @@
|
||||
<fieldset class="account_creation" {if isset($sponsor_email)} style="display:none;" {/if}>
|
||||
<p>
|
||||
<label for="referralprogram">{l s='E-mail address of your sponsor' mod='invite'}</label>
|
||||
<input type="text" size="52" maxlength="128" class="text" id="referralprogram" name="invite" value="{if isset($sponsor_email)}{$sponsor_email|escape:'htmlall':'UTF-8'}{elseif isset($smarty.post.invite)}{$smarty.post.invite|escape:'htmlall':'UTF-8'}{elseif isset($referralprogram)}{$referralprogram|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</p>
|
||||
</fieldset>
|
||||
{if isset($tag_auth)}{$tag_auth}{/if}
|
||||
|
@ -93,44 +93,6 @@ $(function(){ldelim}
|
||||
{/if}
|
||||
</script>
|
||||
|
||||
{if $id_lp == NULL}
|
||||
<script type="text/javascript" src="{$js_dir}jquery-ui.min.js"></script>
|
||||
<script type="text/javascript">{literal}
|
||||
<!--
|
||||
$(document).ready(function() {
|
||||
var img_list = [{/literal}"{$img_dir}auth.jpg", "{$img_dir}auth2.jpg", "{$img_dir}auth3.jpg"{literal}];
|
||||
|
||||
var preload = new Array();
|
||||
for(var i=0; i<img_list.length; i++) {
|
||||
preload[i] = new Image();
|
||||
preload[i].src = img_list[i];
|
||||
}
|
||||
|
||||
$("#columns").css("background", "none");
|
||||
|
||||
for(var i=0; i<img_list.length; i++) {
|
||||
$("<div id=\"bg_" + i + "\" class=\"background\" style=\"background : #333333 url('"+ img_list[i] +"') no-repeat left top; z-index: " + (-1 - i) + "; display: none;\" />").appendTo($("#columns"));
|
||||
}
|
||||
|
||||
var current_bg = 0;
|
||||
$("#columns > #bg_0").show();
|
||||
|
||||
function rotateBackground(index) {
|
||||
if(index && index > img_list.length) {
|
||||
index = false;
|
||||
}
|
||||
|
||||
$("#columns > #bg_" + current_bg).fadeOut(600);
|
||||
$("#columns > #bg_" + (index? index - 1: (current_bg == img_list.length - 1? 0: current_bg + 1))).fadeIn(600);
|
||||
|
||||
index? current_bg = (index - 1 < 0? img_list.length - 1: index - 1): (current_bg == img_list.length - 1? current_bg = 0: current_bg++);
|
||||
}
|
||||
|
||||
var timer = setInterval(function() { rotateBackground(); }, 10000);
|
||||
});
|
||||
-->
|
||||
{/literal}</script>
|
||||
{/if}
|
||||
|
||||
{*<h1>{if !isset($email_create)}{l s='Log in'}{else}{l s='Create your account'}{/if}</h1>
|
||||
{assign var='current_step' value='login'}
|
||||
@ -435,7 +397,14 @@ $(document).ready(function() {
|
||||
</p>
|
||||
</fieldset>
|
||||
{$HOOK_CREATE_ACCOUNT_FORM}
|
||||
<fieldset>
|
||||
{*MODULE invite / landingpage / referalprogram *}
|
||||
<fieldset class="account_creation" {if isset($sponsor_email)} style="display:none;" {/if}>
|
||||
<p class="text">
|
||||
<input placeholder="{l s='E-mail address of your sponsor' mod='invite'}" type="text" size="52" maxlength="128" class="text" id="referralprogram" name="invite" value="{if isset($sponsor_email)}{$sponsor_email|escape:'htmlall':'UTF-8'}{elseif isset($smarty.post.invite)}{$smarty.post.invite|escape:'htmlall':'UTF-8'}{elseif isset($referralprogram)}{$referralprogram|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</p>
|
||||
</fieldset>
|
||||
{*END MODULE invite / landingpage / referalprogram *}
|
||||
<fieldset>
|
||||
{if isset($newsletter) && $newsletter}
|
||||
<p class="checkbox" >
|
||||
<span class="input">
|
||||
|
@ -2176,7 +2176,6 @@ body#product #primary_block #more_info_block {
|
||||
padding:0px 0px 20px 0px;
|
||||
font-size:12px;
|
||||
}
|
||||
body#authentication #columns .content #center_column #account-creation_form h3,
|
||||
body#password #columns .content #center_column h3,
|
||||
body#order-follow #columns .content #center_column h1,
|
||||
body#module-advsendtoafriend-sendtoafriend-form #columns .content #center_column h1{
|
||||
@ -2184,13 +2183,12 @@ body#module-advsendtoafriend-sendtoafriend-form #columns .content #center_column
|
||||
text-align:right;
|
||||
padding-right:7px;
|
||||
}
|
||||
|
||||
body#authentication #columns .content #center_column #account-creation_form h3 span,
|
||||
body#password #columns .content #center_column h3 span,
|
||||
body#order-follow #columns .content #center_column h1 span,
|
||||
body#module-advsendtoafriend-sendtoafriend-form #columns .content #center_column h1 span{
|
||||
float:left;
|
||||
}
|
||||
|
||||
body#order-follow #columns .content #center_column > p/*,
|
||||
/*body#history #columns .content #center_column > p*/{
|
||||
display:none;
|
||||
|
@ -1,7 +1 @@
|
||||
<fieldset class="account_creation" {if isset($sponsor_email)} style="display:none;" {/if}>
|
||||
<p class="text">
|
||||
{*<label for="referralprogram">{l s='E-mail address of your sponsor' mod='invite'}</label>*}
|
||||
<input placeholder="{l s='E-mail address of your sponsor' mod='invite'}" type="text" size="52" maxlength="128" class="text" id="referralprogram" name="invite" value="{if isset($sponsor_email)}{$sponsor_email|escape:'htmlall':'UTF-8'}{elseif isset($smarty.post.invite)}{$smarty.post.invite|escape:'htmlall':'UTF-8'}{elseif isset($referralprogram)}{$referralprogram|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</p>
|
||||
</fieldset>
|
||||
{if isset($tag_auth)}{$tag_auth}{/if}
|
@ -1,22 +1,40 @@
|
||||
<style type="text/css">
|
||||
{if $landing}
|
||||
body#authentication {
|
||||
background-image: url("{$base_dir_ssl}modules/landingpages/img/{$id_lp}_1_{$cookie->id_lang}.jpg") !important;
|
||||
background-position: center 99px;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
@media screen and (max-width:767px){
|
||||
body#authentication {
|
||||
background-image: none !important;
|
||||
}
|
||||
}
|
||||
<style type="text/css">
|
||||
body#authentication .insert_top_account_creation {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body#authentication .insert_top_account_creation img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
body#authentication span.subtitle_create_account {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body#authentication #columns .content #center_column #account-creation_form h3{
|
||||
display: none;
|
||||
}
|
||||
|
||||
body#authentication div.paiement_logo_block a.payment{
|
||||
display: none;
|
||||
}
|
||||
|
||||
{*TODO*}
|
||||
{/if}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
{literal}
|
||||
$(document).ready(function () {
|
||||
$('#columns').before('<div class="insert_top_account_creation">' +
|
||||
'<img src="{/literal}{$base_dir_ssl}modules/landingpages/img/{$id_lp}_2_{$cookie->id_lang}.jpg{literal}">' +
|
||||
'</div>');
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
{/if}
|
||||
<div class="hidden" style="display: none !important;">
|
||||
<input type="hidden" name="lp" value="{$smarty.request.lp|escape:'htmlall':'UTF-8'}" />
|
||||
{if isset($tag)}
|
||||
{$tag}
|
||||
{/if}
|
||||
<input type="hidden" name="lp" value="{$smarty.request.lp|escape:'htmlall':'UTF-8'}"/>
|
||||
{if isset($tag)}
|
||||
{$tag}
|
||||
{/if}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user