// 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:
mMarinetti
2011-12-05 09:37:36 +00:00
parent 1cce2fd6cb
commit 863ea0d354
3 changed files with 30 additions and 19 deletions
+12
View File
@@ -1642,3 +1642,15 @@ CREATE TABLE `PREFIX_favorite_product` (
PRIMARY KEY (`id_favorite_product`))
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;
+2 -5
View File
@@ -16,8 +16,8 @@
position: relative;
top: -1px;
padding:0 5px;
height:20px;
width:145px;
height:21px;
width:150px;
border:1px solid #ccc;
border-right:none;
-moz-border-radius-topleft: 3px;
@@ -32,9 +32,6 @@
*:first-child+html #newsletter_block_left input.inputNew {position:static;}/* hack ie 7 */
#newsletter_block_left input.button_mini {
position:relative;
left:-2px;
width: 24px;
height:23px;
width:24px;
border:0;
+16 -14
View File
@@ -68,7 +68,7 @@ class Blocknewsletter extends Module
Configuration::updateValue('NW_SALT', Tools::passwdGen(16));
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_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/');
}
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'))
{
$this->newsletterRegistration();
if ($this->error)
{
$this->context->smarty->assign(array('color' => 'red',
'msg' => $this->error,
'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false,
'nw_error' => true,
'action' => $_POST['action']));
$this->smarty->assign(array('color' => 'red',
'msg' => $this->error,
'nw_value' => isset($_POST['email']) ? pSQL($_POST['email']) : false,
'nw_error' => true,
'action' => $_POST['action'])
);
}
else if ($this->valid)
{
$this->context->smarty->assign(array('color' => 'green',
'msg' => $this->valid,
'nw_error' => false));
$this->smarty->assign(array('color' => 'green',
'msg' => $this->valid,
'nw_error' => false)
);
}
}
$this->context->smarty->assign('this_path', $this->_path);
$this->smarty->assign('this_path', $this->_path);
return $this->display(__FILE__, 'blocknewsletter.tpl');
}
public function hookDisplayHeader($params)
{
$this->context->controller->addCSS(($this->_path).'blocknewsletter.css', 'all');
$this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all');
}
}