Файл: modules/earn/check/twretweet.php
Строк: 19
<?
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('#/status/([0-9]+)#',$path,$bb);
$res = Core::url_get_contents('https://api.twitter.com/1/statuses/retweeted_by_user.json?id='.$CONFIG['Globals']['social:tw'].'&count=1&include_entities=false&trim_user=false');
$resp = json_decode($res, true);
if($resp[0]['retweeted_status']['id']==$bb[1][0]) $in_array = true;
if($in_array){
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';");
}