Originally Posted by
itmanvn
pls show me how you can do that
Actually I think what i've done is not the right way to do it but it works and i coded everything without any help from this forum as usual. In my posts nobody mind to answer.
so, in tpl_index_product_list.php put the following code somewhere you want the logo to appear.
PHP Code:
<?php
if (!isset($_GET['manufacturers_id'])){
?>
<table width="100%" border="0" cellspacing="1">
<tr>
<?php
for ($i=1, $n=sizeof($options); $i<$n; $i++) {
$manufacturer_image_sort_query = "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image,
mi.manufacturers_url
from " . TABLE_MANUFACTURERS . " m
left join " . TABLE_MANUFACTURERS_INFO . " mi
on (m.manufacturers_id = mi.manufacturers_id
and mi.languages_id = '" . (int)$_SESSION['languages_id'] . "'), " . TABLE_PRODUCTS . " p
where p.manufacturers_id = '" . (int)$options[$i]['id'] . "'
and p.manufacturers_id = m.manufacturers_id";
$manufacturer_image_sort = $db->Execute($manufacturer_image_sort_query);
if ($manufacturer_image_sort->RecordCount() > 0) {
echo '<td><a href="/index.php?main_page=index&cPath=' . $cPath . '&filter_id=' . $options[$i]['id'] . '">' . zen_image(DIR_WS_IMAGES . $manufacturer_image_sort->fields['manufacturers_image'], $manufacturer_image_sort->fields['manufacturers_name']) . '</a></td>'."\r\n";
}
}
?>
</tr>
</table>
<?php
}
?>
The code does work but with limitations for now. if you have too many logos they will be costrained into one single line. i will fix it soon if i need that.
The ugly thing of this is that the code execute a MySQL query for every single logo displayed... very bad but for few logos is ok. I'm not that good with SQL query, i don't know how to select more than one record and put the risults in an array. i tried some solutions with no result.
Bookmarks