Jump to content

cbox


Recommended Posts

Posted

Pass $information['Player']['ReachEmblem'] from /player/details/nostats API, to this neat function, which I ended up posting on haloreachapi.net.

 

Then you get returned a string of the URL. You can specify the size, but otherwise its defaulted to 70.

 

	private function _getEmblem($subject, $size = 70)
{

	/* check for array */
	if (is_array($subject))
	{
		/* thanks: http://www.haloreachapi.net/wiki/Emblems */

		/* Emblem to Link */
		$bi = $subject['background_index'];
		$fi = $subject['foreground_index'];
		$fl = $subject['flags'] ? 0 : 1;
		$c0 = $subject['change_colors'][0];
		$c1 = $subject['change_colors'][1];
		$c2 = $subject['change_colors'][2];
		$c3 = $subject['change_colors'][3];

		/* Send it back */
		return "http://www.bungie.net/Stats/emblem.ashx?s=$size&0=$c0&1=$c1&2=$c2&3=$c3&fi=$fi&bi=$bi&fl=$fl&m=3";

	} else
	{
		return "";
	}

}

  • Like 2
Posted (edited)

Ahh, i saw that on the API wiki, but im very new to PHP. so i had no idea what todo with it.

 

Thanks :)

 

Update:

I'm getthig this error;

"Fatal error: Cannot use object of type stdClass as array in ***/reachstats.php on line 49"

 

How are you calling the function?

Edited by Xerax

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...