Файл: ferma/inc/start.php
Строк: 50
<?
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'");
header("Location: ?farm&".passgen());
exit;
}
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]'");
}
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 'inc/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);
}
include_once 'inc/gos_start.php';
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';else $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'].""));
if(isset($_GET['outlogin']) && hsc($_GET['outlogin'])==$ku['mdp'])
{
unset($_SESSION['id_user']);
header("Location:/");
exit;
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ban` WHERE `id_user` = '$ku[id]' AND `izg` = '1' LIMIT 1"),0)!=0 && (!isset($_GET['user']) || isset($_GET['user']) && $_GET['user']!=$ku['id'])){header("Location:?user=$ku[id]&bans");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]'"));
?>