Файл: modules/earn/check/twfollow.php
Строк: 22
<?
mysql_query("INSERT INTO `done` (`social` ,`type` ,`uid` ,`tid`, `mode`) VALUES ('".$Task['social']."', '".$Task['type']."', '$uid', '$tid', 'done');");
$aa = parse_url($Task['url']);
$path = $aa['path'];
$userid = substr($path,1);
$res = Core::url_get_contents('https://api.twitter.com/1/friends/ids.json?user_id='.$CONFIG['Globals']['social:tw']);
$resp = json_decode($res, true);
$res2 = Core::url_get_contents('https://api.twitter.com/1/users/show.json?screen_name='.$userid);
$resp2 = json_decode($res2, true);
$userid = $resp2['id'];
if(in_array($userid,$resp['ids'])){
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';");
}