name = 'productcomments'; $this->tab = 'Products'; $this->version = '0.2'; parent::__construct(); $this->displayName = $this->l('Product Comments'); $this->description = $this->l('Allow users to post comment about a product'); } function install() { if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) return (false); else if (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) return (false); $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql); $sql = preg_split("/;\s*[\r\n]+/",$sql); foreach ($sql as $query) if (!Db::getInstance()->Execute(trim($query))) return (false); if (parent::install() == false OR $this->registerHook('productTab') == false OR $this->registerHook('productTabContent') == false OR $this->registerHook('header') == false OR Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1) == false) return (false); return (true); } public function getContent() { $this->_html = '
'.$this->l('Settings updated').'
'.$this->l('Settings updated').'
'.$this->l('Settings updated').'