Файл: chats/enter.php
Строк: 229
<?php
//*********************/
//Скрипт переписан админом
//http://waufon.ru Кот * Проги для компа и мобил
//Помогал админ
//http://pfc.h2m.ru/ КОСМОС * Посети непожалееш
//всю эту срань господнюю
//перехуяривали на дыры
//http://rus-waphost.ru/ Nitrix * Супер хост без висов
/*********************/
require("inc/gzip.php");
require( "inc/conf.inc.php" );
require( "inc/check.php" );
$datep = date("d.m");
$datep = str_replace("01","1",$datep);
$datep = str_replace("02","2",$datep);
$datep = str_replace("03","3",$datep);
$datep = str_replace("04","4",$datep);
$datep = str_replace("05","5",$datep);
$datep = str_replace("06","6",$datep);
$datep = str_replace("07","7",$datep);
$datep = str_replace("08","8",$datep);
$datep = str_replace("09","9",$datep);
$allreg_count = @mysql_query("SELECT count(*) FROM `forum_topic` WHERE id>0;");
$all = @mysql_fetch_array($allreg_count);
$allcount = $all['count(*)'];
$mas_count = @mysql_query("SELECT count(*) FROM `forum_message` WHERE id>0;");
$mas = @mysql_fetch_array($mas_count);
$mascount = $mas['count(*)'];
if(!empty($login))
$q = @mysql_query("select `id` from `".$px.$utable."` where `login`='".$login."';");
if(empty($id)) {
$data = @mysql_fetch_array($q);
$id = $data['id'];
}
$login = autorize();
$loginn = $login['login'] ;
$bday = $login['bday'] ;
$bmonth = $login['bmonth'] ;
$birth = "$bday.$bmonth";
$sex = $login['sex'] ;
$sound = $login['sound'] ;
$shtamp = $data['shtamp'];
$krutoj = $row['krutoj'];
$login = $row['login'];
$id = $row['id'];
$admin = $row['admin'];
$status = $row['status'];
$posts = $row['posts'];
$vposts = $row['vposts'];
$genij = $row['genij'];
$theme = $row['theme'];
#####################################
#####################################*/
if ( empty( $status ) )
{
mysql_query( "update users set status='Прохожий' where id='{$id}';" );
}
if ( 100 <= $posts && $posts < 500 && $status == "Прохожий" )
{
mysql_query( "update users set status='Новичок' where id='{$id}';" );
}
if ( 500 <= $posts && $posts < 1000 && $status == "Новичок" )
{
mysql_query( "update users set status='Пользователь' where id='{$id}';" );
}
if ( 1000 <= $posts && $posts < 3000 && $status == "Пользователь" )
{
mysql_query( "update users set status='Продвинутый' where id='{$id}';" );
}
if ( 3000 <= $posts && $posts < 5000 && $status == "Продвинутый" )
{
mysql_query( "update users set status='Чаттер' where id='{$id}';" );
}
if ( 5000 <= $posts && $posts < 7000 && $status == "Чаттер" )
{
mysql_query( "update users set status='Тусовщик' where id='{$id}';" );
}
if ( 7000 <= $posts && $status == "Тусовщик" )
{
mysql_query( "update users set status='Почетный' where id='{$id}';" );
}
$flag = false;
$opt = file( "data/optim.dat" );
$opt = intval( trim( $opt[0] ) );
if ( $opt < time( ) )
{
$opt = time( ) + 17280;
$fp = @fopen( "data/optim.dat", "wb" );
fputs( $fp, $opt );
fclose( $fp );
$flag = true;
}
if ( $flag )
{
$dt = time( ) - 86400;
mysql_query( "Delete from mess where wtime < '".$dt."'" );
mysql_query( "OPTIMIZE TABLE mess" );
mysql_query( "TRUNCATE TABLE intim" );
mysql_query( "Insert into mess set login='Дворник', msg='Я таблицы оптимизировал.Мне не сложно а админам впадляк было наверно.', id_from='0', id_to='0', wtime='".time( )."',room='all'" );
}
/////////////////////
$ltime = $row['ltime'];
$offline = $ltime + 1200;
if ( $offline < time( ) )
{
$time = time( );
$helo = "Привет :)";
mysql_query( "Insert into mess set id=0, login='<b><u>{$login}</u></b>', msg='".$helo."', id_from='".$row['id']."', id_to='0', wtime='".$time."',room='all'" );
}
mysql_query( "update users set `ltime`='".time( )."', `lroom`='11' where id='{$id}';" );
////////Девушке///////////
if($sex=="2")
{
$ltime = $row['ltime'];
$offline = $ltime+1200;
if ($offline < time())
{
$time = time();
$helo = "Вау! <b><u>$login</u></b> Девачкам по чмасику. Привет! Проходи родная моя раздевайсо располагайсо!";
mysql_query ("Insert into mess set id=0, login='<b><u>НЕО</u></b>', msg='".$helo."', id_from='0', id_to='0', wtime='".$time."',room='all'");
}
mysql_query("update users set `ltime`='".time()."', `lroom`='11' where id='$id';");
}
///////Парню///////////
if($sex=="1")
{
$ltime = $row['ltime'];
$offline = $ltime+1200;
if ($offline < time())
{
$time = time();
$helo = "Йёпсь! <b><u>$login</u></b> Привет! Проходи, Бум девушек кадрить?!";
mysql_query ("Insert into mess set id=0, login='<b><u>НЕО</u></b>', msg='".$helo."', id_from='0', id_to='0', wtime='".$time."',room='all'");
}
mysql_query("update users set `ltime`='".time()."', `lroom`='11' where id='$id';");
}
/////////////////////////
///////Неизвестному///////////
if($sex=="0")
{
$ltime = $row['ltime'];
$offline = $ltime+1200;
if ($offline < time())
{
$time = time();
$helo = "Ипать! <b><u>$login</u></b> <img src="../sm/diablo.gif" alt=""/>. А што с тваей ориентацыей? анук вали гг в личный домик и анкету там и определись.<img src="../sm/haha.gif" alt=""/>";
mysql_query ("Insert into mess set id=0, login='<b><u>НЕО</u></b>', msg='".$helo."', id_from='0', id_to='0', wtime='".$time."',room='all'");
}
mysql_query("update users set `ltime`='".time()."', `lroom`='11' where id='$id';");
}
/////////////////////////
$q_c = @mysql_query( @"SELECT count(*) FROM users WHERE ltime>'".@intval( @time( ) - 300 )."'" );
$c_o = @mysql_fetch_array( @$q_c );
$onl = $c_o['count(*)'];
$data = file( "data/stats.dat" );
$ex = explode( "|", $data[0] );
$mline = $ex[0] + 0;
if ( $mline < $onl )
{
$fp = fopen( "data/stats.dat", "wb" );
$mdata = $onl."|".time( );
fputs( $fp, $mdata );
fclose( $fp );
}
echo "<title>{$cname}</title>";
echo "<link rel="shortcut icon" href="favicon.ico">";
if ( 20 < $theme)
{
echo "<link rel="StyleSheet" type="text/css" href="style/0".$s.".css"></head><body><div class="logo"></div>";
}
if ( 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 == $theme)
{
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: none; color: {$lcol} }";
echo "div { border-style:solid; border-width: 1px; background-color: {$rcol} }";
echo "</style>";
echo "</head>";
echo "<body>";
}
if ( 20 < $theme)
{
echo "<div class="title">";
}
echo "Привет, <b>$login</b>!</br>";
if ( 20 < $theme)
{
echo "</div><div class="b">";
}
require("calendar.php");
$for1 = mysql_query( "select count(*) as num from forum_sections" );
$for2 = mysql_fetch_array( $for1 );
$for3 = $for2['num'];
$n1 = mysql_query( "select count(*) as num from news" );
$n2 = mysql_fetch_array( $n1 );
$n3 = $n2['num'];
$t1 = mysql_query( "select count(*) as num from team" );
$t2 = mysql_fetch_array( $t1 );
$t3 = $t2['num'];
if ( 3 < $row['level'] )
{
echo "<a href="cpanel/?id={$id}&pass={$pass}&ref={$ref}">{$cpanel}Админка</a><br/>";
}
echo "<a href="help.php?id={$id}&pass={$pass}&mod=rules&ref={$ref}">Устав городка</a><br/>";
echo "<a href="search.php?id={$id}&pass={$pass}&ref={$ref}">Поиск</a><br/>";
echo "<a href="online.php?id={$id}&pass={$pass}&ref={$ref}">Кто Где</a>[{$onl}]</a><br/>";
echo "<a href="news.php?id={$id}&pass={$pass}&ref={$ref}">Новости</a>[{$n3}]</a><br/>";
echo "<a href="my/?id={$id}&pass={$pass}&ref={$ref}"><b><u>$login</u></b> [Личный КАБИНЕТ]</a><br/>";
$q1 = mysql_query( "select id from letters where id_to='{$id}' and new=1 and del_in=0;" );
if ( mysql_num_rows( $q1 ) )
{
echo "<br/><a href="mail/?id={$id}&pass={$pass}&mod=in"><img src="let.gif" alt="Letter"/></a><br/>";
if($sound=="1")
{
echo "<!--h--><!--h--><a><bgsound src="sound/mail.wav"></br>";
}
}
$q2 = mysql_query( "select id from zags where id_to='{$id}' and new=1 and del_in=0;" );
if ( mysql_num_rows( $q2 ) )
{
echo "<br/><a href="zags/?id={$id}&pass={$pass}&mod=in"><img src="zags.gif" alt="Letter"/></a><br/>";
}
echo "<div class=t>";
echo "Развличения</div>";
echo"<p align="left">";
include "includes/inc_online.php";
echo "<a href="gam.php?id={$id}&pass={$pass}&ref={$ref}">online Город</a>: (".$main_users.")<br/>";
echo "<a href="anekdot/?id={$id}&pass={$pass}&ref={$ref}">Анекдоты</a><br/>rn";
echo "<a href="forum/?id={$id}&pass={$pass}&ref={$ref}">Форум</a> [{$for3}]</a> [".$all['count(*)']."]</a>[".$mas['count(*)']."]<br/>";
//echo "<div class="d1">";
////////////////////////////////////////
echo "<div class=t>";
echo "Комнаты</div>";
$q = @mysql_query( "select `var`,`name` from setts order by var;" );
while ( $rooms = @mysql_fetch_array( @$q ) )
{
$rname = $rooms['name'];
$num = $rooms['var'];
$c = mysql_query( "SELECT count(id) FROM users WHERE `ltime`>'".intval( time( ) - 300 )."' AND `lroom`='".$num."';" );
$dcount = mysql_fetch_array( $c );
if ( $num == 9 )
{
echo "<b><a href="anlim.php?id={$id}&pass={$pass}&rm={$num}&ref={$ref}">{$rname}</a></b> [".$dcount['count(id)']."]<br/>";
}
else if ( $num == 10 )
{
echo "<b><a href="intim.php?id={$id}&pass={$pass}&rm={$num}&ref={$ref}">{$rname}</a></b> [".$dcount['count(id)']."]<br/>";
}
else if ( $num == 11 )
{
echo "<b><a href="psix.php?id={$id}&pass={$pass}&rm={$num}&ref={$ref}">{$rname}</a></b> [".$dcount['count(id)']."]<br/>";
}
else
{
echo "<a href="room.php?id={$id}&pass={$pass}&rm={$num}&ref={$ref}">{$rname}</a> [".$dcount['count(id)']."]<br/>";
}
}
//echo "</div>";
if ( empty( $do ) )
echo "<div class=t>";
echo "Темы сегодня</a>[{$t3}]</a></div>";
echo "<p align="left">";
$q = mysql_query( "select id,title from team order by id desc limit 10;" );
if ( mysql_affected_rows( ) == 0 )
{
echo "Сегодня темы нет...<br/>";
}
else
{
while ( $arr = mysql_fetch_array( $q ) )
{
++$i;
echo "{$i}. <a href="tema.php?id={$id}&pass={$pass}&mid=".$arr['id']."&do=see&ref={$ref}">".$arr['title']."</a><br/>";
}
}
echo "<hr>";
echo "<div class=t>Прочее</div><p align="left">";
$f1 = mysql_query( "select count(*) as num from users where photo <> '';" );
$f2 = mysql_fetch_array( $f1 );
$f3 = $f2['num'];
echo "» <a href="help.php?id={$id}&pass={$pass}&ref={$ref}">Помощь</a><br/>";
echo "» <a href="stats.php?id={$id}&pass={$pass}&ref={$ref}">Статистика</a><br/>";
$galery = mysql_query ("select count(id) as num from users where img!=''");
$foto = mysql_fetch_array($galery);
$kolfoto = $foto["num"];
echo "» <a href="galery.php?id={$id}&pass={$pass}&ref={$ref}">Фото Галерея</a>: <b>[".$kolfoto."]</b><br/>";
echo "» <a href="gallery.php?id={$id}&pass={$pass}">Доска почёта</a>[{$f3}]</a><br/>";
$svadbi=mysql_fetch_array(mysql_query ("select count(id) as num from svadbi"));
echo "» <a href="svadbi.php?id={$id}&pass={$pass}&ref={$ref}"><b>Свадьбы</b></a>(".$svadbi[0].")</a><br/>";
//echo"<div align="left">";
echo "rn<a href="obmen/gipermarket.php?id={$id}&pass={$pass}">• Магазин </a><br/>rn";
echo "rn<a href="obmen/obmennik.php?id={$id}&pass={$pass}">• Банкомат</a><br/>rn";
echo "rn<a href="rabota/?id={$id}&pass={$pass}">• Позвать Друга в чат</a><br/>rn";
$viewsov = file("data/sovet.txt");
$sov = $viewsov[0];
//echo "</div>";
print"</p><p align="left">";
print"В прихожей: ";
$q_online = mysql_query( "SELECT `login` FROM users WHERE ltime>'".intval( time( ) - 300 )."' AND `lroom`='11' order by ltime desc;" );
while ( $donline = mysql_fetch_array( $q_online ) )
{
print $donline['login'].", ";
}
echo "<div class=t>» <b><a href="exit.php?id={$id}&pass={$pass}">Выйти</b></a></div><br>";
echo "<div class=t>Реклама</a></div>";
//require( "smiles/convert.php" );
$setting = @mysql_query ("Select * from setting where klu4='1'");
$set = mysql_fetch_array ($setting);
if($set["link2"]!="")
{
echo "<a href="http://".$set["link2"]."">".$set["link2_name"]."</a><br>";
}
echo "<div class="bottom">";
require("inc/coper.php");
echo "</a>© BY PASS Кот</div>";
//$end = gettime();
//echo "[".round( $end - $mystart, 5 )."]";
//echo "</body></html>";
//mysql_close( $link );
//echo "rn";
require("inc/footer.php");
ob_end_flush();
print "</p></body></html>";
?>