Файл: chats/my/ignornew.php
Строк: 204
<?php
//////////////////////////////////////////
// CHAT POWERED : http://sim-sim.h2m.ru//
// ICQ : 378036650 //
// Email : olegarhi75@mail.ru //
// WEB SITE Version 1.0 www.waufon.ru //
////////////////////////////////////////
require( "../inc/conf.inc.php" );
require( "../inc/check.php" );
$login = autorize();
$sound = $login['sound'] ;
$max = $row['num_msgs'];
if ( empty( $max ) )
{
$max = 5;
}
switch ( $mod )
{
case "addus" :
echo "<title>Игнор-лист</title>";
echo "<style type="text/css">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo ".cp { border-style:solid; border-width: 0px; color: {$lcol} ; background-color: {$bcol}; text-align: left }";
echo "</style>";
echo "</head>";
echo "<body>";
if($sound=="1")
{
echo "<!--h--><!--h--><a><bgsound src="../sound/luc.wav"></br>";
}
echo "<div align="center">Добавить неугодного в список</div>";
echo "<form method="post" action="ignornew.php">";
echo "Кого:<br/>";
echo "<input name="usid" maxlength="24" value="{$to}"/><br/>";
echo "Какая причина:<br/>";
echo "<input name="subject" maxlength="300"/><br/>";
if ( $row['trans'] == 1 )
{
echo "<input name="translit" type="checkbox" value="1">Транслит<br/>";
}
echo "<input type="hidden" name="mod" value="adding"/>rn";
echo"<input type="hidden" name="id" value="{$id}"/>rn";
echo"<input type="hidden" name="pass" value="{$pass}"/>rn";
echo"<input value="Вынести приговор засранцу" type="submit" class="cp">rn</form>";
##############
break;
case "adding" :
echo "<meta http-equiv="refresh" content="1;URL=ignornew.php?id={$id}&pass={$pass}"/>";
echo "<title>Добавление...</title>";
echo "<style type="text/css">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol}; text-align: center }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo "</style>";
echo "</head>";
echo "<body>";
#################*/
if ( empty( $usid ) )
{
echo "<div>Кого будем игнорить? :)</div>";
}
else if ( empty( $subject ) )
{
echo "<div>За какие грехи игнорим?</div>";
}
else
{
$usid = check( $usid );
$q = @mysql_query( "select id, login from users where login='".$usid."';" );
if ( mysql_num_rows( $q ) == 0 )
{
echo "<div>Такого юзера не существует!</div>";
}
else
{
$data = mysql_fetch_array( $q );
$usid = $data['id'];
$login = $data['login'];
$subject = check( $subject );
$subject = substr( $subject, 0, 600 );
if ( mysql_query( "Insert into ignor set login='".$login."',topic='".$subject."', id='".$id."', usid='".$usid."' ;" ) )
{
echo "<div>Пользователь успешно добавлен!</div>";
}
else
{
echo "<div>Ошибка...</div>";
}
}
}
/*##############################
if($ignor=="1")
{
$hel = "Вас добавили в игнор-лист";
mysql_query( "Insert into mess set id=0, login='<b><u>{$login}</u></b>', msg='".$hel."', id_from='".$row['id']."', id_to='0', wtime='".$time."',room='all'" );
}
}
##############################*/
break;
case "list" :
$q = mysql_query( "select usid from ignor where id='{$id}' ;" );
$num = mysql_num_rows( $q );
echo "<title>Список игнорируемых</title>";
echo "<style type="text/css">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol}; text-align: center }";
echo "</style>";
echo "</head>";
echo "<body>n";
if ( $num == 0 )
{
if($sound=="1")
{
echo "<!--h--><!--h--><a><bgsound src="../sound/obnov.wav"></br>";
}
echo "<div>список пуст</div>";
echo "<a href="ignornew.php?id={$id}&pass={$pass}&ref={$ref}">Назад</a><br/>";
break;
}
else
{
if($sound=="1")
{
echo "<!--h--><!--h--><a><bgsound src="../sound/prikaz.wav"></br>";
}
echo "<div>колличество игнорируемых ({$num})</div>";
}
$s = intval( $s );
if ( $s < 0 )
{
$s = 0;
}
$i = $s;
$res = mysql_query( "select * from ignor where id='{$id}' order by usid desc limit {$s},{$max}" );
while ( $ign = mysql_fetch_array( $res ) )
{
++$i;
$ignid = $ign['id'];
$from = $ign['login'];
$tid = $ign['tid'];
$subject = $ign['topic'];
$time = date( "H:i", $ign['wtime'] );
echo "<b>{$i}.</b> <b>{$from}</b>r был занесён Вами в список по причине: <b><u>{$subject}</u></b> <a href="ignornew.php?id={$id}&pass={$pass}&mod=del&tid={$tid}&ignid={$ignid}&ref={$ref}">(<b>X</b>)</a><br/>";
}
echo "<a href="ignornew.php?id={$id}&pass={$pass}&ref={$ref}">Назад</a><br/>";
if ( !( $s + $max < $num ) )
{
break;
}
print "<a href="index.php?id={$id}&pass={$pass}&mod={$mod}&s=".( $s + $max )."">Следующие</a><br/>";
break;
case "del" :
echo "<meta http-equiv="refresh" content="1;URL=./ignornew.php?id={$id}&pass={$pass}"/>";
echo "<title>Deleting...</title>";
echo "<style type="text/css">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol}; text-align: center }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo "</style>";
echo "</head>";
echo "<body><div>Пользователь удалён из списка</div>";
$ignid = intval( $ignid );
$q = mysql_query( "select usid,id,tid from ignor where id='{$ignid}'" );
$ign = @mysql_fetch_array( $q );
$usid = $ign['usid'];
$id = $ign['id'];
mysql_query( "delete from ignor WHERE usid = '{$usid}'" );
break;
case "delall" :
echo "<meta http-equiv="refresh" content="1;URL=ignornew.php?id={$id}&pass={$pass}"/>";
echo "<title>Deleting...</title>";
echo "<style type="text/css">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol}; text-align: center }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo "</style>";
echo "</head>";
echo "<body><div>Список очищен!</div>";
mysql_query( "delete from ignor WHERE id = '{$id}'" );
mysql_query( "OPTIMIZE TABLE `ignor`" );
break;
default :
echo "<title>Игнор-лист</title>";
echo "<style type="text/css">";
echo "body { font-size: {$fs}; color: {$tcol}; background-color: {$bcol} }";
echo "a:link,a:visited { text-decoration: underline; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol}; text-align: center }";
echo "</style>";
echo "</head>";
echo "<body>";
if($sound=="1")
{
echo "<!--h--><!--h--><a><bgsound src="../sound/ban.wav"></br>";
}
echo "<div>Игнор - лист</div>n";
$q = mysql_query( "select usid from ignor where id='{$id}' ;" );
$num = mysql_num_rows( $q );
echo "<a href="ignornew.php?id={$id}&pass={$pass}&mod=list&ref={$ref}">Список игнорируемых ({$num})</a><br/>rn---<br/>rn<a href="ignornew.php?id={$id}&pass={$pass}&mod=addus&ref={$ref}">Добавить в игнор-лист</a><br/>rn<a href="ignornew.php?id={$id}&pass={$pass}&mod=delall&ref={$ref}">Очистить весь список</a><br/>";
break;
}
echo "---<br/>";
$end = gettime( );
echo "<a href="index.php?id={$id}&pass={$pass}&ref={$ref}">Кабинет</a><br/>";
echo"<a href="../enter.php?id={$id}&pass={$pass}&ref={$ref}">Прихожая</a><br/>rn<p align="center">rn[".round( $end - $mystart, 5 )."]";
require("../inc/coper.php");
print "</p></body></html>";
mysql_close( $link );
?>