<?
function smiles($msg)
{
$msg=eregi_replace('\*TEMAZAKR\*', '<img src="/style/admin_smiles/temazakr.gif" alt="TEMAZAKR" />', $msg);
$msg=eregi_replace('\*OFFTOP2\*', '<img src="/style/admin_smiles/offtop2.gif" alt="OFFTOP2" />', $msg);
$msg=eregi_replace('\*MAT\*', '<img src="/style/admin_smiles/mat.gif" alt="MAT" />', $msg);
$msg=eregi_replace('\*MAT2\*', '<img src="/style/admin_smiles/mat2.gif" alt="MAT2" />', $msg);
$msg=eregi_replace('\*HULI\*', '<img src="/style/admin_smiles/huli.gif" alt="HULI" />', $msg);
$msg=eregi_replace('\*NEFLUDI\*', '<img src="/style/admin_smiles/nefludi.gif" alt="NEFLUDI" />', $msg);
$msg=eregi_replace('\*GOOD\*', '<img src="/style/admin_smiles/good.gif" alt="GOOD" />', $msg);
$msg=eregi_replace('\*FUN\*', '<img src="/style/admin_smiles/fun.gif" alt="FUN" />', $msg);
$msg=eregi_replace('\*LOH\*', '<img src="/style/admin_smiles/loh.gif" alt="LOH" />', $msg);
$msg=eregi_replace('\*OFFTOP\*', '<img src="/style/admin_smiles/offtop.gif" alt="OFF" />', $msg);
$msg=eregi_replace('\*FLUD\*', '<img src="/style/admin_smiles/flud.gif" alt="FLUD" />', $msg);
$msg=eregi_replace('\*BANAN\*', '<img src="/style/admin_smiles/ban3.gif" alt="BANN" />', $msg);
$msg=eregi_replace('\*BAN\*', '<img src="/style/admin_smiles/ban.gif" alt="BAN" />', 
$msg);
$msg=eregi_replace('\*BBAN\*', '<img src="/style/admin_smiles/bban.gif" alt="BBAN" />', $msg);
$msg=eregi_replace('\*ADMIN\*', '<img src="/style/admin_smiles/admin.gif" alt="ADMIN" />', $msg);
$msg=eregi_replace('\*ZENIT\*', '<img src="/style/admin_smiles/zenit.gif" alt="ZENIT" />', $msg);
$msg=eregi_replace('\*BANANY\*', '<img src="/style/admin_smiles/banany.gif" alt="BANANY" />', $msg);
$msg=eregi_replace('\*RULZ\*', '<img src="/style/admin_smiles/rulz.gif" alt="RULZ" />', $msg);
$msg=eregi_replace('(:|=)-?\){4,}|:ROFL:|\*ROFL\*|ROFL!{1,}', '<img src="/style/smiles/rofl.gif" alt="*ROFL*" />', $msg);
$msg=eregi_replace('\*BRAVO\*', '<img src="/style/smiles/clapping.gif" alt="*BRAVO*" />', $msg);
$msg=eregi_replace(':BRAVO:', '<img src="/style/smiles/clapping.gif" alt=":BRAVO:" />', $msg);
$msg=eregi_replace(':clapping:', '<img src="/style/smiles/clapping.gif" alt=":clapping:" />', $msg);
$msg=eregi_replace(':БРАВО:', '<img src="/style/smiles/clapping.gif" alt=":БРАВО:" />', $msg);
$msg=eregi_replace('\*БРАВО\*', '<img src="/style/smiles/clapping.gif" alt="*БРАВО*" />', $msg);
// большая улыбка
$msg=ereg_replace('((:-?)|\+|=)D', '<img src="/style/smiles/biggrin.gif" alt="big" />', $msg);
//
$msg=eregi_replace('\*TIRED\*|\|-?0|:boredom:', '<img src="/style/smiles/boredom.gif" alt="*TIRED*" />', $msg);
// плохо
$msg=eregi_replace(':-?(!|~)|:bad:|(:|\+|=)\(~', '<img src="/style/smiles/bad.gif" alt=":-!" />', $msg);
// улыбка
$msg=eregi_replace(':smile:', '<img src="/style/smiles/smile.gif" alt="lib" />', $msg);
// грусть
$msg=eregi_replace('(:-?|\+|=)\({1,3}|:sad:|\*sad\*', '<img src="/style/smiles/sad.gif" alt="\\0" />', $msg);
// подмигивание
$msg=ereg_replace('(^| );-?\)', '<img src="/style/smiles/wink.gif" alt="\\0" />', $msg);
$msg=str_replace('^_~', '<img src="/style/smiles/wink.gif" alt="^_~" />', $msg);
$msg=eregi_replace(':wink:', '<img src="/style/smiles/wink.gif" alt=":wink:" />', $msg);
// язык
$msg=ereg_replace('(:-?|\+|=)(P|b|p)', '<img src="/style/smiles/blum3.gif" alt="\\0" />', $msg);
$msg=eregi_replace(':tongue:', '<img src="/style/smiles/blum3.gif" alt=":tongue:" />', $msg);
// крутой
$msg=ereg_replace('((8|B)-?)\)', '<img src="/style/smiles/dirol.gif" alt="\\0" />', $msg);
$msg=eregi_replace(':COOL:|COOL!{1,}', '<img src="/style/smiles/dirol.gif" alt="\\0" />', $msg);

//rewrite by rxn
$msg=str_replace(':-[', '<img src="/style/smiles/blush2.gif" alt=":-[" />', $msg);
// шок
$msg=eregi_replace('(O|0)_(O|0)', '<img src="/style/smiles/shok.gif" alt="\\0" />', $msg);
// поцелуй
$msg=eregi_replace('(:-?|\+|=)(\*|\{\})|\^\.\^|:kiss:|\*kiss\*', '<img src="/style/smiles/kiss.gif" alt="\\0" />', $msg);
// плак
$msg=ereg_replace(':\'-?\({1,}', '<img src="/style/smiles/cray.gif" alt="plak" />', $msg);
// секрет
$msg=eregi_replace(':-?(X|#)|:secret:|x:', '<img src="/style/smiles/secret.gif" alt="\\0" />', $msg);
// агрессия
$msg=eregi_replace('(&gt;)(:|\+)(o|0)|:angry:|:-@', '<img src="/style/smiles/aggressive.gif" alt="\\0" />', $msg);
// дурак
$msg=ereg_replace('(:-?|=)\|', '<img src="/style/smiles/fool.gif" alt="\\0" />', $msg);
// be
$msg=ereg_replace(':-/', '<img src="/style/smiles/beee.gif" alt="obid" />', $msg);
// смех
$msg=eregi_replace('8P|\*JOKINGLY\*', '<img src="/style/smiles/mosking.gif" alt="\\0" />', $msg);
// дьявол
$msg=eregi_replace('(\]|\}):-?&gt;|:diablo:|\*DIABLO\*|&gt;:-?]', '<img src="/style/smiles/diablo.gif" alt="\\0" />', $msg);
// музыка
$msg=eregi_replace('\[:-?\}', '<img src="/style/smiles/music2.gif" alt="\\0" />', $msg);
// воздушный поцелуй
$msg=eregi_replace('\*KISSED\*', '<img src="/style/smiles/air_kiss.gif" alt="\\0" />', $msg);
// стоп
$msg=eregi_replace('\*STOP\*|:stop:|stop!{1,}', '<img src="/style/smiles/stop.gif" alt="\\0" />', $msg);
// поцелуй
$msg=eregi_replace('\*KISSING\*', '<img src="/style/smiles/kiss_3.gif" alt="\\0" />', $msg);
// роза
$msg=ereg_replace('@\}-&gt;--|@\}-:--|@&gt;\}--', '<img src="/style/smiles/give_rose.gif" alt="\\0" />', $msg);
// все отлично
$msg=eregi_replace('\*THUMBS_UP\*|:GOOD:|\*GOOD\*|good!{1,}', '<img src="/style/smiles/good.gif" alt="\\0" />', $msg);
// пить
$msg=eregi_replace('\*DRINK\*|:drink:', '<img src="/style/smiles/drinks.gif" alt="\\0" />', $msg);
// влюблен
$msg=eregi_replace('\*IN_LOVE\*|LOVE!{1,}', '<img src="/style/smiles/man_in_love.gif" alt="\\0" />', $msg);
// бомба
$msg=str_replace('@=', '<img src="/style/smiles/bomb.gif" alt="@=" />', $msg);
// потерян
$msg=eregi_replace('%-?\)|:-?\$|:wacko:', '<img src="/style/smiles/wacko.gif" alt="\\0" />', $msg);

$msg=eregi_replace('\*WASSUP\*', '<img src="/style/smiles/mamba.gif" alt="*WASSUP*" />', $msg);
$msg=eregi_replace('\*SUP\*', '<img src="/style/smiles/mamba.gif" alt="*SUP*" />', $msg);
$msg=eregi_replace('\*MAMBA\*', '<img src="/style/smiles/mamba.gif" alt="*MAMBA*" />', $msg);
$msg=eregi_replace(':MAMBA:', '<img src="/style/smiles/mamba.gif" alt=":MAMBA:" />', $msg);

$msg=eregi_replace('\*PARDON\*', '<img src="/style/smiles/pardon.gif" alt="*PARDON*" />', $msg);
$msg=eregi_replace(':pardon:', '<img src="/style/smiles/pardon.gif" alt=":pardon:" />', $msg);

$msg=eregi_replace('\*NO\*', '<img src="/style/smiles/nea.gif" alt="*NO*" />', $msg);

$msg=eregi_replace('\*CRAZY\*', '<img src="/style/smiles/crazy.gif" alt="*CRAZY*" />', $msg);
$msg=eregi_replace(':crazy:', '<img src="/style/smiles/crazy.gif" alt="*CRAZY*" />', $msg);

$msg=eregi_replace('\*DONT_KNOW\*', '<img src="/style/smiles/dntknw.gif" alt="*DONT_KNOW*" />', $msg);
$msg=eregi_replace('\*UNKNOWN\*', '<img src="/style/smiles/dntknw.gif" alt="*DONT_KNOW*" />', $msg);
$msg=eregi_replace(':HZ:', '<img src="/style/smiles/dntknw.gif" alt="*DONT_KNOW*" />', $msg);

$msg=eregi_replace('\*SORRY\*', '<img src="/style/smiles/sorry.gif" alt="*SORRY*" />', $msg);
$msg=eregi_replace(':sorry:', '<img src="/style/smiles/sorry.gif" alt="*SORRY*" />', $msg);

$msg=eregi_replace('\*YAHOO!*\*|:YAHOO:|YAHOO!{1,}', '<img src="/style/smiles/yahoo.gif" alt="\\0" />', $msg);

$msg=eregi_replace('\*DANCE\*', '<img src="/style/smiles/dance4.gif" alt="*DANCE*" />', $msg);
$msg=eregi_replace(':dance:', '<img src="/style/smiles/dance4.gif" alt="*DANCE*" />', $msg);

$msg=eregi_replace('\*HELP\*', '<img src="/style/smiles/help.gif" alt="*HELP*" />', $msg);

$msg=eregi_replace('\*OK\*', '<img src="/style/smiles/ok.gif" alt="*OK*" />', $msg);

$msg=eregi_replace('\*HELLO\*', '<img src="/style/smiles/preved.gif" alt="*HELLO*" />', $msg);
$msg=eregi_replace('\*PREVED\*', '<img src="/style/smiles/preved.gif" alt="*PREVED*" />', $msg);
$msg=eregi_replace('\*PRIVET\*', '<img src="/style/smiles/preved.gif" alt="*PRIVET*" />', $msg);
$msg=eregi_replace('\*HI\*', '<img src="/style/smiles/preved.gif" alt="*HI*" />', $msg);

//$msg=eregi_replace(';D', '<img src="/style/smiles/acute.gif" alt="*ACUTE*" />', $msg);
$msg=eregi_replace('\*ACUTE\*', '<img src="/style/smiles/acute.gif" alt="*ACUTE*" />', $msg);

$msg=eregi_replace('\*BYE\*', '<img src="/style/smiles/bye.gif" alt="*BYE*" />', $msg);

$msg=eregi_replace('\*WRITE\*', '<img src="/style/smiles/mail1.gif" alt="*WRITE*" />', $msg);
$msg=eregi_replace('\*MAIL\*', '<img src="/style/smiles/mail1.gif" alt="*MAIL*" />', $msg);

$msg=eregi_replace('\*WALL\*', '<img src="/style/smiles/dash1.gif" alt="*WALL*" />', $msg);
$msg=eregi_replace('\*DASH\*', '<img src="/style/smiles/dash1.gif" alt="*DASH*" />', $msg);

$msg=eregi_replace('\*YES\*', '<img src="/style/smiles/yes3.gif" alt="*YES*" />', $msg);

$msg=eregi_replace('\*SCRATCH\*', '<img src="/style/smiles/scratch_one-s_head.gif" alt="*SCRATCH*" />', $msg);

$msg=eregi_replace('\*LOL!*\*|:LOL:|LOL!{1,}', '<img src="/style/smiles/lol.gif" alt="\\0" />', $msg);

$msg=eregi_replace('\*HAPPY\*', '<img src="/style/smiles/i-m_so_happy.gif" alt="*HAPPY*" />', $msg);
$msg=eregi_replace(':happy:', '<img src="/style/smiles/i-m_so_happy.gif" alt=":happy:" />', $msg);

$msg=eregi_replace('\*db\*', '<img src="/style/smiles/pleasantry.gif" alt="*db*" />', $msg);
$msg=eregi_replace(':db:', '<img src="/style/smiles/pleasantry.gif" alt=":db:" />', $msg);

global $set,$user;

$f_smiles=file(H."smiles/smiles.txt");
for ($i=0;$i<count($f_smiles);$i++)
{
$str_sm=explode(' ',trim($f_smiles[$i]));
$str_sm2='';
for ($z=1;$z<count($str_sm);$z++)
{
if ($z>1){$str_sm2.=' ';}
$str_sm2.=$str_sm[$z];
}
$str_sm2=explode(',',$str_sm2);
for ($i2=0;$i2<count($str_sm2);$i2++)
{
$str_sm2[$i2]=stripcslashes(htmlspecialchars($str_sm2[$i2]));
$msg=str_replace("$str_sm2[$i2]", "<img src=\"/style/smiles/$str_sm[0].gif\" alt=\"\" />", $msg);
}
}
return $msg;
}
function no_reklam ($msg){
	      
$mat = file_get_contents("antimat.dat"); 
$arr_mat= explode("|",$mat);
    
foreach($arr_mat as $value){
if($value!=""){
$msg = preg_replace("|$value|iu","***",$msg); 
}}

return $msg;}
?>