I was thinking that $manufacturers used the actual id as the first key of the 2 dimensional array. But I did a quick check and the first key is just a counter - so my code needs to be fixed. No time to try this - syntax may be off, but something like this should do the trick:
In products.php:
Code:
foreach ($products as $k => $v) {
$manufac_id = $products[$k]['manufacturerid'];
$manuf_this_cat[$manufac_id] = func_query_first_cell ("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE $sql_tbl[manufacturers].manufacturerid='$manufac_id'");
}
$smarty->assign('manuf_this_cat',$manuf_this_cat);
Then in the template:
Code:
{if $manuf_this_cat}
<hr />
<ul>
{foreach from=$manuf_this_cat key=k item=v}
<li>
manufacturerid:{$k}<br />
name:{$v}<br />
link: <a href="manufacturers.php?manufacturerid={$k}">{$v}</a>
</li>
{/foreach}
</ul>
<hr />
{/if}