Файл: inc/system/start.php
Строк: 93
<?
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]'"),0)==0)
{
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]', `cultivator` = '1'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]', `cultivator` = '1'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]', `cultivator` = '1'");
mysql_query("INSERT INTO `kolhoz_ground` SET `id_user` = '$ku[id]', `cultivator` = '1'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]'"),0)<4 && $ku['level']>=10)
{
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_petground` SET `id_user` = '$ku[id]'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `box` WHERE `id_user` = '$ku[id]'"),0)<1)
{
mysql_query("INSERT INTO `box` SET `id_user` = '$ku[id]'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `assignments_user` WHERE `id_user` = '$ku[id]'"),0)<1 && $ku['level']>9)
{
mysql_query("INSERT INTO `assignments_user` SET `id_user` = '$ku[id]'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `lottery_user` WHERE `id_user` = '$ku[id]'"),0)<1 && $ku['level']>34)
{
mysql_query("INSERT INTO `lottery_user` SET `id_user` = '$ku[id]', `level_money` = '1', `money` = '235000000', `exp` = '3000000', `level_exp` ='1'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ivent_search` WHERE `id_user` = '$ku[id]'"),0)<1)
{
mysql_query("INSERT INTO `ivent_search` SET `id_user` = '$ku[id]'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `key_user` WHERE `id_user` = '$ku[id]'"),0)<1)
{
mysql_query("INSERT INTO `key_user` SET `id_user` = '$ku[id]'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `dostig` WHERE `id_user` = '$ku[id]'"),0)<1)
{
mysql_query("INSERT INTO `dostig` SET `id_user` = '$ku[id]'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]'"),0)<4 && $ku['level']>=10)
{
mysql_query("INSERT INTO `kolhoz_polka` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka` SET `id_user` = '$ku[id]'");
mysql_query("INSERT INTO `kolhoz_polka` SET `id_user` = '$ku[id]'");
}
$gos=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective_gos` WHERE `active` = '1' ORDER BY `time` DESC LIMIT 1"));
mysql_query("DELETE FROM `kolhoz_mail` WHERE `time` < '".($time-(3600*24*30))."'");
mysql_query("DELETE FROM `kolhoz_warehouse` WHERE `count` = '0'");
mysql_query("UPDATE `kolhoz_user` SET `date_last` = '$time' WHERE `id` = '$ku[id]' LIMIT 1");
$timeactiv=$time-$ku['date_last'];
if($timeactiv < 120)
{
$newtimeactiv=$ku['time']+$timeactiv;
mysql_query("UPDATE `kolhoz_user` SET `time` ='$newtimeactiv' WHERE `id` = '$ku[id]' LIMIT 1");
}
include_once '../gos/gos_start.php';
include_once '../petfarm/q_animals.php';
// Collective
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_user` WHERE `id_user` = '$ku[id]'"),0)!=0)
{
$mcu=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective_user` WHERE `id_user` = '$ku[id]'"));
$mc=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective` WHERE `id` = '$mcu[id_collective]'"));
$mc['next_level']=$mc['level']+1;
$mc['flowerbed_max']=$mc['level']*10;
$mc['users_max']=($mc['level']*5)+10+$mc['users_add'];
$mc['users']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_user` WHERE `id_collective` = '$mc[id]'"),0);
}
if($ku['expdouble']==NULL)
{
$rand=rand(1,7);
if($rand==1)$day='Mon';elseif($rand==2)$day='Tue';elseif($rand==3)$day='Wed';elseif($rand==4)$day='Thu';elseif($rand==5)$day='Fri';elseif($rand==6)$day='Sat';elseif($rand==7)$day='Sun';
mysql_query("UPDATE `kolhoz_user` SET `expdouble` = '$day' WHERE `id` = '$ku[id]'");
$ku['expdouble']=$day;
}
if($ku['expdouble']==date("D"))$dexp=1;
$ku['mdp']=md5($ku['password']);
$ku['autologin']=update_ku('autologin',md5("nick:".$ku['nick'].",password:".$ku['password'].",id:".$ku['id'].""));
$result = mysql_query("SELECT * FROM `kolhoz_ban` WHERE `id_user` = '$ku[id]' AND `izg` = '1'");
while($msg = mysql_fetch_assoc($result)){
$bans=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_ban` WHERE `id_user` = '".($ku['id'])."' AND `time` > '".($time)."' AND `izg` = '1' ORDER BY `id` DESC LIMIT 1"));
if($msg['izg']>0){
echo'<link rel="stylesheet" href="style.css" "text/css" />';
echo '<div class="title"><center>Доступ запрещен</center></div>';
echo '<font color="red"><div class="div">Аккаунт <span class="epic">'.($ku['nick']).'</span> заблокирован за нарушение правил сайта <br>Любые действия под данным аккаунтом запрещены! <br> Причина: '.($msg['msg']).' <br>Нарушение: '.($msg['reason']).'</font></div>';
echo "<div class='foot-box'>";
echo "Онлайн</span> <b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-3600)."'"), 0)."</b>, регистраций
<b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user`"), 0)."</b><br />";
echo "Территория фермеров</a> <br/>";
echo'</div>';
exit;
}
}
$result = mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$ku[id]'");
$exp =mysql_fetch_array(mysql_query("SELECT * FROM `exp` WHERE `id` = '2'"));
while($msg = mysql_fetch_assoc($result)){
if($msg['status']!=3 && $exp['time']>=$time){
echo'<link rel="stylesheet" href="/style.css" "text/css" />';
echo '<div class="title"><center>Мы скоро вернемся...</center></div>';
echo '<font color="red"><center><center><div class="div"><img src="/img/PMTotal.png" alt=""/><br>Cегодня день, когда мы проверяем каждую деталь "Территория Фермеров" <br>';
echo"Технические работы окончатся <br>через <font color='red'>".time_left($exp['time']-$time)."</font><br>Спасибо вам за ваше терпение.</center></font>";
echo "<div class='foot-box'>";
echo "Онлайн</span> <b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-3600)."'"), 0)."</b>, регистраций
<b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user`"), 0)."</b><br />";
echo "Территория фермеров</a> <br/>";
echo'</div>';
exit;
}
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `complaint` WHERE `infringer` = '$ku[id]' AND `check` ='0'"),0)>9)
{
echo'<link rel="stylesheet" href="/style.css" "text/css" />';
echo '<div class="title"><center>Доступ запрещен</center></div>';
echo '<font color="red"><center><center><div class="div">Мы заметили подозрительную активность <span class="epic">'.($ku['nick']).'</span> и были вынуждены его временно заблокировать.<br>Аккаунт будет разблокирован после проверки администрацией, пожалуйста, подождите.<br> Это не займет много времени.</center></font>';
echo "<div class='div'>";
echo "<div style='text-align:center;'>";
echo'<div style="text-align:center;" class="pt small minor">';
echo "<div class='foot-box'>";
echo "Онлайн</span> <b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-3600)."'"), 0)."</b>, регистраций
<b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user`"), 0)."</b><br />";
echo "Территория фермеров</a> <br/>";
echo'</div>';
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ban` WHERE `id_user` = '$ku[id]' AND `time` > '$time' AND `izg` = '0' LIMIT 1"),0)!=0)$molchi=1;
$ban=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_ban` WHERE `id_user` = '$ku[id]' AND `time` > '$time' AND `izg` = '0' ORDER BY `id` DESC LIMIT 1"));
$us_ban=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$ban[id_who]'"));
?>