<?php
function smarty_function_tags( $params, &$smarty )
{
$disp='Теги:';
$sql='select tag_id from SC_tagged_objects where object_type="product" and object_id='.$_GET['productID'];
if($r=mysql_query($sql))
while($res=mysql_fetch_assoc($r)){
$sql2='select name from SC_tags where id='.$res['tag_id'];
if($r2=mysql_query($sql2))
$tags=mysql_fetch_assoc($r2);
$disp.=' <a href="/search/?searchstring='.$tags['name'].'">'.$tags['name'].'</a>';
}
return $disp;
}
?>