info['id']) || $u->info['banned']>0)
{
die(json_encode(array('js'=>'top.location="bk?exit='.$code.'";')));
}elseif($u->info['ip']!=$_SERVER['HTTP_X_REAL_IP'])
{
}
if(!isset($u->info['id']) || !isset($_COOKIE['login'])) {
die();
}
if($u->info['repass'] > 0) {
die();
}
if($u->info['bithday'] == '01.01.1800') {
unset($_GET['msg'],$_POST['msg'],$_POST['warnMsg']);
$_GET['r3'] = 1;
}
if( $u->info['admin'] == 0 ) {
unset($_GET['r3']);
}
if($u->info['online'] < time() - 60) {
mysql_query('UPDATE `users` SET `online` = '.time().' WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$filter->setOnline($u->info['online'],$u->info['id'],0);
$u->onlineBonus();
}
if(isset($_POST['delMsg']) && ($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4)))
{
if(((int)$_POST['delMsg']) > 0) {
mysql_query('UPDATE `chat` SET `delete` = "'.$u->info['id'].'" WHERE `id` = "'.mysql_real_escape_string(((int)$_POST['delMsg'])).'" LIMIT 1');
}else{
mysql_query('UPDATE `users` SET `molch3` = "'.(time()+3600*3).'" WHERE `id` = "'.mysql_real_escape_string(-((int)$_POST['delMsg'])).'" LIMIT 1');
}
}
$r = array(
'rnd'=>$code,
'rn'=>NULL,
'list'=>NULL,
'msg'=>NULL,
'key'=>NULL,
'js'=>NULL,
'xu'=>0
);
$u->onlineBonus();
if($u->info['battle'] > 0) {
$btl = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$u->info['battle'].'" AND `time_over` = 0 LIMIT 1'));
if(!isset($btl['id'])) {
$r['js'] .= 'top.frames["main"].location="main.php";';
}
}
if(isset($_POST['msg']) && str_replace(' ','',$_POST['msg'])!='')
{
$msg = array();
$_POST['msg'] = str_replace('\x3C','<',$_POST['msg']);
$_POST['msg'] = str_replace('\x3','>',$_POST['msg']);
$_POST['msg'] = iconv('UTF-8', 'windows-1251', $_POST['msg']);
function tolink($buf) {
$x=explode(" ",$buf);
$newbuf='';
for ($j=0; $j<Информация о "'.$ulogin.'">';
}
}elseif( strripos($x[$j], 'audio_1610649509.mp3') == true ) { //ТУТ аудио
$ulogin = explode('audio_1610649509.mp3',$x[$j]);
$uname = '<Голосовое сообщение>';
// }
}elseif( strripos($x[$j], 'new-combats.com/item/') == true ) {
$ulogin = explode('/item/',$x[$j]);
$ulogin = $ulogin[1];
$ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" LIMIT 1'));
if(isset($ulogin['name'])) {
$ulogin = htmlspecialchars($ulogin['name']);
$uname = '<Предмет "'.$ulogin.'">';
}else{
$uname = '<Библиотека предметов>';
}
}elseif( strripos($x[$j], 'new-combats.com/news') == true ) {
$ulogin = explode('/news',$x[$j]);
$ulogin = $ulogin[1];
$ulogin = ltrim($ulogin,'/');
$ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `events_news` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" LIMIT 1'));
if(isset($ulogin['title'])) {
$ulogin = htmlspecialchars($ulogin['title']);
$uname = '<Новость "'.$ulogin.'">';
}else{
$uname = '<Новостная лента>';
}
}elseif( strripos($x[$j], 'new-combats.com/lib') == true ) {
$ulogin = explode('/lib',$x[$j]);
$ulogin = $ulogin[1];
$ulogin = ltrim($ulogin,'/');
$ulogin = rtrim($ulogin,'/');
$ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `library_content` WHERE `url_name` = "'.mysql_real_escape_string($ulogin).'" AND `moder` > 0 LIMIT 1'));
if(isset($ulogin['title'])) {
$ulogin = htmlspecialchars($ulogin['title']);
$uname = '<Библиотека "'.$ulogin.'">';
}else{
$uname = '<Библиотека>';
}
}elseif( strripos($x[$j], 'new-combats.com/forum') == true ) {
$ulogin = explode('/forum?read=',$x[$j]);
$ulogin = $ulogin[1];
$ulogin = explode('&',$ulogin);
$ulogin = $ulogin[0];
//
$ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `forum_msg` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" AND `delete` = 0 LIMIT 1'));
if(isset($ulogin['title'])) {
$ulogin = htmlspecialchars($ulogin['title']);
$uname = '<Форум "'.$ulogin.'">';
}else{
$ulogin = explode('/forum?r=',$x[$j]);
$ulogin = $ulogin[1];
$ulogin = explode('&',$ulogin);
$ulogin = $ulogin[0];
//
$ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `forum_menu` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" LIMIT 1'));
if(isset($ulogin['name'])) {
$uname = '<Конференция форума "'.$ulogin['name'].'">';
}else{
$uname = '<Форум проекта>';
}
}
}
//
if (preg_match
("/(https:\\/\\/)?(new-combats+\\.com(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/",
$x[$j],$ok))
$newbuf.=str_replace($ok[2],"".$uname."",
str_replace("https://","",$x[$j]))." ";
else
$newbuf.=$x[$j]." ";
}
return $newbuf;
}
$_POST['msg'] = $chat->expworld($_POST['msg'],120);
$_POST['msg'] = str_replace('\\','\\\\',$_POST['msg']);
$_POST['msg'] = str_replace('"','[s1;]',$_POST['msg']);
$_POST['msg'] = str_replace("'",'[s2;]',$_POST['msg']);
$_POST['msg'] = str_replace('<','[s3;]',$_POST['msg']);
$_POST['msg'] = str_replace('>','[s4;]',$_POST['msg']);
$_POST['msg'] = str_replace(' ',' ',$_POST['msg']);
$_POST['msg'] = str_replace('>','[s4;]',$_POST['msg']);
$_POST['msg'] = str_replace('<','[s3;]',$_POST['msg']);
$_POST['msg'] = str_replace("\r",'[s3;]br[s4;]',$_POST['msg']);
$_POST['msg'] = str_replace("\b",'[s3;]br[s4;]',$_POST['msg']);
$_POST['msg'] = str_replace(" ",'[s3;]TAB[s4;]',$_POST['msg']);
$_POST['msg'] = str_replace("",'[s3;]TAB[s4;]',$_POST['msg']);
$_POST['msg'] = htmlspecialchars($_POST['msg'],NULL,'cp1251');
$_POST['msg'] = str_replace('%usersmile%','',$_POST['msg']);
$_POST['msg'] = tolink($_POST['msg']);
$_POST['msg'] = str_replace('::','',$_POST['msg']);
$_POST['msg'] = str_replace('[s1;]','"',$_POST['msg']);
$_POST['msg'] = str_replace("[s2;]",'"',$_POST['msg']);
$_POST['msg'] = str_replace('[s3;]','<',$_POST['msg']);
$_POST['msg'] = str_replace('[s4;]','>',$_POST['msg']);
$_POST['msg'] = str_replace(' ',' ',$_POST['msg']);
$smg = mysql_fetch_array(mysql_query('SELECT * FROM `chat` WHERE `login` = "'.$u->info['login'].'" AND `time` > '.(time()-20).' ORDER BY `time` DESC LIMIT 1'));
if ($u->info['exp'] < 499999999)
{
$lmg = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `chat` WHERE `login` = "'.$u->info['login'].'" AND `time` > '.(time()-5).' LIMIT 2'));
}
else
{
$lmg[0] = 0;
}
$testsmg = ' '.$_POST['msg'].' ';
if ($testsmg == $smg['text'] && $u->info['exp'] > 100000)
{
if($u->info['molch1'] < time()) {
//Молчанка за флуд на 5 минут
$u->info['molch1'] = time()+1200;
$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","Вы наказаны за спам на 20 минут ","Black","1","1","0"]);';
mysql_query('UPDATE `users` SET `molch1` = "'.$u->info['molch1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '".$u->info['login']."' LIMIT 1000");
$_POST['msg']= 'Я спамер '.$u->info['login'].' и меня нужно заблокировать https://new-combats.com/info/'.$u->info['id'].'';
mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
"0",
"'.$u->info['invis'].'",
"1",
"0",
"0",
"1",
"",
"",
"'.$u->info['city'].'",
"0",
"'.time().'",
"6",
"0",
"'.mysql_real_escape_string($_POST['msg']).'",
"0",
"red",
"0",
"0",
"0")');
$_POST['msg']= 'Это супер проект! Всем успехов!';
mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
"0",
"'.$u->info['invis'].'",
"1",
"0",
"0",
"1",
"'.$u->info['login'].'",
"",
"'.$u->info['city'].'",
"0",
"'.time().'",
"1",
"0",
"'.mysql_real_escape_string($_POST['msg']).'",
"0",
"Black",
"0",
"0",
"0")');
}
}elseif($lmg[0] > 0) {
$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","Вы не можете отправлять так часто сообщения... ","Black","1","1","0"]);';
if($u->info['molch1'] < time()) {
if($u->info['molch1'] < -5) {
$u->info['molch1'] = time()+300;
$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","Вы наказаны за флуд на 5 минут ","Black","1","1","0"]);';
}elseif($u->info['molch1'] < 0) {
$u->info['molch1']--;
}else{
$u->info['molch1'] = -1;
}
mysql_query('UPDATE `users` SET `molch1` = "'.$u->info['molch1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
}elseif((preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to']) || preg_match("/private \[(.*?)\]/", $_POST['msg'], $msg['to'])) && $u->info['exp'] < 150000)
{
$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","Вы не можете отправлять приват до достижения 150000 опыта.","Black","1","1","0"]);';
}else{
//Записываем данные
$msg['time'] = time();
$msg['spam'] = 0;
$msg['type'] = 1;
$msg['toChat'] = 0;
$msg['color'] = 'Black';
$msg['typeTime'] = 0;
$msg['sound'] = 0;
$msg['global'] = 0;
$msg['molch'] = 0;
$msg['login'] = $u->info['login'];
$msg['cancel'] = 0;
$msg['delete'] = 0;
$msg['to'] = '';
$msg['da'] = 0;
$msg['color'] = $u->info['chatColor'];
$_POST['msg'] = $filter->antimat($_POST['msg']);
//Нормируем типы сообщений
if(preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to']))
{
$msg['to'] = $msg['to'][1];
$_POST['msg'] = str_replace('private['.$msg['to'].']','private ['.$msg['to'].']',$_POST['msg']); $msg['to'] = '';
}elseif(preg_match("/to\[(.*?)\]/", $_POST['msg'], $msg['to']))
{
$msg['to'] = $msg['to'][1];
$_POST['msg'] = str_replace('to['.$msg['to'].']','to ['.$msg['to'].']',$_POST['msg']); $msg['to'] = '';
}
if(preg_match("/private \[(.*?)\]/", $_POST['msg'], $msg['to']))
{
$msg['to'] = trim($msg['to']['1'],' '); $msg['type'] = 3; $_POST['msg'] = str_replace('private ['.$msg['to'].']',' ',$_POST['msg']);
}elseif(preg_match("/to \[(.*?)\]/", $_POST['msg'], $msg['to']))
{
$msg['to'] = trim($msg['to']['1'],' '); $msg['type'] = 2; $_POST['msg'] = str_replace('to ['.$msg['to'].']',' ',$_POST['msg']);
}
if($u->info['admin'] == 0 ) { //ТУТ SPAM
if( $msg['to'] != '' && !isset($admq['id']) ) {
$admq = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "'.mysql_real_escape_string($msg['to']).'" AND `admin` > 0 LIMIT 1'));
if( $msg['type'] != 3 ) {
unset($admq);
}
}
if(!isset($admq['id'])) {
$msg['fspam'] = $filter->spamFiltr(str_replace('точка','.',str_replace('ру','ru',$_POST['msg'])));
if($msg['fspam']!='0')
{
$msg['spam'] = 1; $msg['delete'] = 1;
$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Повторные попытки могут привести к блокировке персонажа.","Black","1","1","0"]);';
}
if($msg['spam'] == 1 && $u->info['molch1']