The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I would like to build a plugin based on the following code
Code:
$json = file_get_contents("http://us.battle.net/api/wow/character/Shattered%20Hand/". $vbulletin->userinfo['username']."?fields=guild,items,professions,reputation,stats", true);
$decode = json_decode($json, true);
$name = " ". $decode[name] ."";
$realm = " ". $decode[realm] ."";
$ailevel = " ". $decode[items][averageItemLevel] ."";
$aeilevel = " ". $decode[items][averageItemLevelEquipped] ."";
$helm = " ". $decode[items][head][name] ."";
$Thumbnail = "". $decode[thumbnail] ."";
$guild_name = " ". $decode[guild][name] ."";
echo "<img src=\"http://us.battle.net/static-render/us/".$Thumbnail."\">";
doesnt matter where i add {vb:raw wowapi} |
|
#2
|
|||
|
|||
|
Not knowing where you want it to appear makes it hard to help.
But the echo is what's doing it. Change the echo to a template hook where you want it to appear. ie: Code:
$template_hook['postbit_userinfo_right'] .= "<img src=\"http://us.battle.net/static-render/us/".$Thumbnail."\">"; |
|
#3
|
|||
|
|||
|
How would i make this show under or above toplinks?
Thanks for your quick response --------------- Added [DATE]1346937602[/DATE] at [TIME]1346937602[/TIME] --------------- I think i figured it out i just have one problem.... Code:
$json = file_get_contents("http://us.battle.net/api/wow/character/Shattered%20Hand/". $vbulletin->userinfo['username']."?fields=guild,items,professions,reputation,stats", true);
how can i tell the script to die if the link fails to load? --------------- Added [DATE]1346961011[/DATE] at [TIME]1346961011[/TIME] --------------- Okay my plugin is working awesome with your guidance justt need help with on piece of code... please ![]() what do i need to add to my code to not display the plugin if user is not logged in? |
|
#4
|
|||
|
|||
|
Something like this would work...
PHP Code:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|