2012-04-05, 04:29 AM
Hey all,
I have a question i have this code:
To get the data from the wow-armory to retrieve the thumbnail(avatar) which works. But now is my question how do i integrate this into my forum. I want this to be an option visible on the change avatar page.
In the form of:
Any help would be greatly appreciated
I have a question i have this code:
<?php
$charname = $_POST["cname"]; //input character name
$realmname = $_POST["rname"]; //input realm name
$charurl = urlencode($charname); //prepares character name for url usage
$realmurl = 'http://eu.battle.net/api/wow/character/'.$realmname.'/'; //combines the basic url link with the realm name
$toon = $realmurl.$charurl //adds the charactername behind the realm url
$data = file_get_contents($toon); //retrieves the data from the armory api
$obj = json_decode($data);?> <!--converts the data from json to be used in the php code-->
<a href="http://eu.battle.net/static-render/eu/<?php echo $obj->thumbnail; ?>"> </a><br /> <!-- Is url link to image-->
To get the data from the wow-armory to retrieve the thumbnail(avatar) which works. But now is my question how do i integrate this into my forum. I want this to be an option visible on the change avatar page.
In the form of:
Armory Avatar -- Character Name: (cname)
Realm Name: (rname)
Which when the form is filled in ( cname/rname ) returns the URL for the image (after hitting submit). And changes your avatar to that URL.Any help would be greatly appreciated