Announcement

Collapse
No announcement yet.

Building a plugin but i need help with one thing...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Building a plugin but i need help with one thing...

    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."\">";
    Hook Location: global_start

    It loads sucessfully but all the way at the top of the forum and pushes the board down.

    doesnt matter where i add {vb:raw wowapi}
    sigpic

  • #3
    It's the echo statement showing at the top of the page- echo always go in top of a page, it's not the way you're supposed to display information.

    You need to do some extra work to save what you want in a variable, then register the variable to an existing template, then edit the template to output it.

    vBulletin.org will help you with these things.

    Comment


    • #4
      You were right i figured it out.

      Originally posted by Joe D. View Post
      It's the echo statement showing at the top of the page- echo always go in top of a page, it's not the way you're supposed to display information.

      You need to do some extra work to save what you want in a variable, then register the variable to an existing template, then edit the template to output it.

      vBulletin.org will help you with these things.
      Thanks they were able to help me except for one problem im having..

      My plugin is complete works great i cant figure out how to only show it to registered users and above? can u point me in the right direction please thanks

      - - - Updated - - -

      Figured it out for those who may need in the future here it is

      Code:
      if($vbulletin->userinfo['usergroupid'] == 5 OR $vbulletin->userinfo['usergroupid'] == 6 OR $vbulletin->userinfo['usergroupid'] == 7 OR $vbulletin->userinfo['usergroupid'] == 10) {  your code here  }
      sigpic

      Comment


      • #5
        Or in a easier to read format...
        Code:
        if(in_array($vbulletin->userinfo['usergroupid'],array(5,6,7,10)))
        {
            your code here
        }
        Lats...

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X