Файл: modules/earn/check/vkgroup.php
Строк: 16
<?
mysql_query("INSERT INTO `done` (`social` ,`type` ,`uid` ,`tid`, `mode`) VALUES ('".$Task['social']."', '".$Task['type']."', '$uid', '$tid', 'done');");
$path = $aa['path'];
if($aa['query']) $path .= '?'.$aa['query'];
preg_match_all('#(club|public)([0-9]+)#',$path,$bb);
if($bb[1][0]=='club' || $bb[1][0]=='public') $groupid = $bb[2][0];
if(!is_numeric($groupid)){
$groupid = substr($path,1);
}
$res = Core::url_get_contents('http://api.vk.com/method/groups.isMember?uid='.$CONFIG['Globals']['social:vk'].'&gid='.$groupid);
$resp = json_decode($res, true);
//print_r($resp);
if($resp['response']=='1'){
echo Ajax::Responce(array('ok'));
$tid = $Task['id'];
$uid = $CONFIG['uid'];
Tasks::ChangeBal($tid,$Task['bal']-$Task['pay']);
mysql_query("UPDATE `users` SET `balance` = balance+".$Task['pay']." WHERE `id` =$uid;");
} else {
echo Ajax::Responce(array('err'));
mysql_query("DELETE FROM `done` WHERE `uid`='$uid' AND `tid`='$tid' AND `mode`='done';");
}