Файл: modules/earn/check/vkrepost.php
Строк: 17
<?
mysql_query("INSERT INTO `done` (`social` ,`type` ,`uid` ,`tid`, `mode`) VALUES ('".$Task['social']."', '".$Task['type']."', '$uid', '$tid', 'done');");
preg_match_all('#(photo|wall|video)(-?[0-9]+)_([0-9]+)#',$Task['url'],$bb);
if($bb[1][0]=='photo') $type = 'photo';
if($bb[1][0]=='wall') $type = 'post';
if($bb[1][0]=='video') $type = 'video';
$res = Core::url_get_contents('https://api.vk.com/method/likes.getList?count=1000&type='.$type.'&owner_id='.$bb[2][0].'&item_id='.$bb[3][0].'&filter=copies');
$resp = json_decode($res, true);
if(in_array($CONFIG['Globals']['social:vk'],$resp['response']['users'])){
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';");
}