<?if (isset($_GET['close_frame'])){ $user_id=0; if(isset($_GET['user_id'])){ $user_id=$_GET['user_id']; } //Run some js to close the current frame in favor of the parent. //this runs here because of crossdomain issues print " <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script> <script type='text/javascript'> //Callback to parent to notify completion var evt = jQuery.Event('assetSelect', { user_id: $user_id, }); var _parent = window.opener; _parent.jQuery(_parent.document).trigger(evt);</script>"; exit();}
//Change these values to setup your BitMiles integration!$bitmiles_app_id = '2';$bitmiles_app_secret = "5234523656221411234vsdf";
//////////////////////////////////////////Token identification//$bitmiles_url='http://fadev.bounceme.net/filmannex/';$bitmiles_url='http://www.bitlanders.com/';$bm_reward_id = '';if (isset($_GET['bm_reward_id'])) $bm_reward_id = $_GET['bm_reward_id'];if (isset($_POST['bm_reward_id'])) $bm_reward_id = $_POST['bm_reward_id'];
$user_id =0;if (isset($_GET['bm_user_id'])) $user_id = $_GET['bm_user_id'];if (isset($_POST['bm_user_id'])) $user_id = $_POST['bm_user_id'];
$callback='';if (isset($_GET['callback'])) $callback = $_GET['callback'];
if ($bm_reward_id == '') {//If the reward id is not set, the script ends here die();}
if ($user_id == '') {//If the user id is not set, the script ends here die();}$url=$bitmiles_url.'api/claimreward?reward_id='.$bm_reward_id."&user_id=".$user_id."&app_id=$bitmiles_app_id&app_secret=$bitmiles_app_secret&&callback=".$callback;//print 'curling to '.$url;//A reward id and user id are set, call the bitmiles server and claim itprint fetch($url);//print 'curl returned';die();
function fetch($encUrl) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $encUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_ENCODING, ""); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
$content=curl_exec($ch); curl_close($ch); /* $options = array( CURLOPT_RETURNTRANSFER => true, // return web page // CURLOPT_HEADER => false, // don't return headers // CURLOPT_FOLLOWLOCATION => true, // follow redirects // CURLOPT_ENCODING => '', // handle all encodings // CURLOPT_USERAGENT => 'bitMiles secure layer', // who am i // CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 5, // timeout on connect CURLOPT_TIMEOUT => 10, // timeout on response // CURLOPT_MAXREDIRS => 3, // stop after 3 redirects // CURLOPT_SSL_VERIFYHOST => 0, // CURLOPT_SSL_VERIFYPEER => false, ); $ch = curl_init();
$options[CURLOPT_URL] = $encUrl; curl_setopt_array($ch, $options);
$content = curl_exec($ch);
curl_close($ch);*/ return $content;}
?>