'; for ($i = 1; $i <= 3; $i++) { $f = $a[$n + $i]; $p = substr($f, 0, strpos($f,".gif")); if ($a[$n + $i]) { echo '';// width="25" } } echo ''; $n = $n + 3; } echo '
'; $message = $_REQUEST[message]; for ($i = 0; $i < strlen($message); $i++) { $abc_low = 'abcdefghijklmnopqrstuvwxyz'; $abc_upp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; for ($i1 = 0; $i1 < strlen($abc_low); $i1++) { if (substr($message, $i, 1) == substr($abc_low, $i1, 1)) { $check = $check.substr($abc_upp, $i1, 1); break; } } if ($i1 == strlen($abc_low)) {$check = $check.substr($message, $i, 1);} } $check = strtoupper($check); include "../start.php"; $res = mysql_query("SELECT * FROM `players` WHERE `nick`='$_SESSION[nick]'"); $arr = mysql_fetch_assoc($res); if ($arr[ban] + $arr[ban_time] - time() > 1) {echo ''; die;} $res = mysql_query("SELECT * FROM `words_bad`"); while ($arr = mysql_fetch_assoc($res)) { $amount_bad++; $words_bad[$amount_bad] = $arr[words]; } $z = 0; while(strlen($check) > 0) { $z++; $n = strpos($check,' '); if (!$n) {$words_check[$z] = $check; break;} $words_check[$z] = substr($check, 0, $n); $check = substr($check, $n + 1); } for ($i = 1; $i <= $z; $i++) { for ($i2 = 1; $i2 <= $amount_bad; $i2++) { if ($words_bad[$i2] == substr($words_check[$i],0,strlen($words_bad[$i2]))) { echo $words_check[$i],'
'; $res = mysql_query("SELECT * FROM `players` WHERE `nick`='$_SESSION[nick]'"); $arr = mysql_fetch_assoc($res); $ban = $arr[ban]; if ($ban == 0) {$ban = 30;} else {$ban = round($ban * 1.2);} $time = time(); $res = mysql_query("UPDATE `players` SET `ban` = '$ban', `ban_time` = $time WHERE `nick`='$_SESSION[nick]'"); echo ''; die; } } } if ($message) { $s=''; for ($i = 0; $i < strlen($message); $i++) { while (substr($message, $i, 1)<>'<' and substr($message, $i, 1)<>'>') { $s.=substr($message, $i, 1); $i++; if ($i == strlen($message)) {break;} } } $message = $s; do { $z = 'ok'; $t = $message; $k = 0; do { $n = strpos($t,' '); if ($n <> false) {$word[$k] = substr($t, 0, $n);} else {$word[$k] = $t; break;} $t = substr($t, $n + 1); $k++; } while (1); $temp = ''; for ($i = 0; $i < count($word); $i++) { if (strlen($word[$i]) > 18) { $temp = $temp.substr($word[$i],0, 18).' '.substr($word[$i],19); $z = 'bad'; } else { $temp = $temp.$word[$i].' '; } } $message = $temp; } while ($z <> 'ok'); $today = localtime(); for ($i = 0; $i < 3; $i++) { if ($today[$i] < 10) { $today[$i] = '0'.$today[$i]; } } $time = time(); $res = mysql_query("INSERT INTO `chat` (`time`, `nick`, `message` ) VALUES ($time, '$_SESSION[nick]', '$message')"); } if ($_SESSION[action_player] <> 2) {echo '';}; ?>