View file wip-site-portal/src/smiles.php

File size: 1.07Kb
<?
$msg=strtr($msg,array(':)'=>'smile.gif', ';)'=>'wink.gif', 'B)'=>'cool.gif', ':(('=>'aaa.gif', ':!'=>'be.gif', ':S'=>'blin.gif', '@='=>'bum.gif', ':X'=>'close.gif', ';('=>'cry.gif', ']:)'=>'devil.gif', '@-/-'=>'flow.gif', ':]'=>'gaga.gif', ':D'=>'green.gif', '=)'=>'ha.gif', '(:'=>'lol.gif', '=/'=>'hm.gif', '.kiss.'=>'kiss.gif', ':o)'=>'kloun.gif', '.lips.'=>'lips.gif', '.love.'=>'love.gif', '8o'=>'mmm.gif', '[:)'=>'music.gif', '=]'=>'napolu.gif', '.ninja.'=>'ninja.gif', '.down.'=>'no.gif', '%)'=>'ogo.gif', '.pirat.'=>'pirate.gif', '.beer.'=>'pivo.gif', ':['=>'red.gif', ':('=>'sad.gif', '.woot.'=>'shok.gif', '.zz.'=>'spit.gif', '=p'=>'tong.gif', ':T'=>'svist.gif', '.uuu.'=>'uuu.gif', '.wow.'=>'view.gif', ':?'=>'vopros.gif', '.up.'=>'yes.gif', ':@'=>'angry2.gif', ':O'=>'angry.gif'));
$arr=explode('<',$msg);

$msg=false;

foreach($arr as $key=>$val){
	
	if($key!=0 and $key<=3) $msg.='<img src="smiles/'.$val; 
	
	else $msg.=$val;
}

$msg=preg_replace("/src\=\"s([0-9])\.gif\>/","src=\"\\1.gif\" alt=\"\\1\"/>",$msg);
$msg=eregi_replace("s[0-9]\.gif\>","",$msg);
?>