Home of the Ultimate Xbox 360 Modding Tool, Horizon. XboxMB.com is a community of Xbox 360 gamers and modders who share Tutorials, News, Reviews, and other resources. Xbox Message Boards is free to sign up and use, so what are you waiting for? Register Now!
Since the API is updated. I have changed my XboxMB API class here are they:
PHP Code:
<?php class XboxMB {
public $Valid; public $UID; public $Username; public $Title; public $Staff; public $Diamond; public $Banned; public $Posts; public $Thanks; public $TimeZone; public $Gamertag; public $Minecraft; public $Joined;
//Create a new instance of XboxMB API class public function __construct($username, $mode = "Normal") { $this->Load($username, $mode); //Load in a user }
//Load a new user public function Load($username, $mode = "Normal") { //init the CURL request. $info = curl_init();
//set the session to retrieve from this url. if($mode == "Normal") curl_setopt($info, CURLOPT_URL, "http://api.xboxmb.com/?u=" . urlencode($username)); else if($mode == "Minecraft") curl_setopt($info, CURLOPT_URL, "http://api.xboxmb.com/?mc=" . urlencode($username));
//set the session to return data from the session's url curl_setopt($info, CURLOPT_RETURNTRANSFER, true);
//sets the variable $result to cotathe returned data. $result = curl_exec($info);
curl_close($info);
$result = json_decode($result, true);
//is the user valid? $this->Valid = $result['Valid'];
//set the correctly formatted username (Capitalization). $this->Username = $result['Username'];
Programming today is a race between software engineers striving to build bigger and better
idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far, the Universe is winning.
Last edited by sgt frankieboy; 12-11-2011 at 03:00 PM.