Grazie a tutti<?php
/*
$Id: manbox.php,v 1.19 2003/06/09 22:17:13 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
Module created by Sergyo(SL-Lab.ru)
*/
?>
<tr align=center>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_COLUMN_BANNER);
new infoBoxHeading($info_box_contents, true, true);
$info_box_contents = array();
$fullstring = '<table width=100% border=0 cellpadding=0 cellspacing=3><tr>';
$row=0;
$manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_image not like '' order by manufacturers_name" );
if (tep_db_num_rows($manufacturers_query) >= '1') {
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
$row++;
$fullstring .= '<td align=center valign=middle class=smallText>';
$fullstring .= '<a href=' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'] , 'NONSSL', false) . '>';
if ($manufacturers['manufacturers_image']) {
$fullstring .= '<img src='. DIR_WS_IMAGES . $manufacturers['manufacturers_image'] . ' width=100 height=57 border=0> ';
} else {
$fullstring .= '<a href=' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id'], 'NONSSL', false) . '>'. $manufacturers['manufacturers_name'];
}
$fullstring .= '</a>';
$fullstring .= '</td>';
if ((($row / 1) == (double)floor($row / 1))) {
$fullstring .='<tr>';
}
}
}
$fullstring .= '</td></tr></table>';
$info_box_contents = array();
$info_box_contents[] = array('text' => $fullstring);
//echo $fullstring;
new infoBox($info_box_contents);
?>
</td>
</tr>
Ordine (sort) Marchi prodotti
Moderatore: mod Generali
Ordine (sort) Marchi prodotti
Salve...ho installato la contribution "Manufacturers logos box" per far apparire in un box alcuni dei marchi. Volevo sapere come fare per farli apparire in modo casuale (sort) ogni refresh di pagina... e non in ordine alfabetico....qui sotto il codice della pagina:
Re: Ordine (sort) Marchi prodotti
prova a sostituire:
order by manufacturers_name
con
order by rand()
xiao
order by manufacturers_name
con
order by rand()
xiao
ATTENZIONE: Questi non sono cambiamenti banali. C'è un sacco di codice qui
) bene bravo bis!!:)

Re: Ordine (sort) Marchi prodotti
grazieeee mille....

scusa un'altra domanda...per far apparire un certo numero di marchi mettendo un limite??
Grazie ancora


scusa un'altra domanda...per far apparire un certo numero di marchi mettendo un limite??
Grazie ancora
Re: Ordine (sort) Marchi prodotti
bisogna modificare la query per far apparire solo i marchi interessati, però non so come si fa 
edit:
sono alle prese con un problema simile però nella vetrina e più mirato (solo alcuni prodotti), prova a vedere se questo può tornarti ultile:
http://www.mysqlitalia.it/wiki/Limitare ... tore_LIMIT
forse basta aggiungere limit x alla fine della query, se poi inserisci i marchi in ordine sei a posto

edit:
sono alle prese con un problema simile però nella vetrina e più mirato (solo alcuni prodotti), prova a vedere se questo può tornarti ultile:
http://www.mysqlitalia.it/wiki/Limitare ... tore_LIMIT
forse basta aggiungere limit x alla fine della query, se poi inserisci i marchi in ordine sei a posto

ATTENZIONE: Questi non sono cambiamenti banali. C'è un sacco di codice qui
) bene bravo bis!!:)

Re: Ordine (sort) Marchi prodotti
Grazie mille per l'aiutoforse basta aggiungere limit x alla fine della query, se poi inserisci i marchi in ordine sei a posto


$manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_image not like '' order by rand() limit 8" );
Re: Ordine (sort) Marchi prodotti
figurati, buono a sapersi che funzia 

ATTENZIONE: Questi non sono cambiamenti banali. C'è un sacco di codice qui
) bene bravo bis!!:)
