thelphite Posted August 16, 2012 Share Posted August 16, 2012 Hi, I've this error message : Parse error: syntax error, unexpected '?' in /home/amscaaf/translate/classes/Module.php(587) : eval()'d code on line 1. followed by : The following module(s) couldn't be loaded: blockpaymentinfo (parse error in /modules/blockpaymentinfo/blockpaymentinfo.php) blockpaymentinfo (class missing in /modules/blockpaymentinfo/blockpaymentinfo.php) THIS IS MY SOURCE CODE : <?php if (!defined('_PS_VERSION_')) exit; class BlockPaymentInfo extends Module { function __construct() { $this->name = 'blockpaymentinfo'; $this->tab = 'test'; $this->version = 1.0; $this->author = 'Gilbert Franz'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l( 'Block Payment Info' ); $this->description = $this->l( 'Few words about how to paye products.' ); $this->text = 'test du jour'; $this->titre = 'le titre du test'; } public function install() { if (parent::install() == false OR !$this->registerHook('leftColumn')OR !$this->registerHook('home')) return false; return true; } public function uninstall() { if (!parent::uninstall()) Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'blockpaymentinfo`'); parent::uninstall(); } public function hookLeftColumn($params) { global $smarty; $smarty->assign(array( 'text' => $this->text, 'titre' => $this->titre; )); return $this->display(__FILE__, $this->name.'.tpl'); } public function hookHome($params) { global $smarty; $smarty->assign(array( 'text' => $this->text, 'titre' => $this->titre;)); return $this->display(__FILE__, $this->name.'.tpl'); } public function hookRightColumn($params) { return $this->hookLeftColumn($params); } public function hookleftColumn($params) { return $this->hookHome($params); } } ?> 1 Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 16, 2012 Share Posted August 16, 2012 I'm not actually sure. I think it may be a good idea to call your hosting provider and ask them to increase your memory limit. Sometimes that can solve the problem for modules not being able to load. It could very well be something entirely different but thats worth a try! Link to comment Share on other sites More sharing options...
thelphite Posted August 17, 2012 Author Share Posted August 17, 2012 Ok. Link to comment Share on other sites More sharing options...
razaro Posted August 17, 2012 Share Posted August 17, 2012 Parse error usually means you have some extra character like semicolon or some bracket . In your case error is in 'titre' => $this->titre; and it appears twice. 1 Link to comment Share on other sites More sharing options...
thelphite Posted August 21, 2012 Author Share Posted August 21, 2012 Hello razaro, I just can't understand, I've changed my source code thought : <?php if (!defined('_PS_VERSION_')) exit; class BlockPaymentInfo extends Module { function __construct() { $this->name = 'blockpaymentinfo'; $this->tab = 'front_office_features'; $this->version = 1.0; $this->author = 'Gilbert franz'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Block Payment Info'); $this->description = $this->l('Few words about how to paye products.'); } public function install() { return (parent::install() AND $this->registerHook('footer')); } public function hookFooter($params) { global $smarty; $smarty->assign(array( 'text'=> 'TEXT', 'titre'=> 'TITRE')); return $this->display(__FILE__, 'blockpaymentinfo.tpl'); } public function hookFooter($params) { return $this->hookleftColumn($params); } } ?> Link to comment Share on other sites More sharing options...
razaro Posted August 21, 2012 Share Posted August 21, 2012 Didn't saw this before but you declared hookFooter function twice. Here is code that works. <?php if (!defined('_PS_VERSION_')) exit; class BlockPaymentInfo extends Module { function __construct() { $this->name = 'blockpaymentinfo'; $this->tab = 'front_office_features'; $this->version = 1.0; $this->author = 'Gilbert franz'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Block Payment Info'); $this->description = $this->l('Few words about how to paye products.'); } public function install() { return (parent::install() AND $this->registerHook('footer')); } public function hookFooter($params) { global $smarty; $smarty->assign(array( 'text'=> 'TEXT', 'titre'=> 'TITRE') ); return $this->display(__FILE__, 'blockpaymentinfo.tpl'); } public function hookLeftColumn($params) { return $this->hookFooter($params); } } ?> Link to comment Share on other sites More sharing options...
thelphite Posted August 21, 2012 Author Share Posted August 21, 2012 it's not worked for me. Link to comment Share on other sites More sharing options...
Recommended Posts