praegune kellaaeg 26.06.2025 08:47:41
|
Hinnavaatlus
:: Foorum
:: Uudised
:: Ärifoorumid
:: HV F1 ennustusvõistlus
:: Pangalink
:: Telekavad
:: HV toote otsing
|
|
autor |
|
danny
Kreisi kasutaja

liitunud: 17.01.2006
|
10.12.2009 16:08:31
Palun abi prestashopi mooduli koodi muutmisel. |
|
|
Nii, oleks vaja veidi abi ühe mooduli koodis, ehk siis reklaami moodul mis lisab prestashopile reklaami.
Allpool toodud kood lisab reklaami vasakule ja paremale, aga sama reklaami, peale pikka pusimist ei saanud ma eraldada seda rightcolumn ja leftcolumni.
Oleks siis vaja nii, et antud koodiga saaks lisada kahte erinevat bannerit.
<?php
class BlockAdvertising extends Module
{
function __construct()
{
$this->name = 'blockadvertising';
$this->tab = 'Blocks';
$this->version = 0.1;
parent::__construct();
$this->displayName = $this->l('Block advertising');
$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.jpg');
return $this->display(__FILE__, 'blockadvertising.tpl');
}
function hookLeftColumn($params)
{
return $this->hookRightColumn($params);
}
}
?> |
Näide praegusel kujul asub siin: http://www.ricky.pri.ee/prestashop/
Tänan abi eest.
|
|
Kommentaarid: 49 loe/lisa |
Kasutajad arvavad: |
   |
:: |
0 :: |
0 :: |
42 |
|
tagasi üles |
|
 |
Renka
HV Guru

liitunud: 01.04.2002
|
10.12.2009 17:37:50
Re: Palun abi prestashopi mooduli koodi muutmisel. |
|
|
php:
|
<?php class BlockAdvertising extends Module { function __construct() { $this->name = 'blockadvertising'; $this->tab = 'Blocks'; $this->version = 0.1; parent::__construct(); $this->displayName = $this->l('Block advertising'); $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.jpg'); return $this->display(__FILE__, 'blockadvertising.tpl'); } function hookLeftColumn($params) { global $smarty, $protocol_content, $server_host; $smarty->assign('image', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/advertising_left.jpg'); return $this->display(__FILE__, 'blockadvertising.tpl'); } } ?>
|
_________________ There is no place like 127.0.0.1 |
|
Kommentaarid: 71 loe/lisa |
Kasutajad arvavad: |
   |
:: |
2 :: |
1 :: |
61 |
|
tagasi üles |
|
 |
danny
Kreisi kasutaja

liitunud: 17.01.2006
|
10.12.2009 18:08:10
|
|
|
Tänud Renka ise proovisin umbes samamoodi, aga reklaami asemel näitas ainult tühja kasti.
|
|
Kommentaarid: 49 loe/lisa |
Kasutajad arvavad: |
   |
:: |
0 :: |
0 :: |
42 |
|
tagasi üles |
|
 |
|
lisa lemmikuks |
|
|
sa ei või postitada uusi teemasid siia foorumisse sa ei või vastata selle foorumi teemadele sa ei või muuta oma postitusi selles foorumis sa ei või kustutada oma postitusi selles foorumis sa ei või vastata küsitlustele selles foorumis sa ei saa lisada manuseid selles foorumis sa võid manuseid alla laadida selles foorumis
|
|
Hinnavaatlus ei vastuta foorumis tehtud postituste eest.
|