Sei un webmaster ? Gestisci siti per i tuoi clienti ? Ti servono servizi affidabili per te ed i tuoi clienti ? Stiamo preparando una serie di servizi pensati proprio per gente come te, contatta contatta MAXsos per maggiori informazioni www.maxsos.com
Nota: Per cortesia non postate lo stesso messaggio in diversi forum. Tutto lo staff di MAXdev e gli iscritti di questa comunità sono qui per aiutarvi e per condividere le proprie esperienze in questi forum, ma prendete l'abitudine di usare la ricerca prima di postare.
Oggetto: Vuoi far apparire banner di formato diverso su Opencommerce?
Ho modificato il mio Opencommerce in modo che possa fare vedere banner in foindo alla pagina anche se di formato differente del solito 468x50
Bisogna fare alcune modifiche a due file. Ecco come fare, spero siano utili a qualcuno
*****
Modifiche apportate a opencommercio2.2rc2a
***File footer.php ***
riga 31
da :if ($banner = tep_banner_exists('dynamic', '468X50') ) {
a :if ($banner = tep_banner_exists('dynamic', 'all') ) {
Questo gestisce il banner che si vede in fondo alla pagina.
Nella versione originale si potevono vedere solo i banner 468x50 adesso si possono vedere anche altri formati
però bisogna cambiare anche il file:
includes/functions/banner.php (vedi note a parte)
N.B. Bisogna scrivere 'all' tutto minuscolo o tutto maiuscolo 'ALL' (lo capirai dopo perchè!!!)
**** FINE MODIFICHE file footer.php ***
***File includes/functions/banner.php
circa riga 96 function tep_banner_exists($action, $identifier) {
Originale :
if ($action == 'dynamic') {
return tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
} elseif ($action == 'static') {
$banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");
return tep_db_fetch_array($banner_query);
} else {
return false;
}
}
Qui si può optare per una delle due modifiche :
1)Si inserisce manualmente nel file le dimensioni del banner nuovo ( es.191x50) che si vogliomo mostrare e si procede a cambiare lo script così:
if ($action == 'dynamic') { if($identifier=='all' or $identifier=='ALL'){ $where="status = '1' and banners_group ='191X60' or status = '1' and banners_group ='468x50'";}else { $where="status = '1' and banners_group ='$identifier'";}
return tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where $where");
} elseif ($action == 'static') {
$banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");
return tep_db_fetch_array($banner_query);
} else {
return false;
}
}
N.B. in questo caso solo quando ci sono banner 191X60 o 468x50 vengono mostrate.
Se successivamente inserisci anche altri banner ipotizziamo di dimensione 100x100 dovrai manualmente modificare il file
da : { $where="status = '1' and banners_group ='191X60' or status = '1' and banners_group ='468x50'";}
a : { $where="status = '1' and banners_group ='191X60' or status = '1' and banners_group ='468x50' or status ='1' and banners_group ='100x100'";}
**************
2) Si permette di cercare automaticamente i formati che sono presenti nella tabella banners .Bisogna cambiare lo script così:
if ($action == 'dynamic') { if($identifier=='all' or $identifier=='ALL'){
$query=mysql_query("select distinct banners_group from banners where status='1' and banners_group!=''");
while(list($b)=mysql_fetch_array($query))
{$return.="status='1' and banners_group='$b' or ";
}
$where=substr($return,0,-3);
}
else { $where="status = '1' and banners_group ='$identifier'";}
return tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where $where");
} elseif ($action == 'static') {
$banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int)$identifier . "'");
return tep_db_fetch_array($banner_query);
} else {
return false;
}
}
Se ci fossere altri sistemi più semplici fatemelo sapere
Grazie
Franco
Bonzo Moderatore
Registrato: 08 Set 2004
Messaggi: 654
Località: Arezzo | Roma | Pescara
Status: Offline
 Inviato:
21 Giu 2008 - 16:26
@ franco1706
Grazie per la tua segnalazione.
Questo significa open source!!
Spero che possa essere preso come esempio anche da altri utenti...;-)
Un saluto
_________________ Matteo Carletti (Bonzo)
Se vuoi allungare la vita dei Moderatori allora LEGGI IL REGOLAMENTO DEL FORUM. Non abbandoniamo i Moderatori a loro stessi. I Moderatori aiutano la società e anche tu puoi dare una mano per supportarli nel loro compito: con solo 2 minuti puoi leggere il REGOLAMENTO DEL FORUM e fare molto per i Moderatori!
Affidare la tua immagine o l'immagine della tua ditta a servizi scadenti da 20 Euro annuali ? Ma ne vale la pena ? La vostra immagine vale veramente cosi poco ? MAXsos per l'hosting professionale, MDLite per liberare la tua fantasia sul web, il tutto facile da usare e con risultato immediato. www.maxsos.com