Ordine (sort) Marchi prodotti
Inviato: 27/02/2010, 20:11
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:
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>