{php}

$smiles = smiles::get_ini();
$smiles_a=array();
// загружаем список смайлов
$smiles_gl=glob(H.'/sys/images/smiles/*.gif');



foreach($smiles_gl as $path)
{
preg_match('#/([^/]+)\.gif$#', $path,$m);
$smiles_a[$m[1]]=$path;
}


 
$uniq = $template->get_template_vars('uniq'); 

foreach ($smiles_a as $name => $path) {
$v = array_keys ($smiles,$name);
echo '<a href="javascript:bb_smiles(\''.$uniq.'\',\'*'.$v[0].'*\');" title="'.$v[0].'"><img src="/sys/images/smiles/'.$name.'.gif" alt="'.$v[0].'" /></a>';
}

{/php}