battles/ch.php

581 lines
48 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
session_start();
header("Cache-Control: no-cache");
if(!isset($_SESSION['uid'])) { echo "<script>top.window.location='index.php'</script>"; die(); }
include_once 'config.php';
include_once 'functions.php';
$user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc();
db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(),$user['id']);
function tolink($buf) {
$x = explode(" ", $buf);
$newbuf = '';
for($j = 0; $j < count($x); $j++) {
if(preg_match("/(http:\\/\\/)?([a-z_0-9-.]+\\.oldcombats+\\.org(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/", $x[$j], $ok)) {
$newbuf .= str_replace($ok[2],"<small><a href=http://$ok[2] target=_blank ><i>[Внутреняя ссылка]</i></a></small>", str_replace("http://", "", $x[$j]))." ";
} else {
$newbuf .= $x[$j]." ";
}
}
return $newbuf;
}
if(isset($_GET['online']) && $_GET['online'] != null) {
if($_GET['room'] && (int)$_GET['room'] < 500) { $user['room'] = (int)$_GET['room']; }
if($_GET['chview'] == 2) {
$data = mysql_query('SELECT `align`, `u`.`id`, `klan`, `action`, `level`, `login`, `u`.`battle` AS `in_battle`, `o`.`date`, `u`.`invis`, (SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`, (SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`, `deal` FROM `online` AS `o`, `users` AS `u` WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= '.(time()-90).' OR `u`.`in_tower` = 1) AND `u`.`id` IN (SELECT `friend` FROM `friends` WHERE `user` = "'.$user['id'].'" AND `friend` > 0) ORDER by `u`.`login`');
$ttl = "<font style=\"color: #8f0000; font-size: 10pt;\"><b>Друзья онлайн (".mysql_num_rows($data).")</b></font>";
$ch1 = '_passive'; $ch2 = '_active'; $ch3 = '_passive'; $ch4 = '_passive'; $ch5 = '_passive';
} elseif($_GET['chview'] == 3) {
$data = mysql_query('SELECT `align`, `u`.`id`, `klan`, `action`, `level`, `login`, `u`.`battle` AS `in_battle`, `o`.`date`, `u`.`invis`, (SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`, (SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`, `deal` FROM `online` AS `o`, `users` AS `u` WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= '.(time()-90).' OR `u`.`in_tower` = 1) AND ((`u`.`align` > 1 AND `u`.`align` < 2) OR `u`.`align` = 2.99) ORDER by `u`.`login`');
$ttl = "<font style=\"color: #8f0000; font-size: 10pt;\"><b>Паладины онлайн (".mysql_num_rows($data).")</b></font>";
$ch1 = '_passive'; $ch2 = '_passive'; $ch3 = '_active'; $ch4 = '_passive'; $ch5 = '_passive';
} elseif($_GET['chview'] == 4) {
$data = mysql_query('SELECT `align`, `u`.`id`, `klan`, `action`, `level`, `login`, `u`.`battle` AS `in_battle`, `o`.`date`, `u`.`invis`, (SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`, (SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`, `deal` FROM `online` AS `o`, `users` AS `u` WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= '.(time()-90).' OR `u`.`in_tower` = 1) AND (`u`.`deal` > 0 OR `u`.`align` = 2.99) ORDER by `u`.`login`');
$ttl = "<font style=\"color: #8f0000; font-size: 10pt;\"><b>Алхимики онлайн (".mysql_num_rows($data).")</b></font>";
$ch1 = '_passive'; $ch2 = '_passive'; $ch3 = '_passive'; $ch4 = '_active'; $ch5 = '_passive';
} elseif($_GET['chview'] == 5) {
$data = mysql_query('SELECT `align`, `u`.`id`, `klan`, `action`, `level`, `login`, `u`.`battle` AS `in_battle`, `o`.`date`, `u`.`invis`, (SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`, (SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`, `deal` FROM `online` AS `o`, `users` AS `u` WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= '.(time()-90).' OR `u`.`in_tower` = 1) AND `u`.`klan` = "'.$user['klan'].'" ORDER by `u`.`login`');
$ttl = "<font style=\"color: #8f0000; font-size: 10pt;\"><b>Соклановцы онлайн (".mysql_num_rows($data).")</b></font>";
$ch1 = '_passive'; $ch2 = '_passive'; $ch3 = '_passive'; $ch4 = '_passive'; $ch5 = '_active';
} elseif($user['caveleader'] > 0) {
$data = mysql_query('SELECT `align`, `u`.`id`, `klan`, `level`, `login`, `u`.`battle` AS `in_battle`, `o`.`date`, `u`.`invis`, (SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`, (SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`, `deal` FROM `online` AS `o`, `users` AS `u` WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= '.(time()-90).' OR `u`.`in_tower` = 1) AND `o`.`room` = "'.$user['room'].'" AND `u`.`caveleader` = "'.$user['caveleader'].'" ORDER by `u`.`login`');
$ttl = "<font style=\"color: #8f0000; font-size: 10pt;\"><b>".$rooms[$user['room']]." (".mysql_num_rows($data).")</b></font>";
$ch1 = '_active'; $ch2 = '_passive'; $ch3 = '_passive'; $ch4 = '_passive'; $ch5 = '_passive';
} elseif($user['room'] == 760) {
$forest = mysql_fetch_array(mysql_query('SELECT `id`, `room`, `time`, `user`, `data` FROM `forest` WHERE `user` = "'.$user['id'].'" LIMIT 1'));
$sp = mysql_query('SELECT `id`, `room`, `user` FROM `forest` WHERE `room` = "'.$forest['room'].'"');
while($pl = mysql_fetch_array($sp)) {
$uss .= ', ';
$uss .= $pl['user'];
}
if($uss != '') {
$uss = ltrim($uss, ', ');
}
$data = mysql_query('SELECT `align`, `u`.`id`, `klan`, `action`, `level`, `login`, `u`.`battle` AS `in_battle`, `o`.`date`, `u`.`invis`, (SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`, (SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`, `deal` FROM `online` AS `o`, `users` AS `u` WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= '.(time()-90).' OR `u`.`in_tower` = 1) AND `u`.`id` IN ('.$uss.') ORDER by `u`.`login`');
$ttl = "<font style=\"color: #8f0000; font-size: 10pt;\"><b>".$var_map[$forest['room']]." (".mysql_num_rows($data).")</b></font>";
$ch1 = '_active'; $ch2 = '_passive'; $ch3 = '_passive'; $ch4 = '_passive'; $ch5 = '_passive';
} else {
$data = mysql_query('SELECT `align`, `u`.`id`, `klan`, `action`, `level`, `login`, `u`.`battle` AS `in_battle`, `o`.`date`, `u`.`invis`, (SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = `u`.`id` LIMIT 1) AS `slp`, (SELECT `id` FROM `effects` WHERE (`type` = 11 OR `type` = 12 OR `type` = 13 OR `type` = 14) AND `owner` = `u`.`id` LIMIT 1) AS `trv`, `deal` FROM `online` AS `o`, `users` AS `u` WHERE `o`.`id` = `u`.`id` AND (`o`.`date` >= '.(time()-90).' OR `u`.`in_tower` = 1) AND `o`.`room` = "'.$user['room'].'" ORDER by `u`.`login`');
$ttl = "<font style=\"color: #8f0000; font-size: 10pt;\"><b>".$rooms[$user['room']]." (".mysql_num_rows($data).")</b></font>";
$ch1 = '_active'; $ch2 = '_passive'; $ch3 = '_passive'; $ch4 = '_passive'; $ch5 = '_passive';
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<meta charset="utf-8">
<script>
function fastshow(content) {
var el = document.getElementById("mmoves");
var o = window.event.srcElement;
if(content != '' && el.style.visibility != "visible") {
el.innerHTML = '<small>'+content+'</small>';
}
var x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft + 3;
var y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop + 5;
el.style.left = x + "px";
el.style.top = y + "px";
if(el.style.visibility != "visible") {
el.style.visibility = "visible";
}
}
function hideshow() {
document.getElementById("mmoves").style.visibility = 'hidden';
}
function w(name, id, in_battle, align, klan, act, level, slp, trv, deal, name2, battle) {
if (align.length>0) {align='<img src="i/align_'+align+'.gif" title="Склонность персонажа" width=12 height=15>';}
if(deal>0) {style = 'color: chocolate;';}
else if(id == 10022) {style = 'color: red;';}
else {style='';}
if (!name2) name2=name;
if (klan.length>0) {klan='<img src="i/klan/'+klan+'.gif" title="'+klan+'">';}
document.write('<A HREF="javascript:top.AddToPrivate(\''+name+'\', top.CtrlPress)" target=refreshed><img src="i/');
if (in_battle>0) { document.write('lock2.gif'); } else {document.write('lock.gif'); }
document.write('" title="Приват"></A>'+align+'<a href="(\''+name+'\',true)"></a>'+klan+''+act+'<a href="javascript:top.AddTo(\''+name+'\')" target=refreshed style=\''+style+'\'>'+name2+'</a>['+level+']<a href="inf.php?'+id+'" target=_blank title="Инф. о '+name+'">'+'<IMG SRC="i/inf.gif" WIDTH=12 HEIGHT=11 BORDER=0 ALT="Инф. о '+name+'"></a>');
if (slp>0) { document.write(' <IMG SRC="i/sleep2.gif" WIDTH=24 HEIGHT=15 BORDER=0 ALT="Наложено заклятие молчания">'); }
if (trv>0) { document.write(' <IMG SRC="i/travma2.gif" WIDTH=24 HEIGHT=15 BORDER=0 ALT="Инвалидность">'); }
if (in_battle>0) { document.write(' <IMG SRC="i/b.jpg" WIDTH=15 HEIGHT=15 BORDER=0 title="Персонаж в поединке"></a>'); }
document.write('<BR>');
}
top.rld();
</script>
<title><?=$rooms[$user['room']],' (',mysql_num_rows($data)?>)</title>
</head>
<body style="margin: 0px; padding: 0px; background: #EEEEEE;" onscroll="top.myscroll()" onload="document.body.scrollTop=top.OnlineOldPosition">
<? if($user['first'] != 99) { ?>
<center><div id="mini_qsst" onclick="top.frames['main'].location.href='kwest.php';" style="cursor: pointer; display: block;"><img src="i/bot_q/mini_wm1.png" width="35" height="35" /></div></center>
<? } ?>
<center>
<? if(!$_GET['rms']) { ?>
<div id="fixednew" style="position: fixed; margin: 0px; padding: 0px; z-index: 9; width: 100%; text-align: center; overflow: auto;">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><img align="left" onclick="this.src='i/buttons/ch1_passive.jpg'; location.href='ch.php?online='+Math.random();" src="i/buttons/ch1<?=$ch1;?>.jpg" /></td>
<td><img align="left" title="Друзья" style="cursor: pointer;" onclick="this.src='i/buttons/ch1_passive.jpg'; location.href='ch.php?online='+Math.random()+'&amp;chview=2';" src="i/buttons/ch2<?=$ch2;?>.jpg" /></td>
<td><img align="left" title="Паладины" style="cursor: pointer;" onclick="location.href='ch.php?online='+Math.random()+'&amp;chview=3';" src="i/buttons/ch3<?=$ch3;?>.jpg" /></td>
<td><img align="left" title="Дилеры" style="cursor: pointer;" onclick="location.href='ch.php?online='+Math.random()+'&amp;chview=4';" src="i/buttons/ch4<?=$ch4;?>.jpg" /></td>
<? if(!empty($user['klan'])) { ?>
<td><img align="left" title="Соклановцы" style="cursor: pointer;" onclick="location.href='ch.php?online='+Math.random()+'&amp;chview=5';" src="i/buttons/ch5<?=$ch5;?>.jpg" /></td>
<? } ?>
</tr>
</tbody>
</table>
</div><br /><br /><br />
<? } ?>
<div id="mmoves" style="background-color: #FFFFCC; visibility:hidden; overflow: visible; position: absolute; border-color: #666666; border-style: solid; border-width: 0px; padding: 0px; white-space: nowrap; display: block; vertical-align: middle; word-wrap: break-word;"></div>
<?
if(!$_GET['room']) {
if(!isset($_GET['chview']) || $_GET['chview'] == 1) {
echo '<input type=\'button\' onclick=\'location.href="ch.php?online='.rand(100000, 9999999).'";\' value=\'Обновить\' />';
} else {
echo '<input type=\'button\' onclick=\'location.href="ch.php?online='.rand(100000, 9999999).'&chview='.(int)$_GET['chview'].'";\' value=\'Обновить\' />';
}
}
?>
<? echo '<br />'.$ttl.'<br />'; ?>
</center>
<table border=0><tr><td nowrap>
<script>
<?php
while($row = mysql_fetch_array($data)) {
if($row['in_battle'] > 0) { $in_battle = 1; } else { $in_battle = 0; }
if($row['invis'] > 0 && $row['id'] == $_SESSION['uid']) { $row['login2'] = $row['login']."</a> (невидимка)"; }
if($row['invis'] == 0 || $row['id'] == $_SESSION['uid']) {
# if($row['id'] == 10022) { $row['align'] = 0; $row['klan'] = 0; $row['level'] = '??'; } //Потом вернём. Мешает отладке. Ins.
if(!empty($row['action'])) {
$rrr = $row['action'];
$act = explode("<>:<>", $rrr);
$aa = htmlspecialchars(stripslashes_deep($act[1]));
$aa = eregi_replace("/afk ", "", $aa);
$aa = eregi_replace("/dnd ", "", $aa);
$aa = eregi_replace("/buy ", "", $aa);
$aa = eregi_replace("/sell ", "", $aa);
$act_line = " <span onmouseover=\"fastshow(\'$aa\')\" onmouseout=\"hideshow()\"><b><small>{$act[0]}</small></b></span> ";
} else $act_line = '';
echo 'w(\'',$row['login'],'\',',$row['id'],',',$in_battle,',\'',$row['align'],'\',\''.ClanImage($row['klan']).'\', \''.$act_line.'\',\'',$row['level'],'\',\'',$row['slp'],'\',\'',$row['trv'],'\',\'',(int)$row['deal'],'\',\'',$row['login2'],'\');';
}
}
?>
</script>
</td></tr></table>
<?php
if (!$_GET['room']) {
?>
<SCRIPT>document.write('<INPUT TYPE=checkbox onclick="if(this.checked == true) { top.OnlineStop = false; } else { top.OnlineStop = true; }" '+(top.OnlineStop?'':'checked')+'> Обновлять автомат.')
</SCRIPT></body></html>
<?php
die();
}
}
elseif (@$_GET['show'] != null) {
if($_SESSION['sid'] != $user['sid']) {
$_SESSION['uid'] = null;
die ("<script>top.location.href='index.php';</script>");
}
$cha = file("tmp/chat.txt");
header('Content-Type: text/html; charset=utf-8');
echo "<script>";
$ks = 0;
foreach($cha as $k => $v) {
preg_match("/:\[(.*)\]:\[(.*)\]:\[(.*)]:\[(.*)\]/", $v, $math);
if($math[1] > time()-60) {
$math[3] = stripslashes($math[3]);
//echo "console.log($math[1]|$math[2]|$math[3]);";
if ((@$math[2] == '{[]}'.$user['login'].'{[]}') && (@$math[1] >= @$user['chattime'])) {
echo "top.frames['chat'].document.all(\"mes\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> ".$math[3]." <BR>';";
echo "top.frames['chat'].document.all(\"mes_system\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> ".$math[3]." <BR>';";
echo "top.show_new(\"wtab1\"); top.show_new(\"wtab5\");";
$ks++;
$lastpost = $math[1];
} elseif(substr($math[2], 0, 4) == '{[]}' && (@$math[1] >= @$user['chattime'])) {
//exit;
} elseif ((@$math[2] == '!sys!!') && (@$math[1] >= @$user['chattime']) /*&& ($user['room']==$math[4])*/ && $_GET['om'] != 1) {
if($_GET['sys'] == 1 || strpos($math[3],"<img src=i/magic/" ) !== FALSE) {
echo "top.frames['chat'].document.all(\"mes\").innerHTML += '<span class=date>".date("H:i",$math[1])."</span> ".$math[3]." <BR>';";
echo "top.frames['chat'].document.all(\"mes_system\").innerHTML += '<span class=date>".date("H:i",$math[1])."</span> ".$math[3]." <BR>';";
echo "top.show_new(\"wtab5\");";
$ks++;
$lastpost = $math[1];
}
}
elseif (@$math[2] == '!sys2all!!' && @$math[1] >= @$user['chattime']) {
echo "top.frames['chat'].document.all(\"mes\").innerHTML += '<span class=date>".date("H:i",$math[1])."</span> ".$math[3]." <BR>';";
echo "top.frames['chat'].document.all(\"mes_system\").innerHTML += '<span class=date>".date("H:i",$math[1])."</span> ".$math[3]."<BR>';";
echo "top.show_new(\"wtab5\");";
$ks++;
$lastpost = $math[1];
} elseif ((@$math[2] == '!cavesys!!') && (@$math[1] >= @$user['chattime']) && ($user['caveleader']==$math[4])) {
echo "top.frames['chat'].document.getElementById(\"mes\").innerHTML += '<span class=date>".date("H:i",$math[1])."</span> ".$math[3]." <BR>';";
echo "top.frames['chat'].document.all(\"mes_system\").innerHTML += '<span class=date>".date("H:i",$math[1])."</span> ".$math[3]."<BR>';";
echo "top.show_new(\"wtab5\");";
$ks++;
$lastpost = $math[1];
} elseif (@$math[1] >= @$user['chattime']) {
if(strpos($math[3], "private [klan-{$user['klan']}-") !== FALSE) {
$pos = strpos($math[3], "[klan-{$user['klan']}-")+strlen($user['klan'])+7;
} elseif(((strpos($math[3], "private [help]") !== FALSE))) {
$math[3] = preg_replace("/private \[help]/Ue", "", $math[3]);
echo "top.frames['chat'].document.all(\"mes_help\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]." <BR>';";
if($math[2] != $user['login'] && $user['align'] == 2.99) {
echo "top.show_new(\"wtab6\");";
}
$ks++;
$lastpost = $math[1];
} elseif(((strpos($math[3], "private [trade]") !== FALSE))) {
$math[3] = preg_replace("/private \[trade]/Ue", "", $math[3]);
echo "top.frames['chat'].document.all(\"mes_trade\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]." <BR>';";
if($math[2] != $user['login']) {
echo "top.show_new(\"wtab8\");";
}
$ks++;
$lastpost = $math[1];
} elseif (strpos($math[3],"private [pal]") !== FALSE) {
if((int)$user['align'] == 1 || $user['admin'] == 1) {
$math[3] = preg_replace("/private \[pal]/Ue", "", $math[3]);
echo "top.frames['chat'].document.all(\"mes_pal\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]." <BR>';";
$ks++;
$lastpost = $math[1];
}
} elseif(((strpos($math[3], "private [klan-{$user['klan']}]") !== FALSE))) {
if($user['klan'] != '') {
$math[3] = preg_replace("/private \[klan\-{$user['klan']}\]/Ue", "", $math[3]);
echo "top.frames['chat'].document.all(\"mes_klan\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]." <BR>';";
if($math[2] != $user['login']) {
echo "top.show_new(\"wtab3\");";
}
$ks++;
$lastpost = $math[1];
}
} elseif(((strpos($math[3], "private [{$user['login']}]") !== FALSE))) {
$sound = false;
preg_match_all("/private \[(.*)\]/siU", $math[3], $mmm, PREG_PATTERN_ORDER);
foreach($mmm[1] as $res) {
$res = trim($res);
$res = iconv("utf-8", "utf-8", $res);
if($sound == false) $sound = ($res == $user['login'])?true:false;
if(strlen($res) < 3 || strlen($res) > 120 || !preg_match("/^[ёa-zA-Zа-яА-Я0-9-][ёa-zA-Zа-яА-Я0-9_ -]+[a-zA-Zа-яА-Я0-9ё-]$/", $res) || preg_match("/__/", $res) || preg_match("/--/", $res) || preg_match("/ /", $res) || preg_match("/(.)\\1\\1\\1/", $res)) {
$math[3] = str_replace($res, $user['login'], $math[3]);
}
}
$math[3] = preg_replace("/private \[(.*)\]/Ue", "'<a href='.chr(92).'\'javascript:top.AddToPrivate(\"'.(('\\1' != '".$user['login']."')?'\\1':'".$math[2]."').'\",false)'.chr(92).'\' class=private>private [ <span oncontextmenu=\"return OpenMenu(event,".$user['level'].")\">\\1</span> ]</a>'", $math[3]);
$sssss = "top.frames['chat'].document.all(\"mes\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]."<BR>';";
echo "top.frames['chat'].document.all(\"mes_private\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]." <BR>';";
if ($sound == true) { $sssss .= "top.soundD();"; }
echo $sssss;
$ks++;
$lastpost = $math[1];
unset($math[3]);
} elseif($math[2] == $user['login']) {
$sound = false;
preg_match_all("/private \[(.*)\]/siU", $math[3], $mmm, PREG_PATTERN_ORDER);
foreach($mmm[1] as $res) {
$res = trim($res);
$res = iconv("utf-8", "utf-8", $res);
if($sound == false) $sound = ($res == $user['login'])?true:false;
if(strlen($res) < 3 || strlen($res) > 120 || !preg_match("/^[ёa-zA-Zа-яА-Я0-9-][ёa-zA-Zа-яА-Я0-9_ -]+[a-zA-Zа-яА-Я0-9ё-]$/", $res) || preg_match("/__/", $res) || preg_match("/--/", $res) || preg_match("/ /", $res) || preg_match("/(.)\\1\\1\\1/", $res)) {
$math[3] = str_replace($res, $user['login'], $math[3]);
}
}
$math[3] = preg_replace("/private \[(.*)\]/Ue", "'<a href='.chr(92).'\'javascript:top.AddToPrivate(\"'.(('\\1' != '".$user['login']."')?'\\1':'".$math[2]."').'\",false)'.chr(92).'\' class=private>private [ <span oncontextmenu=\"return OpenMenu(event,".$user['level'].")\">\\1</span> ]</a>'", $math[3]);
$sssss = "top.frames['chat'].document.all(\"mes\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]."<BR>';";
$sssss .= "top.frames['chat'].document.all(\"mes_private\").innerHTML += '<span class=date2>".date("H:i",$math[1])."</span> [<a href=\'javascript:top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]."<BR>';";
if ($sound == true) { $sssss .= "top.soundD();"; }
echo $sssss;
$ks++;
$lastpost = $math[1];
unset($math[3]);
} elseif((strpos($math[3], "private") === FALSE) /*&& ($user['room'] == $math[4])*/) {
$times = '';
$soundON = '';
if((strpos($math[3], "[".$user['login']."]") > 0) || ($math[2] == $user['login'])) {
$times = 'date2';
$math[3] = str_replace("to [".$user['login']."]", "<b>to [".$user['login']."]</b>", $math[3]);
$soundON = 'top.soundD();';
} elseif($_GET['om'] != 1) {
$times = 'date';
}
if($_GET['om'] != 1 || $times == 'date2') {
echo $soundON."top.frames['chat'].document.all(\"mes\").innerHTML += '<span class={$times}>".date("H:i",$math[1])."</span> [<a href=\'top.AddTo(\"{$math[2]}\")\'><span oncontextmenu=\'return OpenMenu(event,".$user['level'].")\'>{$math[2]}</span></a>] ".$math[3]."<BR>';";
$ks++;
$lastpost = $math[1];
}
}
}
}
}
if($ks > 0) {
mysql_query("UPDATE `users` SET `chattime` = '".($lastpost+1)."' WHERE `id` = {$user['id']} LIMIT 1");
}
echo "</script><script>top.srld();</script>";
mysql_query("UPDATE `online` SET `date` = ".time()." WHERE `id` = {$user['id']} LIMIT 1");
die();
}
else
{
if (strpos($_GET['text'], "private" ) !== FALSE && $user['level'] < 1) {
preg_match_all("/\[(.*)\]/U", $_GET['text'], $matches);
for ($ii=0;$ii<count($matches[1]);$ii++){
$dde = mysql_fetch_array(mysql_query("SELECT `id` FROM `users` WHERE (`deal` = 1 OR (`align`>1 AND `align`<2)) AND `login` = '".trim($matches[1][$ii])."' LIMIT 1 ;"));
if (!$dde['id']) {
exit();
}
}
}
if (@trim($_GET['text']) != null) {
$rr = mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `type` = 2 AND `owner` = {$user['id']};"));
# Ограничения на ввод символов в чат!
if (!isset($rr['id'])) {
$_GET['text'] = substr($_GET['text'], 0, 1024); // Ограничние на символы в чате!
$_GET['text'] = str_replace('<', '&lt;', $_GET['text']);
$_GET['text'] = str_replace(']:[', '] : [', $_GET['text']);
$_GET['text'] = str_replace('>', '&gt;', $_GET['text']);
$_GET['text'] = preg_replace('/private \[klan-([a-zA-Z]*)\]/', '', $_GET['text']);
if ($user['klan'] == '') {
$_GET['text'] = str_replace('private [klan]','',$_GET['text']);
$_GET['text'] = str_replace('private [klan]','private [klan-'.$user['klan'].']',$_GET['text']);
} else {
$_GET['text'] = str_replace('private [klan]','private [klan-'.$user['klan'].']',$_GET['text']);
$_GET['text'] = preg_replace('/private \[klan-([1-9])\]/','private [klan-'.$user['klan'].']',$_GET['text']);
$pos = strpos($_GET['text'],"[klan-{$user['klan']}" )+strlen($user['klan'])+7;
}
if($_GET['chtype'] == 6 && stristr($_GET['text'], 'private') === FALSE) {
$_GET['text'] = 'private [help] '.$_GET['text'];
} elseif($_GET['chtype'] == 8 && stristr($_GET['text'], 'private') === FALSE) {
$_GET['text'] = 'private [trade] '.$_GET['text'];
} elseif($_GET['chtype'] == 3 && $user['klan'] != '') {
$_GET['text'] = 'private [klan-'.$user['klan'].'] '.$_GET['text'];
} elseif($_GET['chtype'] == 4 && (((int)$user['align'] == 1) || $user['admin'] == 1)) {
$_GET['text'] = 'private [pal] '.$_GET['text'];
}
if((int)$user['align'] != 1 && $user['admin'] != 1) {
$_GET['text'] = str_replace('private [pal]', '', $_GET['text']);
}
if(strstr($_GET['text'], "/g_nologin") && (in_array($user['align'], $var_security['g_nologin']['align']) || in_array($user['id'], $var_security['g_nologin']['id']))){
$temp = str_replace('/g_nologin', '', $_GET['text']);
AddChatSystem('<b style="color: Red;">'.$temp.'</b>');
$action = 1;
unset($temp);
}
if(strstr($_GET['text'], "/g_login") && (in_array($user['align'], $var_security['g_login']['align']) || in_array($user['id'], $var_security['g_login']['id']))) {
$temp = str_replace('/g_login', '', $_GET['text']);
AddChatSystem('<b style="color: Red;">['.$user['login'].']</b> <font style="color: Red;">'.$temp.'</font>');
$action = 1;
unset($temp);
}
#Надо запомнить и дать паладинам возможность затыкать из чата.
/*
if(strstr($_GET['text'], "/afk")) {
$action = 1;
$tmp = str_replace('/afk', '', $_GET['text']);
mysql_query("UPDATE `users` SET `action` = 'afk<>:<>{$tmp}' WHERE `id` = '{$user['id']}' LIMIT 1");
} elseif(strstr($_GET['text'], "/dnd")) {
$action = 1;
$tmp = str_replace('/dnd', '', $_GET['text']);
mysql_query("UPDATE `users` SET `action` = 'dnd<>:<>{$tmp}' WHERE `id` = '{$user['id']}' LIMIT 1");
} elseif(strstr($_GET['text'], "/sell")) {
$action = 1;
$tmp = str_replace('/sell', '', $_GET['text']);
mysql_query("UPDATE `users` SET `action` = 'sell<>:<>{$tmp}' WHERE `id` = '{$user['id']}' LIMIT 1");
} elseif(strstr($_GET['text'], "/buy")) {
$action = 1;
$tmp = str_replace('/buy', '', $_GET['text']);
mysql_query("UPDATE `users` SET `action` = 'buy<>:<>{$tmp}' WHERE `id` = '{$user['id']}' LIMIT 1");
} elseif(strstr($_GET['text'], "/off")) {
$action = 1;
mysql_query("UPDATE `users` SET `action` = '' WHERE `id` = '{$user['id']}' LIMIT 1");
}
*/
unset($tmp);
# Упростил тот Адъ и Израиль до одной нормальной строчки, которая вырежет все ссылки.
if(!preg_match("/capitalcity.old-dark.ru/", $_GET['text']) || !preg_match("/imgur.com/", $_GET['text'])) {
$_GET['text'] = preg_replace("@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@",'<i style="color:silver;"><РАП/РВС></i>',$_GET['text']);
}
$smiles = array("/:flowers:/","/:inv:/","/:hug:/","/:horse:/","/:str:/","/:susel:/","/:smile:/","/:laugh:/","/:fingal:/","/:eek:/","/:smoke:/","/:hi:/","/:bye:/","/:king:/","/:king2:/","/:boks2:/","/:boks:/","/:gent:/","/:lady:/","/:tongue:/","/:smil:/","/:rotate:/","/:ponder:/","/:bow:/","/:angel:/","/:angel2:/","/:hello:/","/:dont:/","/:idea:/", "/:mol:/", "/:super:/","/:beer:/","/:drink:/","/:baby:/","/:tongue2:/", "/:sword:/", "/:agree:/","/:loveya:/","/:kiss:/","/:kiss2:/", "/:kiss3:/", "/:kiss4:/","/:rose:/","/:love:/","/:love2:/", "/:confused:/", "/:yes:/","/:no:/","/:shuffle:/","/:nono:/","/:maniac:/","/:privet:/","/:ok:/","/:ninja:/","/:pif:/", "/:smash:/","/:alien:/","/:pirate:/","/:gun:/","/:trup:/","/:mdr:/", "/:sneeze:/","/:mad:/","/:friday:/","/:cry:/","/:grust:/","/:rupor:/","/:fie:/", "/:nnn:/","/:row:/","/:red:/","/:lick:/","/:help:/","/:wink:/","/:jeer:/","/:tease:/","/:kruger:/","/:girl:/","/:Knight1:/","/:rev:/","/:smile100:/","/:smile118:/","/:smile149:/","/:smile166:/","/:smile237:/","/:smile245:/","/:smile28:/","/:smile289:/","/:smile314:/","/:smile36:/","/:smile39:/","/:smile44:/","/:smile70:/","/:smile87:/","/:smile434:/","/:vamp:/");
$smiles2 = array("<img style=\"cursor:pointer;\" onclick=S(\"flowers\") src=i/smiles/flowers.gif>","<img style=\"cursor:pointer;\" onclick=S(\"inv\") src=i/smiles/inv.gif>","<img style=\"cursor:pointer;\" onclick=S(\"hug\") src=i/smiles/hug.gif>","<img style=\"cursor:pointer;\" onclick=S(\"horse\") src=i/smiles/horse.gif>","<img style=\"cursor:pointer;\" onclick=S(\"str\") src=i/smiles/str.gif>","<img style=\"cursor:pointer;\" onclick=S(\"susel\") src=i/smiles/susel.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile\") src=i/smiles/smile.gif>","<img style=\"cursor:pointer;\" onclick=S(\"laugh\") src=i/smiles/laugh.gif>","<img style=\"cursor:pointer;\" onclick=S(\"fingal\") src=i/smiles/fingal.gif>","<img style=\"cursor:pointer;\" onclick=S(\"eek\") src=i/smiles/eek.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smoke\") src=i/smiles/smoke.gif>","<img style=\"cursor:pointer;\" onclick=S(\"hi\") src=i/smiles/hi.gif>","<img style=\"cursor:pointer;\" onclick=S(\"bye\") src=i/smiles/bye.gif>","<img style=\"cursor:pointer;\" onclick=S(\"king\") src=i/smiles/king.gif>","<img style=\"cursor:pointer;\" onclick=S(\"king2\") src=i/smiles/king2.gif>","<img style=\"cursor:pointer;\" onclick=S(\"boks2\") src=i/smiles/boks2.gif>","<img style=\"cursor:pointer;\" onclick=S(\"boks\") src=i/smiles/boks.gif>","<img style=\"cursor:pointer;\" onclick=S(\"gent\") src=i/smiles/gent.gif>","<img style=\"cursor:pointer;\" onclick=S(\"lady\") src=i/smiles/lady.gif>","<img style=\"cursor:pointer;\" onclick=S(\"tongue\") src=i/smiles/tongue.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smil\") src=i/smiles/smil.gif>","<img style=\"cursor:pointer;\" onclick=S(\"rotate\") src=i/smiles/rotate.gif>","<img style=\"cursor:pointer;\" onclick=S(\"ponder\") src=i/smiles/ponder.gif>","<img style=\"cursor:pointer;\" onclick=S(\"bow\") src=i/smiles/bow.gif>","<img style=\"cursor:pointer;\" onclick=S(\"angel\") src=i/smiles/angel.gif>","<img style=\"cursor:pointer;\" onclick=S(\"angel2\") src=i/smiles/angel2.gif>","<img style=\"cursor:pointer;\" onclick=S(\"hello\") src=i/smiles/hello.gif>","<img style=\"cursor:pointer;\" onclick=S(\"dont\") src=i/smiles/dont.gif>","<img style=\"cursor:pointer;\" onclick=S(\"idea\") src=i/smiles/idea.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"mol\") src=i/smiles/mol.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"super\") src=i/smiles/super.gif>","<img style=\"cursor:pointer;\" onclick=S(\"beer\") src=i/smiles/beer.gif>","<img style=\"cursor:pointer;\" onclick=S(\"drink\") src=i/smiles/drink.gif>","<img style=\"cursor:pointer;\" onclick=S(\"baby\") src=i/smiles/baby.gif>","<img style=\"cursor:pointer;\" onclick=S(\"tongue2\") src=i/smiles/tongue2.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"sword\") src=i/smiles/sword.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"agree\") src=i/smiles/agree.gif>","<img style=\"cursor:pointer;\" onclick=S(\"loveya\") src=i/smiles/loveya.gif>","<img style=\"cursor:pointer;\" onclick=S(\"kiss\") src=i/smiles/kiss.gif>","<img style=\"cursor:pointer;\" onclick=S(\"kiss2\") src=i/smiles/kiss2.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"kiss3\") src=i/smiles/kiss3.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"kiss4\") src=i/smiles/kiss4.gif>","<img style=\"cursor:pointer;\" onclick=S(\"rose\") src=i/smiles/rose.gif>","<img style=\"cursor:pointer;\" onclick=S(\"love\") src=i/smiles/love.gif>","<img style=\"cursor:pointer;\" onclick=S(\"love2\") src=i/smiles/love2.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"confused\") src=i/smiles/confused.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"yes\") src=i/smiles/yes.gif>","<img style=\"cursor:pointer;\" onclick=S(\"no\") src=i/smiles/no.gif>","<img style=\"cursor:pointer;\" onclick=S(\"shuffle\") src=i/smiles/shuffle.gif>","<img style=\"cursor:pointer;\" onclick=S(\"nono\") src=i/smiles/nono.gif>","<img style=\"cursor:pointer;\" onclick=S(\"maniac\") src=i/smiles/maniac.gif>","<img style=\"cursor:pointer;\" onclick=S(\"privet\") src=i/smiles/privet.gif>","<img style=\"cursor:pointer;\" onclick=S(\"ok\") src=i/smiles/ok.gif>","<img style=\"cursor:pointer;\" onclick=S(\"ninja\") src=i/smiles/ninja.gif>","<img style=\"cursor:pointer;\" onclick=S(\"pif\") src=i/smiles/pif.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"smash\") src=i/smiles/smash.gif>","<img style=\"cursor:pointer;\" onclick=S(\"alien\") src=i/smiles/alien.gif>","<img style=\"cursor:pointer;\" onclick=S(\"pirate\") src=i/smiles/pirate.gif>","<img style=\"cursor:pointer;\" onclick=S(\"gun\") src=i/smiles/gun.gif>","<img style=\"cursor:pointer;\" onclick=S(\"trup\") src=i/smiles/trup.gif>","<img style=\"cursor:pointer;\" onclick=S(\"mdr\") src=i/smiles/mdr.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"sneeze\") src=i/smiles/sneeze.gif>","<img style=\"cursor:pointer;\" onclick=S(\"mad\") src=i/smiles/mad.gif>","<img style=\"cursor:pointer;\" onclick=S(\"friday\") src=i/smiles/friday.gif>","<img style=\"cursor:pointer;\" onclick=S(\"cry\") src=i/smiles/cry.gif>","<img style=\"cursor:pointer;\" onclick=S(\"grust\") src=i/smiles/grust.gif>","<img style=\"cursor:pointer;\" onclick=S(\"rupor\") src=i/smiles/rupor.gif>","<img style=\"cursor:pointer;\" onclick=S(\"fie\") src=i/smiles/fie.gif>", "<img style=\"cursor:pointer;\" onclick=S(\"nnn\") src=i/smiles/nnn.gif>","<img style=\"cursor:pointer;\" onclick=S(\"row\") src=i/smiles/row.gif>","<img style=\"cursor:pointer;\" onclick=S(\"red\") src=i/smiles/red.gif>","<img style=\"cursor:pointer;\" onclick=S(\"lick\") src=i/smiles/lick.gif>","<img style=\"cursor:pointer;\" onclick=S(\"help\") src=i/smiles/help.gif>","<img style=\"cursor:pointer;\" onclick=S(\"wink\") src=i/smiles/wink.gif>","<img style=\"cursor:pointer;\" onclick=S(\"jeer\") src=i/smiles/jeer.gif>","<img style=\"cursor:pointer;\" onclick=S(\"tease\") src=i/smiles/tease.gif>","<img style=\"cursor:pointer;\" onclick=S(\"kruger\") src=i/smiles/kruger.gif>","<img style=\"cursor:pointer;\" onclick=S(\"girl\") src=i/smiles/girl.gif>","<img style=\"cursor:pointer;\" onclick=S(\"Knight1\") src=i/smiles/Knight1.gif>","<img style=\"cursor:pointer;\" onclick=S(\"rev\") src=i/smiles/rev.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile100\") src=i/smiles/smile100.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile118\") src=i/smiles/smile118.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile149\") src=i/smiles/smile149.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile166\") src=i/smiles/smile166.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile237\") src=i/smiles/smile237.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile245\") src=i/smiles/smile245.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile28\") src=i/smiles/smile28.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile289\") src=i/smiles/smile289.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile314\") src=i/smiles/smile314.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile36\") src=i/smiles/smile36.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile39\") src=i/smiles/smile39.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile44\") src=i/smiles/smile44.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile70\") src=i/smiles/smile70.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile87\") src=i/smiles/smile87.gif>","<img style=\"cursor:pointer;\" onclick=S(\"smile434\") src=i/smiles/smile434.gif>","<img style=\"cursor:pointer;\" onclick=S(\"vamp\") src=i/smiles/vamp.gif>");
preg_match_all("/\[(.*)\]/U", $_GET['text'], $matches);
for($i = 0; $i < count($matches[1]); $i++) {
$prs = mysql_fetch_array(mysql_query('SELECT `id`, `auto_text`, `login` FROM `users` WHERE `login` = "'.mysql_real_escape_string($matches[1][$i]).'" LIMIT 1'));
if(isset($prs['id']) && $prs['auto_text'] == 1 && $user['login'] != $prs['login']) {
$txt = mysql_fetch_array(mysql_query('SELECT `text` FROM `auto_text` WHERE `owner` = "'.$prs['id'].'" LIMIT 1'));
$_GET['text'] = 'private ['.$user['login'].'] Атоответчик ('.$prs['login'].'): '.$txt['text'];
}
#$_GET['text'] = 'private ['.$user['login'].'] '.trim($matches[1][$i]);
}
$prs = mysql_fetch_array(mysql_query('SELECT `id`, `auto_text`, `login` FROM `users` WHERE `login` = "'.mysql_real_escape_string($math[2]).'" LIMIT 1'));
if(isset($prs['id']) && $prs['auto_text'] == 1 && $user['login'] != $prs['login']) {
$txt = mysql_fetch_array(mysql_query('SELECT `text` FROM `auto_text` WHERE `owner` = "'.$prs['id'].'" LIMIT 1'));
$_GET['text'] = 'private ['.$user['login'].'] Атоответчик ('.$prs['login'].'): '.$txt['text'];
#addchp('<font color=red>Автоответчик</font> ('.$prs['login'].'): '.$txt['text'], '{[]}'.$user['login'].'{[]}');
}
$_GET['text'] = preg_replace($smiles, $smiles2, $_GET['text'], 3);
$_GET['text'] = tolink($_GET['text']);
if($user['invis'] == 1) {
$tme = mysql_fetch_row(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '$user[id]' AND `type` = '1022'"));
$user['login'] = '</a><b><i>невидимка '.substr($tme[0], strlen($tme[0])-4).'</i></b>';
}
# Понять бы какого чёрта условия два… Инс.
if($action != 1) {
$file = 'tmp/chat.txt';
if (filesize("tmp/chat.txt")>100*1024) {
$line = "\r\n:[".time ()."]:[{$user['login']}]:[<font color=\"".(($user['color'])?$user['color']:"#000000")."\">".($_GET['text'])."</font>]:[".$user['room']."]\r\n";
// Пишем содержимое в файл,
// используя флаг FILE_APPEND flag для дописывания содержимого в конец файла
// и флаг LOCK_EX для предотвращения записи данного файла кем-нибудь другим в данное время
// а то заебали устаревшие функции использовать. Инс.
file_put_contents($file, $line, FILE_APPEND | LOCK_EX);
echo"1";
} else {
$line = ":[".time ()."]:[{$user['login']}]:[<font color=\"".(($user['color'])?$user['color']:"#000000")."\">".($_GET['text'])."</font>]:[".$user['room']."]\r\n";
file_put_contents($file, $line, FILE_APPEND | LOCK_EX);
echo"2";
}
}
if (strpos($_GET['text'],"to [Комментатор]" ) !== FALSE) {
if (strpos($_GET['text'],"to [Комментатор] анекдот" ) !== FALSE) {
$commas = array('Артника может обидеть каждый, но не каждый успеет извиниться.',
'"Сойдет за близы" - сказал Илья Муромец завязывая вокруг шеи змея Горыныча.',
'Часы показывали 12:00, когда бойцы Армады и Орден Паладинов бросили вызов друг другу. 12:01 Internal Server Error.',
'В конкурсе по женской логике победил генератор ударов.',
'Хороший, плохой, главный тот, у кого сусел!',
'Наши комментаторы, самые <вырезано цензурой> комментаторские комментаторы в мире!'
);
addchp($commas[rand(0,count($commas)-1)],"Комментатор");
} else {
$commas = array('Так слово за слова и получил Иванушка инвалидность...',
'Шалость удалась! &copy;Мерлин',
'Брад, даи крон!',
'Это у Вас продается славянский шкаф?',
'Я твой дом, труба шатал!',
'Аффтар выпей йаду!',
'Аффтар пешы ысчо!',
'Аццкий Сотона!',
'В Бабруйск, жывотное!',
'В газенваген!',
'Гламурненько!',
'Фууууу, Фуууу... Фундаментально!',
'Жизнинна! Гони еще волну!',
'Пеши исчё!',
'Кактуззз жжот!',
'Знала бы твоя мама, о твоих проказах. Высекла тебя бы!',
'Киса куку! Ты с какова горада?',
'Ниасилил патамушта вайнаимир',
'Учи албанский!',
'Убей сибя ап стенку',
'Чмоки, в обе щеки, пративный!',
'Держи курс на систему Медузы!',
'Это тигрокрыс с планеты Пенелопа. Он питается дикими быками',
'Грубиян и невоспитанный тип!',
'До свидания, мы еще увидимся. Запомните, меня зовут Весельчак У!',
'нисмишно',
'Ты такой, клёвый!',
'Писать, читать умеешь? Будешь работать паладином. Подойди к Верховному, скажи Я разрешил!',
'Погнали Ваших городские!',
'Кто не спрятался, я не виноват!',
'Если чё, заходи, не стисняйся.',
'Трах-тибидах-тибидах! Теперь ты медуза!',
'Скройся с моих глаз!',
'Ой, всё!',
'В угол поставлю!',
'Альфа Центавра знаешь? Тамошние мы...',
'Жил был у бабушки серенький козлик? Это не про вас песенка?',
'Ыыыы, сЫроежкин, жги еще!',
'Танцуй пока молодой, мальчик!',
'За Вами уже выехали. Сухари собирайте!',
'Сам я не местный, Поможи чем можешь! Рупь дай, или два!',
'Я пью и гуляю на свои!',
'Пивная, еще парочку!',
'Поручик молчать!',
'Спокойно Маша, я Дубровский!',
'Юстас Аллексу. Примите радиограмму!',
'Профессор лопух, лопух!',
'Окропим снег красненьким?',
'На святое дело идем, товарища выручать!',
'Как здорово, что все мы здесь, сегодня собрались!',
'Пирожки, пирожки, кому пирожки? С сыром, с перцем и собачьим сердцем!',
'Ваши трехдюймовые глазки путем меткого попадания зажгли огнедышаший пожар в моем сердце. Словом, бац-бац! И в точку!',
'Ты что делаешь? Грабитель! Разбойник! Своих грабишь? Гадский папа!',
'Шо ты хапаешь, шо ты хапаешь! Не, я такой фасон не ношу.',
'стой! Снимай сапоги!',
'И шо я в тебя такой влюбленный?',
'Я же атаман идейный. И все мои паладины как один, стоят за свободную личность.',
'Гапуся, тридцать пять лет тебе говорю: не спеши!!!',
'А это не вы ехали через Янковку на арбе с сеном и заснули, а у вас тем временем волов увели?',
'Это ещё что за статуй?',
'Вашу ручку, битте-дритте!',
'Сыграй что-нить такое, чтобы душа развернулась, а потом обратно завернулась!',
'А вы гопака танцуете?',
'Вы и только Вы напоминаете мне мою любимую, мою чернявую, мою безотказную… гаубицу!',
'Будешь так продолжать, превращу тебя.... в жабу!',
'Что поговорить больше не с кем?',
'Отдыхай!',
'Вас много, комментатор - один!',
'А станете наезжать, не буду комментировать ваши бои!',
'Отвали!',
'Тренируйся на кошечках!',
'Анекдот: - Товарищ водитель, почему ваша пассажирка не пристегнута ремнями безопасности? - Так это же моя тёща!',
'Сам такой!',
'Продам кредиты (в приват)',
'мдя...',
'Лучше в бою проявляй энтузиазм.',
'Кто тут комментатор? Ты или я???',
'Надо же...',
'Сам дурак!',
'Наши комментаторы, самые <вырезано цензурой> комментаторские комментаторы в мире!',
'(судорожно оглядываясь) КТО ЗДЕСЬ???',
'Не болтайте ерундой',
'Все! Теперь ты мне должен!',
'р-р-р...',
'А в бою это повторить сможешь?',
'Я долго думал, что такое 90х60х90. Оказалось, что это 486 000.',
'Может тебе кредитов дать, чтоб отстал?',
'Твой интеллект поражает <вырезано цензурой>',
'Вот сижу тут и разбавляю свою мудрость вашей глупостью.',
'Ты с кем посоревноваться решил?',
'Ждите ответа. Ждите ответа. Ждите ответа. Ждите ответа. Ждите, короче...',
'Я комментатор! А ты кто???',
'Щас я все это запишу, а потом передам кляузу паладинам...',
'я занят!!!');
addchp($commas[rand(0,count($commas)-1)],"Комментатор");
}
}
}
die ("<script>top.CLR1(); top.RefreshChat();</script>");
}
}
?>
</body>
</html>