Файл: rayb.me/system/func.msg.php
Строк: 218
<?php
function text_msg($msg, $html = 1){
global $user;
global $ank;
$msg = html_entity_decode($msg, ENT_QUOTES, 'UTF-8');
$msg = htmlentities($msg, ENT_QUOTES, 'UTF-8');
//$msg = mb_ereg_replace('n','r','<br />', $msg);
$msg = str_ireplace(array('rn','\r\n'),'<br />', $msg);
$bbcode = array();
$bbcode['/n/isU'] = '<br>';
$bbcode['/[b](.+)[/b]/isU'] = "<b>$1</b>";
$bbcode['/[url=(.+)](.+)[/url]/isU'] = "<a href='$1'>$2</a>";
$bbcode['/[color=(.+)](.+)[/color]/isU'] = "<font color='$1'>$2</font>";
$bbcode['/[img](.+)[/img]/isU'] = "<center><img src='$1' /></center>";
$bbcode['/[ut](.+)[/ut]/isU'] = "<center><iframe src='https://www.youtube.com/embed/$1' frameborder='0' allow='autoplay; encrypted-media' allowfullscreen></iframe></center>";
if(count($bbcode)) $msg = preg_replace(array_keys($bbcode), array_values($bbcode), $msg);
if($ank['access'] == 7)$msg = "<font color='#FF0000'>".$msg."</font>";
if($ank['access'] == 6)$msg = "<font color='#FF0000'>".$msg."</font>";
if($ank['access'] == 5) $msg = "<font color='#FF4500'>".$msg."</font>";
if($ank['access'] == 4)$msg = "<font color='#20859e'>".$msg."</font>";
if($ank['access'] == 3) $msg = "<font color='#FF4500'>".$msg."</font>";
if($ank['access'] == 2) $msg = "<font color='#20859e'>".$msg."</font>";
if($ank['access'] == 1) $msg = "<font color='#000000'>".$msg."</font>";
$msg = str_replace(array(':chit'), '<img src="/img/smiles/1.gif" alt="*"/>', $msg);
$msg = str_replace(array(':-D', ':D'), '<img src="/img/smiles/7.gif" alt="*"/>', $msg);
$msg = str_replace(array(':-)'), '<img src="/img/smiles/10.gif" alt="*"/>', $msg);
$msg = str_replace(array(':krut'), '<img src="/img/smiles/2.gif" alt="*"/>', $msg);
$msg = str_replace(array(':king'), '<img src="/img/smiles/3.gif" alt="*"/>', $msg);
$msg = str_replace(array(':ded'), '<img src="/img/smiles/4.gif" alt="*"/>', $msg);
$msg = str_replace(array(':palm'), '<img src="/img/smiles/5.gif" alt="*"/>', $msg);
$msg = str_replace(array(':ha'), '<img src="/img/smiles/6.gif" alt="*"/>', $msg);
$msg = str_replace(array(':klass'), '<img src="/img/smiles/8.gif" alt="*"/>', $msg);
$msg = str_replace(array(':grust'), '<img src="/img/smiles/9.gif" alt="*"/>', $msg);
$msg = str_replace(array(':P'), '<img src="/img/smiles/11.gif" alt="*"/>', $msg);
$msg = str_replace(array(':son'), '<img src="/img/smiles/12.gif" alt="*"/>', $msg);
$msg = str_replace(array(':mig'), '<img src="/img/smiles/13.gif" alt="*"/>', $msg);
$msg = str_replace(array(':aaa'), '<img src="/img/smiles/14.gif" alt="*"/>', $msg);
$msg = str_replace(array(':air_kiss'), '<img src="/img/smiles/air_kiss.gif" alt="*"/>', $msg);
$msg = str_replace(array(':akiss'), '<img src="/img/smiles/akiss.gif" alt="*"/>', $msg);
$msg = str_replace(array(':alkawi'), '<img src="/img/smiles/alkawi.gif" alt="*"/>', $msg);
$msg = str_replace(array(':angel'), '<img src="/img/smiles/angel.gif" alt="*"/>', $msg);
$msg = str_replace(array(':angry'), '<img src="/img/smiles/angry.gif" alt="*"/>', $msg);
$msg = str_replace(array(':antifem'), '<img src="/img/smiles/antifem.gif" alt="*"/>', $msg);
$msg = str_replace(array(':atata'), '<img src="/img/smiles/atata.gif" alt="*"/>', $msg);
$msg = str_replace(array(':atata2'), '<img src="/img/smiles/atata2.gif" alt="*"/>', $msg);
$msg = str_replace(array(':baby'), '<img src="/img/smiles/baby.gif" alt="*"/>', $msg);
$msg = str_replace(array(':banka'), '<img src="/img/smiles/banka.gif" alt="*"/>', $msg);
$msg = str_replace(array(':bash'), '<img src="/img/smiles/bash.gif" alt="*"/>', $msg);
$msg = str_replace(array(':beach'), '<img src="/img/smiles/beach.gif" alt="*"/>', $msg);
$msg = str_replace(array(':bear'), '<img src="/img/smiles/bear.gif" alt="*"/>', $msg);
$msg = str_replace(array(':bow'), '<img src="/img/smiles/bow.gif" alt="*"/>', $msg);
$msg = str_replace(array(':bye'), '<img src="/img/smiles/bye.gif" alt="*"/>', $msg);
$msg = str_replace(array(':cage'), '<img src="/img/smiles/cage.gif" alt="*"/>', $msg);
$msg = str_replace(array(':camomile'), '<img src="/img/smiles/camomile.gif" alt="*"/>', $msg);
$msg = str_replace(array(':celuju'), '<img src="/img/smiles/celuju.gif" alt="*"/>', $msg);
$msg = str_replace(array(':censored'), '<img src="/img/smiles/censored.gif" alt="*"/>', $msg);
$msg = str_replace(array(':chasy'), '<img src="/img/smiles/chasy.gif" alt="*"/>', $msg);
$msg = str_replace(array(':chmok'), '<img src="/img/smiles/chmok.gif" alt="*"/>', $msg);
$msg = str_replace(array(':comando'), '<img src="/img/smiles/comando.gif" alt="*"/>', $msg);
$msg = str_replace(array(':crazy'), '<img src="/img/smiles/crazy.gif" alt="*"/>', $msg);
$msg = str_replace(array(':d_sunny'), '<img src="/img/smiles/d_sunny.gif" alt="*"/>', $msg);
$msg = str_replace(array(':deaf'), '<img src="/img/smiles/deaf.gif" alt="*"/>', $msg);
$msg = str_replace(array(':diablo'), '<img src="/img/smiles/diablo.gif" alt="*"/>', $msg);
$msg = str_replace(array(':dovolen'), '<img src="/img/smiles/dovolen.gif" alt="*"/>', $msg);
$msg = str_replace(array(':draka'), '<img src="/img/smiles/draka.gif" alt="*"/>', $msg);
$msg = str_replace(array(':duw'), '<img src="/img/smiles/duw.gif" alt="*"/>', $msg);
$msg = str_replace(array(':eda'), '<img src="/img/smiles/eda.gif" alt="*"/>', $msg);
$msg = str_replace(array(':elka'), '<img src="/img/smiles/elka.gif" alt="*"/>', $msg);
$msg = str_replace(array(':hi'), '<img src="/img/smiles/hi.gif" alt="*"/>', $msg);
$msg = str_replace(array(':holms'), '<img src="/img/smiles/holms.gif" alt="*"/>', $msg);
$msg = str_replace(array(':hooray'), '<img src="/img/smiles/hooray.gif" alt="*"/>', $msg);
$msg = str_replace(array(':karty'), '<img src="/img/smiles/karty.gif" alt="*"/>', $msg);
$msg = str_replace(array(':lechitsja'), '<img src="/img/smiles/lechitsja.gif" alt="*"/>', $msg);
$msg = str_replace(array(':mad'), '<img src="/img/smiles/mad.gif" alt="*"/>', $msg);
$msg = str_replace(array(':nea'), '<img src="/img/smiles/nea.gif" alt="*"/>', $msg);
$msg = str_replace(array(':newyear'), '<img src="/img/smiles/newyear.gif" alt="*"/>', $msg);
$msg = str_replace(array(':nhl'), '<img src="/img/smiles/nhl.gif" alt="*"/>', $msg);
$msg = str_replace(array(':nono'), '<img src="/img/smiles/nono.gif" alt="*"/>', $msg);
$msg = str_replace(array(':nyam'), '<img src="/img/smiles/nyam.gif" alt="*"/>', $msg);
$msg = str_replace(array(':olimp'), '<img src="/img/smiles/olimp.gif" alt="*"/>', $msg);
$msg = str_replace(array(':osen'), '<img src="/img/smiles/osen.gif" alt="*"/>', $msg);
$msg = str_replace(array(':pardon'), '<img src="/img/smiles/pardon.gif" alt="*"/>', $msg);
$msg = str_replace(array(':poka'), '<img src="/img/smiles/poka.gif" alt="*"/>', $msg);
$msg = str_replace(array(':popcorn'), '<img src="/img/smiles/popcorn.gif" alt="*"/>', $msg);
$msg = str_replace(array(':preved'), '<img src="/img/smiles/preved.gif" alt="*"/>', $msg);
$msg = str_replace(array(':privet'), '<img src="/img/smiles/privet.gif" alt="*"/>', $msg);
$msg = str_replace(array(':puzyr'), '<img src="/img/smiles/puzyr.gif" alt="*"/>', $msg);
$msg = str_replace(array(':roulette'), '<img src="/img/smiles/roulette.gif" alt="*"/>', $msg);
$msg = str_replace(array(':roza'), '<img src="/img/smiles/roza.gif" alt="*"/>', $msg);
$msg = str_replace(array(':santa'), '<img src="/img/smiles/santa.gif" alt="*"/>', $msg);
$msg = str_replace(array(':sarkastik'), '<img src="/img/smiles/sarkastik.gif" alt="*"/>', $msg);
$msg = str_replace(array(':scare'), '<img src="/img/smiles/scare.gif" alt="*"/>', $msg);
$msg = str_replace(array(':shout'), '<img src="/img/smiles/shout.gif" alt="*"/>', $msg);
$msg = str_replace(array(':snegur'), '<img src="/img/smiles/snegur.gif" alt="*"/>', $msg);
$msg = str_replace(array(':sorri'), '<img src="/img/smiles/sorri.gif" alt="*"/>', $msg);
$msg = str_replace(array(':stena'), '<img src="/img/smiles/stena.gif" alt="*"/>', $msg);
$msg = str_replace(array(':sumas'), '<img src="/img/smiles/sumas.gif" alt="*"/>', $msg);
$msg = str_replace(array(':superstition'), '<img src="/img/smiles/superstition.gif" alt="*"/>', $msg);
$msg = str_replace(array(':svadba'), '<img src="/img/smiles/svadba.gif" alt="*"/>', $msg);
$msg = str_replace(array(':swoon'), '<img src="/img/smiles/swoon.gif" alt="*"/>', $msg);
$msg = str_replace(array(':tanec'), '<img src="/img/smiles/tanec.gif" alt="*"/>', $msg);
$msg = str_replace(array(':tommy'), '<img src="/img/smiles/tommy.gif" alt="*"/>', $msg);
$msg = str_replace(array(':ura'), '<img src="/img/smiles/ura.gif" alt="*"/>', $msg);
$msg = str_replace(array(':vinsent'), '<img src="/img/smiles/vinsent.gif" alt="*"/>', $msg);
$msg = str_replace(array(':vkusna'), '<img src="/img/smiles/vkusna.gif" alt="*"/>', $msg);
$msg = str_replace(array(':xmas'), '<img src="/img/smiles/xmas.gif" alt="*"/>', $msg);
$msg = str_replace(array('блять', 'наху', 'ебан', 'хуй', 'гавно', 'хрень', 'пидор', 'чмо', 'пизда', 'пабл'), '<font color="red">(~)</font>', $msg);
$msg = preg_replace("/[bin=(.*)](.*)[/bin]/Usi", "<img width='\1' height='\1' src='\2'>", $msg);
$msg = preg_replace("/[infa_us]/Usi", $user['name'] . '<br>' .$user['ruby']. ' рубинов<br>' .n_f($user['angels']). ' ангелов<br>', $msg);
$msg = preg_replace("/[img=(.*)]/Usi", "<img style='max-width:100%; max-height:700px;' src='\1'>", $msg); //
$msg = preg_replace("/[(.*)х(.*)-img=(.*)]/Usi", "<img style='max-width:100%;width:\1px; height:\2px;' src='\3'>", $msg);
$msg = preg_replace("/[site=(.*)](.*)[/site]/Usi", "<a href='\1'>\2</a>", $msg);
#
$msg = preg_replace("/[background=(.*)](.*)[/background]/Usi", "<div style='background-color:\1; display: block;'>\2</div>", $msg);
$msg = preg_replace("/[ramkt](.*)[/ramkt]/Usi", "<span style='border-style: dashed; border-color:yellowgreen'>\1</span>", $msg);
$msg = preg_replace("/[ramkt2](.*)[/ramkt2]/Usi", "<span style='border-style: dashed; border-color:yellow'>\1</span>", $msg);
$msg = preg_replace("/[ramkt3](.*)[/ramkt3]/Usi", "<span style='border-style: dashed; border-color:LightGreen'>\1</span>", $msg);
$msg = preg_replace("/[ramkt4](.*)[/ramkt4]/Usi", "<span style='border-style: dashed; border-color:SteelBlue'>\1</span>", $msg);
$msg = preg_replace("/[ramkt5](.*)[/ramkt5]/Usi", "<span style='border-style: dashed; border-color:LightPink'>\1</span>", $msg);
$msg = preg_replace("/[ramkt6](.*)[/ramkt6]/Usi", "<span style='border-style: dashed; border-color:Gray'>\1</span>", $msg);
$msg = preg_replace("/[ramkt7](.*)[/ramkt7]/Usi", "<span style='border-style: dashed; border-color:White'>\1</span>", $msg);
$msg = preg_replace("/[ramkt8](.*)[/ramkt8]/Usi", "<span style='border-style: dashed; border-color:MediumSlateBlue'>\1</span>", $msg);
$msg = preg_replace("/[ramkt9](.*)[/ramkt9]/Usi", "<span style='border-style: dashed; border-color:LightSalmon'>\1</span>", $msg);
$msg = preg_replace("/[ramkt10](.*)[/ramkt10]/Usi", "<span style='border-style: dashed; border-color:DarkOrange'>\1</span>", $msg);
$msg = preg_replace("/[ramkt11](.*)[/ramkt11]/Usi", "<span style='border-style: dashed; border-color:SpringGreen'>\1</span>", $msg);
$msg = preg_replace("/[ramkt12](.*)[/ramkt12]/Usi", "<span style='border-style: dashed; border-color:Yellow'>\1</span>", $msg);
$msg = preg_replace("/[ramkt13](.*)[/ramkt13]/Usi", "<span style='border-style: dashed; border-color:Gold'>\1</span>", $msg);
$msg = preg_replace("/[ramkt14](.*)[/ramkt14]/Usi", "<span style='border-style: dashed; border-color:DarkRed'>\1</span>", $msg);
$msg = preg_replace("/[ramkt15](.*)[/ramkt15]/Usi", "<span style='border-style: dashed; border-color:DeepPink'>\1</span>", $msg);
#
$msg = preg_replace("/[center](.*)[/center]/Usi", "<center>\1</center>", $msg);
$msg = preg_replace("/[right](.*)[/right]/Usi", "<div align='right'>\1</div>", $msg);
$msg = preg_replace("/[left](.*)[/left]/Usi", "<div align='left'>\1</div>", $msg);
$msg = preg_replace("/[br]/Usi", "<br>", $msg);
$msg = preg_replace("/[hr]/Usi", "<hr>", $msg);
$msg = preg_replace("/[big](.*)[/big]/Usi", "<span style='font-size:large;'>\1</span>", $msg);
$msg = preg_replace("/[sol](.*)[/col]/Usi", "<span style='border:1px solid;'>\1</span>", $msg);
$msg = preg_replace("/[das](.*)[/das]/Usi", "<span style='border:1px dashed;'>\1</span>", $msg);
$msg = preg_replace("/[dot](.*)[/dot]/Usi", "<span style='border:1px dotted;'>\1</span>", $msg);
$msg = preg_replace("/[ex](.*)[/ex]/Usi", "<span style='text-decoration:line-through;'>\1</span>", $msg);
$msg = preg_replace("/[dotss](.*)[/dotss]/Usi", "<span style='text-decoration:underline'>\1</span>", $msg);
$msg = preg_replace("/[up](.*)[/up]/Usi", "<span style='text-decoration:overline;'>\1</span>", $msg);
$msg = preg_replace("/[i](.*)[/i]/Usi", "<em>\1</em>", $msg);
$msg = preg_replace("/[b](.*)[/b]/Usi", "\1", $msg);
$msg = preg_replace("/[small](.*)[/small]/Usi", "<small>\1</small>", $msg);
$msg = preg_replace("/[color=(.*)](.*)[/color]/Usi", "<font color='\1'>\2</font>", $msg);
$msg=preg_replace("/[feedback](.*)[/feedback]/Usi",'<div class="feedback">\1</div>',$msg);
$msg = preg_replace('|rn|si', '<br />', $msg);
$msg=str_replace("r","",$msg);
return $msg;
}
function msg($sms) {
echo '<div class="feedback">' . $sms . '</div>';
}
function bbpanel($form, $field) {
return '<script language="JavaScript" type="text/javascript">function tag(text1, text2){if ((document.selection)){document.'.$form.'.'.$field.'.focus();document.'.$form.'.document.selection.createRange().text = text1+document.'.$form.'.document.selection.createRange().text+text2;} else if(document.forms[''.$form.''].elements[''.$field.''].selectionStart!=undefined){var element = document.forms[''.$form.''].elements[''.$field.''];var str = element.value;var start = element.selectionStart;var length = element.selectionEnd - element.selectionStart;element.value = str.substr(0, start) + text1 + str.substr(start, length) + text2 + str.substr(start + length);} else document.'.$form.'.'.$field.'.value += text1+text2;}</script>
<a class="emoji" data-emoji="🙂" href="javascript:tag(' 🙂 ','')">🙂</a>
<a class="emoji" data-emoji="😏" href="javascript:tag(' 😏 ','')">😏</a>
<a class="emoji" data-emoji="☹️" href="javascript:tag(' ☹️ ','')">☹️</a>
<a class="emoji" data-emoji="😉" href="javascript:tag(' 😉 ','')">😉</a>
<a class="emoji" data-emoji="😜" href="javascript:tag(' 😜 ','')">😜</a>
<a class="emoji" data-emoji="😳" href="javascript:tag(' 😳 ','')">😳</a>
<a class="emoji" data-emoji="😐" href="javascript:tag(' 😐 ','')">😐</a>
<a class="emoji" data-emoji="😢" href="javascript:tag(' 😢 ','')">😢</a>
<br/>
<a class="emoji" data-emoji="🤮" href="javascript:tag(' 🤮 ','')">🤮</a>
<a class="emoji" data-emoji="😎" href="javascript:tag(' 😎 ','')">😎</a>
<a class="emoji" data-emoji="💩" href="javascript:tag(' 💩 ','')">💩</a>
<a class="emoji" data-emoji="😘" href="javascript:tag(' 😘 ','')">😘</a>
<a class="emoji" data-emoji="😍" href="javascript:tag(' 😍 ','')">😍</a>
<a class="emoji" data-emoji="🤭" href="javascript:tag(' 🤭 ','')">🤭</a>
<a class="emoji" data-emoji="😡" href="javascript:tag(' 😡 ','')">😡</a>
<a class="emoji" data-emoji="👋" href="javascript:tag(' 👋 ','')">👋</a>';
}