Deelight Posted March 5, 2012 Share Posted March 5, 2012 Bonjour. Je ne trouve pas où modifier le lien de l'image sur le module Header logo? Par défaut, le lien de l'image redirige vers un produit, mais je voudrais qu'il redirige vers la page d'accueil. C'est ici : http://www.aucoeur2.com/aucoeur2bois/ Merci Link to comment Share on other sites More sharing options...
luci1 Posted March 6, 2012 Share Posted March 6, 2012 Bonjour, Je ne trouve pas ce module dans le listing par défaut, aurais-tu un lien vers ce module pour qu'on puisse voir le code de celui-ci ? Link to comment Share on other sites More sharing options...
Deelight Posted March 16, 2012 Author Share Posted March 16, 2012 Justement, je ne trouve pas le code de ce module.... Link to comment Share on other sites More sharing options...
crackpsx Posted March 16, 2012 Share Posted March 16, 2012 regarde dans module si tu a pas blockheaderlogos c'est celui la Link to comment Share on other sites More sharing options...
Deelight Posted March 16, 2012 Author Share Posted March 16, 2012 J'ai bien trouvé un module blockheaderlogo, mais impossible de truveer la ligne de code qui correspond à la redirection. Copie du code PHP if (!defined('_CAN_LOAD_FILES_')) exit; class BlockHeaderLogos extends Module { protected $maxImageSize = 307200; public function __construct() { $this->name = 'blockheaderlogos'; $this->tab = 'front_office_features'; $this->version = 1.0; parent::__construct(); $this->displayName = $this->l('Header logos'); $this->description = ''; } public function install() { if (!Configuration::get('BHL_HOMEPAGE_LOGO_HEIGHT')) Configuration::updateValue('BHL_HOMEPAGE_LOGO_HEIGHT', 71); if (!Configuration::get('BHL_HOMEPAGE_LOGO_WIDTH')) Configuration::updateValue('BHL_HOMEPAGE_LOGO_WIDTH', 215); if (!Configuration::get('BHL_HOMEPAGE_LOGO')) Configuration::updateValue('BHL_HOMEPAGE_LOGO', 'v2-logo.png'); if (!Configuration::get('BHL_HOMEPAGE_AD_HEIGHT')) Configuration::updateValue('BHL_HOMEPAGE_AD_HEIGHT', 60); if (!Configuration::get('BHL_HOMEPAGE_AD_WIDTH')) Configuration::updateValue('BHL_HOMEPAGE_AD_WIDTH', 468); if (!Configuration::get('BHL_HOMEPAGE_AD')) Configuration::updateValue('BHL_HOMEPAGE_AD', 'v2-headerpub-en.gif'); return (parent::install() AND $this->registerHook('top')); } public function getContent() { if (Tools::isSubmit('submitUpdate')) { if (isset($_FILES['BHL_HOMEPAGE_LOGO']) AND isset($_FILES['BHL_HOMEPAGE_LOGO']['tmp_name']) AND !empty($_FILES['BHL_HOMEPAGE_LOGO']['tmp_name'])) if (checkImage($_FILES['BHL_HOMEPAGE_LOGO'], $this->maxImageSize) == false) if (move_uploaded_file($_FILES['BHL_HOMEPAGE_LOGO']['tmp_name'], dirname(__FILE__).'/'.$_FILES['BHL_HOMEPAGE_LOGO']['name'])) Configuration::updateValue('BHL_HOMEPAGE_LOGO', $_FILES['BHL_HOMEPAGE_LOGO']['name']); if (isset($_FILES['BHL_HOMEPAGE_AD']) AND isset($_FILES['BHL_HOMEPAGE_AD']['tmp_name']) AND !empty($_FILES['BHL_HOMEPAGE_AD']['tmp_name'])) if (checkImage($_FILES['BHL_HOMEPAGE_AD'], $this->maxImageSize) == false) if (move_uploaded_file($_FILES['BHL_HOMEPAGE_AD']['tmp_name'], dirname(__FILE__).'/'.$_FILES['BHL_HOMEPAGE_AD']['name'])) Configuration::updateValue('BHL_HOMEPAGE_AD', $_FILES['BHL_HOMEPAGE_AD']['name']); if (Configuration::get('BHL_HOMEPAGE_LOGO') AND file_exists(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_LOGO'))) { list($width, $height, $type, $attr) = getimagesize(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_LOGO')); Configuration::updateValue('BHL_HOMEPAGE_LOGO_WIDTH', (int)round($width)); Configuration::updateValue('BHL_HOMEPAGE_LOGO_HEIGHT', (int)round($height)); } if (Configuration::get('BHL_HOMEPAGE_AD') AND file_exists(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_AD'))) { list($width, $height, $type, $attr) = getimagesize(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_AD')); Configuration::updateValue('BHL_HOMEPAGE_AD_WIDTH', (int)round($width)); Configuration::updateValue('BHL_HOMEPAGE_AD_HEIGHT', (int)round($height)); } echo $this->displayConfirmation($this->l('Images updated successfully')); } $html = ' <form method="post" action="'.htmlentities($_SERVER['REQUEST_URI']).'" enctype="multipart/form-data"> <fieldset><legend>'.$this->displayName.'</legend> <label>'.$this->l('Homepage logo').'</label> <div class="margin-form">'; if (Configuration::get('BHL_HOMEPAGE_LOGO') AND file_exists(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_LOGO'))) $html .= '<div id="image" > <img src="'.$this->_path.Configuration::get('BHL_HOMEPAGE_LOGO').'?t='.time().'" /> <p align="center">'.$this->l('Filesize').' '.(filesize(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_LOGO')) / 1000).'kb</p> <a href="'.htmlentities($_SERVER['REQUEST_URI']).'&deleteHomepageLogo"> <img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /> '.$this->l('Delete').' </a> </div>'; $html .= '<input type="file" name="BHL_HOMEPAGE_LOGO" /> <p style="clear: both">'.$this->l('Will appear on the top left of your shop').'</p> </div> <div class="clear"> </div> <label>'.$this->l('Homepage ad').'</label> <div class="margin-form">'; if (Configuration::get('BHL_HOMEPAGE_AD') AND file_exists(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_AD'))) $html .= '<div id="image" > <img src="'.$this->_path.Configuration::get('BHL_HOMEPAGE_AD').'?t='.time().'" /> <p align="center">'.$this->l('Filesize').' '.(filesize(dirname(__FILE__).'/'.Configuration::get('BHL_HOMEPAGE_AD')) / 1000).'kb</p> <a href="'.htmlentities($_SERVER['REQUEST_URI']).'&deleteHomepageAd"> <img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /> '.$this->l('Delete').' </a> </div>'; $html .= '<input type="file" name="BHL_HOMEPAGE_AD" /> <p style="clear: both">'.$this->l('Will appear on the top right of your shop').'</p> </div> <div class="clear"></div> <div class="margin-form clear"><input type="submit" name="submitUpdate" value="'.$this->l('Update images').'" class="button" /></div> </fieldset> </form>'; return $html; } public function hookTop($params) { global $smarty; $smarty->assign(array( 'BHL_HOMEPAGE_LOGO' => __PS_BASE_URI__.'modules/'.$this->name.'/'.Configuration::get('BHL_HOMEPAGE_LOGO'), 'BHL_HOMEPAGE_LOGO_WIDTH' => (int)Configuration::get('BHL_HOMEPAGE_LOGO_WIDTH'), 'BHL_HOMEPAGE_LOGO_HEIGHT' => (int)Configuration::get('BHL_HOMEPAGE_LOGO_HEIGHT'), 'BHL_HOMEPAGE_AD' => __PS_BASE_URI__.'modules/'.$this->name.'/'.Configuration::get('BHL_HOMEPAGE_AD'), 'BHL_HOMEPAGE_AD_WIDTH' => (int)Configuration::get('BHL_HOMEPAGE_AD_WIDTH'), 'BHL_HOMEPAGE_AD_HEIGHT' => (int)Configuration::get('BHL_HOMEPAGE_AD_HEIGHT') )); return $this->display(__FILE__, 'blockheaderlogos.tpl'); } } et du TPL <div class="v2-headermargin"> <a href="{$base_dir}" style="float:left;display:block"> <img class="logo" src="{$BHL_HOMEPAGE_LOGO}" alt="{$shop_name|escape:'htmlall':'UTF-8'}" width="{$BHL_HOMEPAGE_LOGO_WIDTH}" height="{$BHL_HOMEPAGE_LOGO_HEIGHT}" /> </a> <a href="{$base_dir}product.php?id_product=10" style="float:right;display:block;margin:10px 40px 0 0"> <img class="logo" src="{$BHL_HOMEPAGE_AD}" alt="" width="{$BHL_HOMEPAGE_AD_WIDTH}" height="{$BHL_HOMEPAGE_AD_HEIGHT}" /> </a> <div class="flatclear"> </div> </div> <div class="flatclear"> </div> Link to comment Share on other sites More sharing options...
crackpsx Posted March 16, 2012 Share Posted March 16, 2012 J'ai bien trouvé un module blockheaderlogo, mais impossible de truveer la ligne de code qui correspond à la redirection. <a href="{$base_dir}product.php?id_product=10" style="float:right;display:block;margin:10px 40px 0 0"> Link to comment Share on other sites More sharing options...
Deelight Posted March 16, 2012 Author Share Posted March 16, 2012 Ok, merci. Je viens de changer cette ligne... mais je dois mal m'y prendre. <a href="{$base_dir}" style="float:right;display:block;margin:10px 40px 0 0"> cela ne fonctionne pas? Link to comment Share on other sites More sharing options...
crackpsx Posted March 16, 2012 Share Posted March 16, 2012 <a href="{$base_dir}index.php" style="float:right;display:block;margin:10px 40px 0 0"> Link to comment Share on other sites More sharing options...
Deelight Posted March 16, 2012 Author Share Posted March 16, 2012 Désolé, mais l'image pointe toujours vers ce produit.... product 10 http://www.aucoeur2.com/aucoeur2bois/ J'ai modifié le fichier tpl, puis transféré via filezila, mais la modif ne semble pas être faite au bon endroit. Link to comment Share on other sites More sharing options...
crackpsx Posted March 16, 2012 Share Posted March 16, 2012 fait voir ton fichier tpl ? Link to comment Share on other sites More sharing options...
Deelight Posted March 16, 2012 Author Share Posted March 16, 2012 <div class="v2-headermargin"> <a href="{$base_dir}" style="float:left;display:block"> <img class="logo" src="{$BHL_HOMEPAGE_LOGO}" alt="{$shop_name|escape:'htmlall':'UTF-8'}" width="{$BHL_HOMEPAGE_LOGO_WIDTH}" height="{$BHL_HOMEPAGE_LOGO_HEIGHT}" /> </a> <a href="{$base_dir}index.php" style="float:right;display:block;margin:10px 40px 0 0"> <img class="logo" src="{$BHL_HOMEPAGE_AD}" alt="" width="{$BHL_HOMEPAGE_AD_WIDTH}" height="{$BHL_HOMEPAGE_AD_HEIGHT}" /> </a> <div class="flatclear"> </div> </div> <div class="flatclear"> </div> Link to comment Share on other sites More sharing options...
ZenGraph Posted March 16, 2012 Share Posted March 16, 2012 est-ce que tu as forcé la compilation de smarty et désactiver le cache pour activer tes modifications du tpl ? Link to comment Share on other sites More sharing options...
Deelight Posted March 16, 2012 Author Share Posted March 16, 2012 heuu, non... sorry, je ne sais pas comment faire. Il me semblait bien que je tentais de faire des modifs dans le vide Link to comment Share on other sites More sharing options...
crackpsx Posted March 16, 2012 Share Posted March 16, 2012 je viens de l'installé et ca marche tres bien , comme le dit ZenGraph force la compilation de smarty et ca marche Link to comment Share on other sites More sharing options...
crackpsx Posted March 16, 2012 Share Posted March 16, 2012 dans onglet Performances >>Forcer la compilation Link to comment Share on other sites More sharing options...
Deelight Posted March 16, 2012 Author Share Posted March 16, 2012 yep, merci beaucoup, cela fonctionne ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now