<?
function smiles($msg)
{
global $user;
$q=mysql_query("SELECT * FROM `smile`");
while($post = mysql_fetch_array($q))
{
$sm=explode("|",$post['smile']);
for ($i=0;$i<count($sm) ;$i++ )
{
$msg = str_replace($sm[$i], '<img src="/style/smiles/'.$post['name'].'" alt=""/>', $msg);
}
}
return $msg;
}
?>