Файл: LinkForum/LinkUserInc/LinkModUser.php
Строк: 64
<?php
/**
* @author MyStyle
* @copyright 2013
*/
$time = time();
clear_bone();
clear_log();
$user=mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '".$user['id']."'"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_mypet` WHERE `user` = '".$user['id']."'"),0)<1){
mysql_query("INSERT INTO `mystyle_mypet` SET `user` = '".$user['id']."', `v1` = '', `v2` = '', `v3` = '', `v4` = '', `v5` = '', `v6` = ''");
}
$use = 1;
$frend=mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_frend` WHERE `user` = '".$use."'"));
$user_v=mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_mypet` WHERE `user` = '".$user['id']."'"));
$user_v1 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game1` WHERE `user` = '".$user['id']."'"));
$user_v2 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game2` WHERE `user` = '".$user['id']."'"));
$user_v3 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game3` WHERE `user` = '".$user['id']."'"));
$user_v4 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game4` WHERE `user` = '".$user['id']."'"));
$user_walk = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_walk` WHERE `user` = '".$user['id']."'"));
$user_accelerator = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_accelerator_user` WHERE `user` = '".$user['id']."'"));
$user_toy = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_toy_user` WHERE `user` = '".$user['id']."'"));
$user_food = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_food_user` WHERE `user` = '".$user['id']."'"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_game1` WHERE `user` = '".$user['id']."'"),0)<1){
$money = rand(10,100);
$ruby = rand(1,10);
mysql_query("INSERT INTO `mystyle_game1` SET `user` = '".$user['id']."', `col` = '4', `money` = '".$money."', `ruby` = '".$ruby."', `time` ='$time'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_game2` WHERE `user` = '".$user['id']."'"),0)<1){
$money = rand(10,100);
$ruby = rand(1,10);
mysql_query("INSERT INTO `mystyle_game2` SET `user` = '".$user['id']."', `col` = '4', `money` = '".$money."', `ruby` = '".$ruby."', `time` ='$time'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_game3` WHERE `user` = '".$user['id']."'"),0)<1){
$money = rand(10,100);
$ruby = rand(1,10);
mysql_query("INSERT INTO `mystyle_game3` SET `user` = '".$user['id']."', `col` = '3', `money` = '".$money."', `ruby` = '".$ruby."', `time` ='$time'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_game4` WHERE `user` = '".$user['id']."'"),0)<1){
$money = rand(10,100);
$ruby = rand(1,10);
mysql_query("INSERT INTO `mystyle_game4` SET `user` = '".$user['id']."', `col` = '3', `money` = '".$money."', `ruby` = '".$ruby."', `time` ='$time'");
}
if ($user_walk['time'] < time())
{
$walk = 'no';
mysql_query("UPDATE `mystyle_walk` SET `type` = '".$walk."' WHERE `user` = '$user[id]'");
}
mysql_query("UPDATE `mystyle_user` SET `date_last` = '$time' WHERE `id` = '$user[id]' LIMIT 1");
$timeactiv=$time-$user['date_last'];
if($timeactiv < 120)
{
$newtimeactiv=$user['time']+$timeactiv;
mysql_query("UPDATE `mystyle_user` SET `time` ='$newtimeactiv' WHERE `id` = '$user[id]' LIMIT 1");
}
$album1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_album` WHERE `user` = '".$user['id']."' AND `type` = '1'"),0);
$album2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_album` WHERE `user` = '".$user['id']."' AND `type` = '2'"),0);
$album3 = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_album` WHERE `user` = '".$user['id']."' AND `type` = '3'"),0);
$album4 = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_album` WHERE `user` = '".$user['id']."' AND `type` = '4'"),0);
$album5 = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_album` WHERE `user` = '".$user['id']."' AND `type` = '5'"),0);
$album6 = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_album` WHERE `user` = '".$user['id']."' AND `type` = '6'"),0);
$user_v1 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game1` WHERE `user` = '".$user['id']."'"));
$user_v2 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game2` WHERE `user` = '".$user['id']."'"));
$user_v3 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game3` WHERE `user` = '".$user['id']."'"));
$user_v4 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_game4` WHERE `user` = '".$user['id']."'"));
$ver1 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '1'"));
$ver2 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '2'"));
$ver3 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '3'"));
$ver4 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '4'"));
$ver5 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '5'"));
$ver6 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '6'"));
$ver7 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '7'"));
$ver8 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '8'"));
$ver9 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '9'"));
$ver10 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '10'"));
$ver11 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."' AND `limit` = '11'"));
////////////////////////////////////////////////////////////////////////////////////////////////////////////
$user=mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_user` WHERE `id` = '".$user['id']."'"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_zadaniya_user` WHERE `user` = '".$user['id']."'"),0)<11){
$q=mysql_query("SELECT * FROM `mystyle_zadaniya` ORDER BY `id` DESC LIMIT 11");
$i++;
while($post=mysql_fetch_array($q))
{
mysql_query("INSERT INTO `mystyle_zadaniya_user` SET `user` = '".$user['id']."',
`name` = '".$post['name']."',
`korm` = '".$post['korm']."',
`col` = '".$post['col']."',
`ruby` = '".$post['ruby']."',
`money` = '".$post['money']."',
`rating` = '".$post['rating']."',
`type` = '".$post['type']."',
`limit` = '".$i."',
`who` = '".$post['who']."'");
$i++;
}
}
$snow = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_snow` WHERE `user` = '".$user['id']."'"));
$baby = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_baby` WHERE `user` = '".$user['id']."'"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_snow` WHERE `user` = '".$user['id']."'"),0)<1){
$rating = rand(1,10);
mysql_query("INSERT INTO `mystyle_snow` SET `user` = '".$user['id']."', `col` = '3', `time` = '".$time."', `type` = '1', `rating` ='$rating'");
}
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_baby` WHERE `user` = '".$user['id']."'"),0)<1){
$rating = rand(1,10);
mysql_query("INSERT INTO `mystyle_baby` SET `user` = '".$user['id']."', `col` = '3', `time` = '".$time."', `type` = '1', `rating` ='$rating'");
}
$user_domik = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_domik` WHERE `user` = '".$user['id']."'"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_domik` WHERE `user` = '".$user['id']."'"),0)<1){
mysql_query("INSERT INTO `mystyle_domik` SET `user` = '".$user['id']."', `time` = '".$time."', `ver4` = '1'");
}
///////////////////// Includ By MyStyle /////////////////////////////////////////////////////////
include 'LinkInsertUser/Insert.php';
/////////////////////////////////////////////////////////////////////////////////////////////////
?>