// module newsletter hook fix + added create table in db_settings_extends.sql
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10896 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
1cce2fd6cb
commit
863ea0d354
3 files changed
+30
-19
No files matched your search
@@ -1642,3 +1642,15 @@ CREATE TABLE `PREFIX_favorite_product` (
|
|||||||
PRIMARY KEY (`id_favorite_product`))
|
PRIMARY KEY (`id_favorite_product`))
|
||||||
ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `PREFIX_newsletter` (
|
||||||
|
`id` int(6) NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_shop` INTEGER UNSIGNED NOT NULL DEFAULT 1,
|
||||||
|
`id_group_shop` INTEGER UNSIGNED NOT NULL DEFAULT 1,
|
||||||
|
`email` varchar(255) NOT NULL,
|
||||||
|
`newsletter_date_add` DATETIME NULL,
|
||||||
|
`ip_registration_newsletter` varchar(15) NOT NULL,
|
||||||
|
`http_referer` VARCHAR(255) NULL,
|
||||||
|
`active` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
|
PRIMARY KEY(`id`)
|
||||||
|
) ENGINE=ENGINE_TYPE default CHARSET=utf8;
|
||||||
|
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
top: -1px;
|
top: -1px;
|
||||||
padding:0 5px;
|
padding:0 5px;
|
||||||
height:20px;
|
height:21px;
|
||||||
width:145px;
|
width:150px;
|
||||||
border:1px solid #ccc;
|
border:1px solid #ccc;
|
||||||
border-right:none;
|
border-right:none;
|
||||||
-moz-border-radius-topleft: 3px;
|
-moz-border-radius-topleft: 3px;
|
||||||
@@ -32,9 +32,6 @@
|
|||||||
*:first-child+html #newsletter_block_left input.inputNew {position:static;}/* hack ie 7 */
|
*:first-child+html #newsletter_block_left input.inputNew {position:static;}/* hack ie 7 */
|
||||||
|
|
||||||
#newsletter_block_left input.button_mini {
|
#newsletter_block_left input.button_mini {
|
||||||
position:relative;
|
|
||||||
left:-2px;
|
|
||||||
width: 24px;
|
|
||||||
height:23px;
|
height:23px;
|
||||||
width:24px;
|
width:24px;
|
||||||
border:0;
|
border:0;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Blocknewsletter extends Module
|
|||||||
Configuration::updateValue('NW_SALT', Tools::passwdGen(16));
|
Configuration::updateValue('NW_SALT', Tools::passwdGen(16));
|
||||||
|
|
||||||
return Db::getInstance()->execute('
|
return Db::getInstance()->execute('
|
||||||
CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'newsletter (
|
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'newsletter` (
|
||||||
`id` int(6) NOT NULL AUTO_INCREMENT,
|
`id` int(6) NOT NULL AUTO_INCREMENT,
|
||||||
`id_shop` INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
|
`id_shop` INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
|
||||||
`id_group_shop` INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
|
`id_group_shop` INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
|
||||||
@@ -454,38 +454,40 @@ class Blocknewsletter extends Module
|
|||||||
return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification'), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
|
return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification'), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookRightColumn($params)
|
public function hookDisplayRightColumn($params)
|
||||||
{
|
{
|
||||||
return $this->hookLeftColumn($params);
|
return $this->hookDisplayLeftColumn($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookLeftColumn($params)
|
public function hookDisplayLeftColumn($params)
|
||||||
{
|
{
|
||||||
if (Tools::isSubmit('submitNewsletter'))
|
if (Tools::isSubmit('submitNewsletter'))
|
||||||
{
|
{
|
||||||
$this->newsletterRegistration();
|
$this->newsletterRegistration();
|
||||||
if ($this->error)
|
if ($this->error)
|
||||||
{
|
{
|
||||||
$this->context->smarty->assign(array('color' => 'red',
|
$this->smarty->assign(array('color' => 'red',
|
||||||
'msg' => $this->error,
|
'msg' => $this->error,
|
||||||
'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false,
|
'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false,
|
||||||
'nw_error' => true,
|
'nw_error' => true,
|
||||||
'action' => $_POST['action']));
|
'action' => $_POST['action'])
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else if ($this->valid)
|
else if ($this->valid)
|
||||||
{
|
{
|
||||||
$this->context->smarty->assign(array('color' => 'green',
|
$this->smarty->assign(array('color' => 'green',
|
||||||
'msg' => $this->valid,
|
'msg' => $this->valid,
|
||||||
'nw_error' => false));
|
'nw_error' => false)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->context->smarty->assign('this_path', $this->_path);
|
$this->smarty->assign('this_path', $this->_path);
|
||||||
return $this->display(__FILE__, 'blocknewsletter.tpl');
|
return $this->display(__FILE__, 'blocknewsletter.tpl');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hookDisplayHeader($params)
|
public function hookDisplayHeader($params)
|
||||||
{
|
{
|
||||||
$this->context->controller->addCSS(($this->_path).'blocknewsletter.css', 'all');
|
$this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user