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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • demo7up
    Member
    • Jul 2007
    • 53
    • 3.6.x

    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
  • Trevor Hannant
    vBulletin Support
    • Aug 2002
    • 24325
    • 5.7.X

    #2
    You should really post over at http://www.vbulletin.org for assistance with plugins
    Vote for:

    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

    Comment

    • BirdOPrey5
      Senior Member
      • Jul 2008
      • 9613
      • 5.6.3

      #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

      • demo7up
        Member
        • Jul 2007
        • 53
        • 3.6.x

        #4
        You were right i figured it out.

        Originally posted by Joe D.
        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

        • Lats
          Senior Member
          • Mar 2002
          • 3671

          #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...