Jump to content
Sign in to follow this  

[SOLUTIE] cum putem avea mai multe reclame cu modulul advertising

Recommended Posts

Pentru a avea mai multe reclame pe siteul PS se poate duplica modul advertising.

1. copiati continutul modului advertising intr-un folder nou advertising2 tot in aceiasi locatie modules.
2. redenumiti fisierul blockadvertising.php in blockadvertising2.php
3. editati blockadvertising2.php astfel:


class BlockAdvertising2 extends Module
   function __construct()
       $this->name = 'blockadvertising2';
       $this->tab = 'Blocks';
       $this->version = 0.1;


       $this->displayName = $this->l('Block advertising2');
       $this->description = $this->l('Adds a block to display an 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, $protocol_content, $server_host;

       $smarty->assign('image', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/advertising.gif');
       return $this->display(__FILE__, 'blockadvertising.tpl');

   function hookLeftColumn($params)
       return $this->hookRightColumn($params);



4. pune reclama ta in locul fisierului advertising.jpg
5. din administrare - modules - instalati noul modul creat si apoi mutati-l intrun container

idee duplicarii se poate folosi si pentru alte module trebuie doar sa sesizati diferentele si sa faceti modificarile corespunzatoare.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More