Файл: region_clean/ignor.php
Строк: 447
<?
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once "start.php";
require_once "sid.php";
header("Cache-Control: no-cache");
if ($ver == "wml") header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");
require_once "inc.php";
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require_once "version.php";
switch($mod) {
default:
$us = $row['user'];
if (isset($go)) {
mysql_query ("Delete from ignor where usid ='$nk' and id = '$id'");
$ignornick = mysql_fetch_array(mysql_query ("Select user from users where id='$nk' LIMIT 1;"));
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="Ок" title="Ok" ontimer="ignor.php?$ses&ref=$ref"><timer value="10"/>n
<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=ignor.php?$ses&ref=$ref">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
echo $fsize1;
echo 'Пользователь <b>' . col_n($ignornick[0]) . '</b> удален из твоего игнор-листа.';
echo $fsize2;
include_once "foot.php";
exit;
}
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="ignolist" title="Игнор-лист">n
<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Игнор-лист</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
echo $fsize1;
$userm = mysql_query ("select count(klu4) as num from ignor where id ='$id';");
echo '<div class="d1"><b>Мой Игнор-Лист.</b></div>';
echo $divide;
$usm = mysql_fetch_array($userm);
$num = $usm["num"];
if ($num == 0) {
echo 'Мой игнор-лист пуст!<br/>';
} else {
echo '<u>Для удаления ника из игнора нажми на [X]</u><br/>';
echo $divide;
if (!isset($s)) $s = 0;
$mx = round(($num/10)+0.45);
if ($s > $mx) $s = $mx;
if ($s == 0)$s = 1;
$ot = (($s - 1) * 10) + 1;
$do = $s * 10;
if ($do > $num) $do = $num;
$o = $ot - 1;
$n = $ot;
if ($do == 0) $n = $o;
echo "Показывает $n-$do из $num<br/>n";
echo $divide;
$r = mysql_query ("select usid from ignor where id ='$id' order by klu4 desc limit $o,$do");
for ($i = $ot; $i <= $do; $i++) {
$arr = mysql_fetch_array($r);
$nk = $arr['usid'];
$ignornick = mysql_fetch_array(mysql_query ("Select user from users where id='$nk' LIMIT 1;"));
echo ($i).") <a href="ignor.php?$ses&go=del&nk=$nk&ref=$ref"><img src="icon/d.png" alt="."/></a>
<a href="info.php?$ses&nk=$nk&ref=$ref">".col_n($ignornick[0])."</a><br/>";
}
$next = $s + 1;
$prev = $s - 1;
if ($num > $do) {
$ot = (($next - 1) * 10) + 1;
$do = $next * 10;
if($do > $num) $do = $num;
echo $divide;
echo "<a href="ignor.php?$ses&s=$next&ref=$ref">>>$ot-$do>></a><br/>n";
}
if ($s > 1) {
$ot = (($prev-1) * 10) + 1;
$do = $prev * 10;
echo "<a href="ignor.php?$ses&s=$prev&ref=$ref"><<$ot-$do<<</a><br/>n";
}
}
echo $divide;
echo "<div class = 'd1'><a href="ignor.php?$ses&mod=addto&nk=$nk&ref=$ref">Добавить в игнор</a><br/>n
<a href ="cabinet.php?$ses&ref=$ref">Личный кабинет</a><br/>n
<a href ="enter.php?$ses&ref=$ref">Прихожая</a></div>n";
echo $fsize2;
include_once "foot.php";
exit;
break;
case 'addto':
if (!isset($nick)) {
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="add" title="Добавить в игнор">n
<p align="left" mode="wrap">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Добавить в игнор</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">
<form method="POST" action="ignor.php?mod=addto&$ses$takep2" name="auth">n";
}
echo $fsize1;
echo 'Ник или ID юзера:<br/>';
echo $fsize2;
echo '<input name="nick" maxlength="20" title="Text"/><br/>';
echo $fsize1;
echo 'Транслит ника:<br/>';
echo $fsize2;
echo '<select name="trun">
<option value="0">Нет</option>
<option value="1">Да</option>
</select><br/>';
if ($ver == "wml") {
echo $fsize1;
echo "<anchor title="send">Добавить<go href="ignor.php?mod=addto&$ses$takep2" method="post">n
<postfield name="nick" value="$(nick)"/>n
<postfield name="trun" value="$(trun)"/>n
</go></anchor>n";
echo $fsize2;
echo '<br/>';
} else {
echo "<input type="submit" class="ibutton" value="Добавить" name="enter"><br/>n";
}
echo $fsize1;
echo $divide;
echo "<div class = 'd1'><a href="ignor.php?$ses$takep2">Игнор-лист</a></div>n
<div class = 'd1'><a href="chatmail.php?$ses$takep2">Мои письма</a></div>n";
if (isset($rm)) echo "<div class = 'd1'><a href="chat.php?$ses&rm=$rm$takep">В чат</a></div>";
echo $fsize2;
include_once "foot.php";
exit;
}
$nick = mysql_real_escape_string(check($nick));
$nick = htmlspecialchars($nick);
if (!is_numeric($nick)) {
if ($trun == 1) $nick = trun_to_rus($nick);
$nick = trim($nick);
if ($nick == "") $nick = 0;
$latuser = strtolower($nick);
$ruser = rus_to_k($nick);
if ($ruser == $nick) {
$select = mysql_query ("Select user,id from users where latuser = '".$latuser."'");
} else {
$select = mysql_query ("select user,id from users where ruser = '".$ruser."'");
}
} else {
$select = mysql_query ("select user,id from users where id = '".$nick."'");
}
if (mysql_affected_rows() == 0) {
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="error" title="error" ontimer="ignor.php?mod=addto&$ses$takep2"><timer value="10" />n
<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=ignor.php?mod=addto&$ses$takep2">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
echo $fsize1;
echo 'Пользователя <b>' . col_n($nick) . '</b> невозможно добавить в игнор-лист,<br/> т.к. пользователя с таким ником не существует.<br/>';
echo $fsize2;
include_once "foot.php";
exit;
}
$inf = mysql_fetch_array ($select);
$nk = $inf["id"];
mysql_query ("Select * from ignor where usid='$nk' and id='$id'");
if (mysql_affected_rows() != 0) {
$ignornick = mysql_fetch_array(mysql_query ("Select user from users where id='$nk' LIMIT 1;"));
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
if (isset($rm)) echo "<card id="error" title="error" ontimer="chat.php?$ses&rm=$rm&ref=$ref"><timer value="10" />n";
else echo "<card id="error" title="error" ontimer="enter.php?$ses&ref=$ref"><timer value="10" />n";
echo "<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок</title>";
if (isset($rm)) echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=chat.php?$ses&rm=$rm&ref=$ref">";
else echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=enter.php?$ses&ref=$ref">";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="left">";
}
echo $fsize1;
echo '<b>' . col_n($ignornick[0]) . '</b> уже давно в игноре.<br/>';
echo $fsize2;
include_once 'foot.php';
mysql_close ($link);
exit;
break;
}
$addus = $inf["user"];
if (!is_numeric($nk)) { header("Location: index.php?isset=403"); die; }
mysql_query ("Insert into ignor set usid='$nk', id='$id'");
$friendnick = mysql_fetch_array(mysql_query ("Select user from users where id='$nk' LIMIT 1;"));
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="ok" title="Ok!" ontimer="ignor.php?$ses$takep2"><timer value="5"/>n
<p align="left">";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок!</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=ignor.php?$ses$takep2">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="left">";
}
echo $fsize1;
echo 'Пользователь <b>' . col_n($addus) . '</b> добавлен в игнор-лист!<br/>';
echo $fsize2;
include_once "foot.php";
break;
case 'add':
mysql_query ("Select * from ignor where usid='$nk' and id='$id'");
if (mysql_affected_rows() != 0) {
$ignornick = mysql_fetch_array(mysql_query ("Select user from users where id='$nk' LIMIT 1;"));
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
if (isset($rm)) echo "<card id="error" title="error" ontimer="chat.php?$ses&rm=$rm&ref=$ref"><timer value="10" />n";
else echo "<card id="error" title="error" ontimer="enter.php?$ses&ref=$ref"><timer value="10" />n";
echo "<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок</title>";
if (isset($rm)) echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=chat.php?$ses&rm=$rm&ref=$ref">";
else echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=enter.php?$ses&ref=$ref">";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="left">";
}
echo $fsize1;
echo '<b>' . col_n($ignornick[0]) . '</b> уже давно в игноре.<br/>';
echo $fsize2;
include_once "foot.php";
exit;
break;
}
$select = mysql_query ("Select * from users where id='$nk'");
if (mysql_affected_rows() == 0) {
if ($ver == "wml"){
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
if (isset($rm)) echo "<card id="error" title="error" ontimer="chat.php?$ses&rm=$rm&ref=$ref"><timer value="10" />n";
else echo "<card id="error" title="error" ontimer="enter.php?$ses&ref=$ref"><timer value="10" />n";
echo "<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок</title>";
if (isset($rm)) echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=chat.php?$ses&rm=$rm&ref=$ref">";
else echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=enter.php?$ses&ref=$ref">";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="left">";
}
echo $fsize1;
echo 'Нет такого юзера!<br/>';
echo $fsize2;
include_once "foot.php";
exit;
break;
}
$inf = mysql_fetch_array ($select);
$iguser = $inf["user"];
$level = $inf["level"];
$levelselect = mysql_query ("Select name from levels where level='".$level."'");
$levels = mysql_fetch_array($levelselect);
$lev = $levels["name"];
if (($nk == $id) or ($level > 3)) {
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
if (isset($rm)) echo "<card id="ignor" title="Ok" ontimer="chat.php?$ses&rm=$rm&ref=$ref"><timer value="5"/>n";
else echo "<card id="ignor" title="Ok" ontimer="enter.php?$ses&ref=$ref"><timer value="5"/>n";
echo "<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок</title>";
if (isset($rm)) echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=chat.php?$ses&rm=$rm&ref=$ref">";
else echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=enter.php?$ses&ref=$ref">";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="left">";
}
echo $fsize1;
if ($nk == $id) echo 'Ты собираешься кинуть себя в игнор? Не получится!<br/>';
if ($level > 3) echo '<b>' . $lev . '</b> не может пополнить твой игнор.<br/>';
echo $fsize2;
include_once "foot.php";
exit;
break;
} else {
mysql_query ("Insert into ignor set usid='$nk', id='$id'");
$ignornick = mysql_fetch_array(mysql_query ("Select user from users where id='$nk' LIMIT 1;"));
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n";
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
if (isset($rm)) echo "<card id="ignor" title="Ok" ontimer="chat.php?$ses&rm=$rm&ref=$ref"><timer value="5"/>n";
else echo "<card id="ignor" title="Ok" ontimer="enter.php?$ses&ref=$ref"><timer value="5"/>n";
echo "<p align="left">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Ок</title>";
if (isset($rm)) echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=chat.php?$ses&rm=$rm&ref=$ref">";
else echo "<META HTTP-EQUIV="Refresh" CONTENT="2; URL=enter.php?$ses&ref=$ref">";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>";
echo "<div align="left">";
}
echo $fsize1;
echo '<b>' . col_n($ignornick[0]) . '</b> в игноре!<br/>';
echo $fsize2;
include_once "foot.php";
exit;
break;
}
}
?>