diff --git a/install-dev/sql/db_settings_extends.sql b/install-dev/sql/db_settings_extends.sql index 74d2e1931..966d3b30e 100644 --- a/install-dev/sql/db_settings_extends.sql +++ b/install-dev/sql/db_settings_extends.sql @@ -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; + diff --git a/modules/blocknewsletter/blocknewsletter.css b/modules/blocknewsletter/blocknewsletter.css index 790fcd5ec..04bed840f 100644 --- a/modules/blocknewsletter/blocknewsletter.css +++ b/modules/blocknewsletter/blocknewsletter.css @@ -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; diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index 3f8a16c85..4150ee290 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -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'); } }