Файл: test.zfarm.mobi/mystyleuser/linkredpacksmall.php
Строк: 56
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
if(isset($_GET['linkredpacksmall']) && num($_GET['linkredpacksmall'])!=NULL && mysql_result(mysql_query("SELECT COUNT(id) FROM `mystyle_farm` WHERE `user` = '".num($user['id'])."' AND `id` = '".num($_GET['linkredpacksmall'])."' LIMIT 1"),0)!=0){
$post = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_farm` WHERE `id` = '".num($_GET['linkredpacksmall'])."' LIMIT 1"));
$need = 1;
if($user['s_redpack_small']>=$need){
$rat = 10;
if(num($_GET['page']))$page = 'page='.num($_GET['page']).'';
$avatar = 0;
$mozgi_exp_sql = 0;
if(isset($mozgi_exp))$mozgi_exp_sql=(($rat/100)*200);
if(isset($user['avatar_exp']))$avatar=(($rat/100)*$user['avatar_exp']);
$rat_user = $avatar+$mozgi_exp_sql;
if($rat_user==0)$rat=$rat;
else $rat=$rat_user;
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_club` WHERE `type` = '".num($user['msclub'])."'"),0)<1){}else{
$club = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_club` WHERE `id` = '".num($user['msclub'])."'"));
$cuser = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_cuser` WHERE `user` = '".num($user['id'])."'"));
$col = $club['rating']+$rat;
$col2 = $cuser['rating']+$rat;
mysql_query("UPDATE `mystyle_club` SET `rating` = '".$col."' WHERE `id` = '".$user['msclub']."' LIMIT 1");
mysql_query("UPDATE `mystyle_cuser` SET `rating` = '".$col2."' WHERE `user` = '".$user['id']."' LIMIT 1");
}
if($user['udobrenie'] = 1) $minus_time = 3600;
if($user['udobrenie'] = 2) $minus_time = 7200;
if($user['udobrenie'] = 3) $minus_time = 10800;
if($user['udobrenie'] = 4) $minus_time = 14400;
if($user['udobrenie'] = 5) $minus_time = 18000;
if($user['udobrenie'] = 6) $minus_time = 21600;
if($user['udobrenie'] = 7) $minus_time = 25200;
if($user['udobrenie'] = 8) $minus_time = 28800;
if($user['udobrenie'] = 9) $minus_time = 32400;
if($user['udobrenie'] = 10) $minus_time = 36000;
if($user['udobrenie'] = 11) $minus_time = 39600;
if($user['udobrenie'] = 12) $minus_time = 43200;
$time_all = $post['time']-$minus_time;
update_farm_user_ud('id',$post['id'],'time',$time_all);
//////////////////////////////////////////////////////////////////
include_once 'mystylecollect/mystylecollectionsrand.php';
//////////////////////////////////////////////////////////////////
$re1 = $user['s_redpack_small']-$need;
$re2 = $user['rating']+$rat;
mysql_query("UPDATE `mystyle_user` SET `s_redpack_small` = '".$re1."', `rating` = '".$re2."' WHERE `id` = '".$user['id']."' LIMIT 1");
///////// Лог Пользователя ///// By MyStyle
$text = 'Успешно удобрено + '.$rat.' опыта';
$_SESSION['msg'] = $text;
header("Location: ./?$page");
exit;
}else{
err_redpack($need-$user['s_redpack_small']);
}
}
?>