lepragon Posted July 21, 2008 Share Posted July 21, 2008 How can I clone advertisement module? For using double different advertisement module Link to comment Share on other sites More sharing options...
ejectcore Posted July 21, 2008 Share Posted July 21, 2008 All you do is copy the blockadvertising folder & change blockadvertising.phpFor example <?php class BlockAdvertising2 extends Module { function __construct() { $this->name = 'blockadvertising2'; $this->tab = 'Blocks'; $this->version = 0.1; parent::__construct(); // The parent construct is required for translations $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Block advertising 2'); $this->description = $this->l('Adds a block to display advertising'); } function install() { if (!parent::install()) return false; if (!$this->registerHook('rightColumn') OR !$this->registerHook('leftColumn')) return false; return true; } /** * Returns module content * * @param array $params Parameters * @return string Content */ function hookRightColumn($params) { global $smarty; $smarty->assign('image', './modules/'.$this->name.'/advertising.jpg'); return $this->display(__FILE__, 'blockadvertising.tpl'); } function hookLeftColumn($params) { return $this->hookRightColumn($params); } } ?> Link to comment Share on other sites More sharing options...
gothchicz Posted August 3, 2008 Share Posted August 3, 2008 All you do is copy the blockadvertising folder & change blockadvertising.phpFor example <?php class BlockAdvertising2 extends Module { function __construct() { $this->name = 'blockadvertising2'; $this->tab = 'Blocks'; $this->version = 0.1; parent::__construct(); // The parent construct is required for translations $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Block advertising 2'); $this->description = $this->l('Adds a block to display advertising'); } function install() { if (!parent::install()) return false; if (!$this->registerHook('rightColumn') OR !$this->registerHook('leftColumn')) return false; return true; } /** * Returns module content * * @param array $params Parameters * @return string Content */ function hookRightColumn($params) { global $smarty; $smarty->assign('image', './modules/'.$this->name.'/advertising.jpg'); return $this->display(__FILE__, 'blockadvertising.tpl'); } function hookLeftColumn($params) { return $this->hookRightColumn($params); } } ?> and how can we move it to the Left column side? Link to comment Share on other sites More sharing options...
ejectcore Posted August 3, 2008 Share Posted August 3, 2008 It's all in the wikihttp://www.prestashop.com/wiki/Moving_and_Transplanting_Modules/however if this module is to stay on the leftchange: if (!$this->registerHook('rightColumn') OR !$this->registerHook('leftColumn')) to: if (!$this->registerHook('leftColumn')) and then change: function hookLeftColumn($params) { global $smarty; $smarty->assign('image', './modules/'.$this->name.'/advertising.jpg'); return $this->display(__FILE__, 'blockadvertising.tpl'); } removing the additonal function hookLeftColumn($params) Link to comment Share on other sites More sharing options...
gothchicz Posted August 3, 2008 Share Posted August 3, 2008 got it!!SOLVED!!Thanks a bunch!!!^0^ Link to comment Share on other sites More sharing options...
Guest Posted August 11, 2008 Share Posted August 11, 2008 Hi I cant really get this working I created a blockadvertising folder and named it blockadvertising2How do I link to the the new folder from the Back Office???Sif Link to comment Share on other sites More sharing options...
Paul C Posted August 11, 2008 Share Posted August 11, 2008 You need to copy the folder blockadvertising and name the new copyblockadvertising2. Then rename all the files i the new directory from blockadvertising.php etc. to blockadvertising2.php etc.Now you edit these renamed files and replace blockadvertising INSIDE them to blockadvertising2.One you've done these steps you should be able to cick install from within the modules section of admin, and you're done.Paul Link to comment Share on other sites More sharing options...
Guest Posted August 11, 2008 Share Posted August 11, 2008 Cheers Paul It´s workingWarm RegardsSif Link to comment Share on other sites More sharing options...
Julianna Posted August 12, 2008 Share Posted August 12, 2008 Hi. I got the module to work, but now it shows onboth sides (left and right column). Strange. Any way I canremove the advertising from the left? I moved it to displayon the right in the back office, but somehow the left wouldnot disappear?? :-) Thanks so much for any help. Julianna Link to comment Share on other sites More sharing options...
Paul C Posted August 12, 2008 Share Posted August 12, 2008 Yup. Go to Back Office. Hit the Modules Tab. Just under the tabs click Positions. Now you just click the red cross that's next to the one you want to remove.TADA!Paul Link to comment Share on other sites More sharing options...
Julianna Posted August 12, 2008 Share Posted August 12, 2008 Never mind..I did it. :-) I just went to show: blockadvertising2and a duplicate came up...so I just deleted one. Ok..but I have one more quick question if you don't mind. I havean advertisement that is in script form...shown below:[removed] d=document;s=screen;n=navigator; js_ver="1.0"; nn=(n.appName.substring(0,3)=="Mic")?0:1; req="&"+escape(d.referrer)+ "&"+escape([removed].href); [removed][removed] req+="&"+(n.javaEnabled()?1:0); req+="&"+s.width+'x'+s.height+"&"+((nn)?s.pixelDepth:s.colorDepth); [removed] [removed] d.write(""); [removed]Top100biz.com Can this type of advertising be added? I can't figure out where to put this.Thanks so much for your help.Julianna Link to comment Share on other sites More sharing options...
Paul C Posted August 13, 2008 Share Posted August 13, 2008 You could look at using this:http://www.ecartservice.net/05082008/addstuff-for-prestashop/The script goes in the mystuff.html file in the module directory..... Link to comment Share on other sites More sharing options...
siviwe Posted August 11, 2010 Share Posted August 11, 2010 You could look at using this:http://www.ecartservice.net/05082008/addstuff-for-prestashop/The script goes in the mystuff.html file in the module directory..... Link to comment Share on other sites More sharing options...
tamarillojohn Posted August 13, 2010 Share Posted August 13, 2010 Juliana/Gothchiz - you can also use the "Free Block" module in the "Third Party Modules" section as well. In there you can just hit the "html" tab on the editor and copy and paste your code into there.Another alternative is to use CMS under the "tools" tab in admin and refer back to the page created either using the Links Block or the horizontal menu module.I have used both of these instead of the advertising block as they give more versitility, for examples of both in operation see my site. The competition on the left side with the facebook code is done using the "free Block" module and the "Competition" link in the top horizontal menu is made using CMS.http://www.leathergoods.co.nzAny further info, just ask...Oh and the competition entry form was made using Coffecup Flash Form Builder (there are a number of free versions of this hanging around in computer magazines and web design magazines) Link to comment Share on other sites More sharing options...
Pippo3000 Posted November 2, 2010 Share Posted November 2, 2010 Any further info, just ask... yes, please. copied the freeblock and all works fine, it sits under the regular freeblock on the left side. however, freeblock1 is centered and the new one not, i.e. it is little bit left from block1? where can I find the information that freeblock2 is not centered on the left column and what do I need to do to correct this?phil Link to comment Share on other sites More sharing options...
mildsevenipoiss Posted September 14, 2015 Share Posted September 14, 2015 Hi guys. I recently did same thing, I made 4 clones from Blockadverising module, everything worked. But, I have problems with cache or smth. Some time modules shows same pictures and links. Everytime when I need to change like Blockadverting3 module, then changes appear every module. And at moment, when I sign in with user account, then I see all same pictures. I named that modules: blockadvertising blockadvertising2 blockadvertising3 blockadvertising4 blockadevrtising5 Maybe someone had same issue? And how I need figure out? I will try to find this problem at tonight, but perhaps some presta user knows solutions.. Link to comment Share on other sites More sharing options...
Recommended Posts