The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with profiles please
I have recently read this tutorial on how to add new tabs to vBulletin profiles (LINK). I have added a new tab with no problems at all. However, I am trying to include some data in this tab which will show a user's XBox Live information (their avatar, gamercard etc). I have tried using the following:
Code:
<iframe src="http://gamercard.xbox.com/$profilefield[field5].card" scrolling="no" frameBorder="0" height="140" width="204">$profilefield[field5]</iframe> I would really appreciate any help with this |
#2
|
||||
|
||||
Why are you using an iframe?
The field would most likely be specified as $this->profile->userinfo['field5'] (Find the hook location in the actual php pages and you'll see the variable format used there.) |
#3
|
|||
|
|||
I'm using an iFrame because that's the method that Microsoft provides for sharing gamercards You're meant to put the iframe code in your web page or w/e and it'll show all your information. All you have to do is enter your gamertag in the correct place (which is where I'm trying to insert the info from field 5)
|
#4
|
|||
|
|||
Take it nobody can help then?
|
#5
|
||||
|
||||
I suggested using a different variable name. Did you try that?
|
#6
|
|||
|
|||
Yeah, but it didn't work. Possibly because I was doing it wrong due to me being a complete noob xD
|
#7
|
||||
|
||||
Well, in order to help, I need to see exactly what you tried. Please post up the code you tried with a few lines above and below the problem code. Also, what template hook. And, what was the result? An error? A blank page? What? Saying it didn't work can mean so many different things.
|
#8
|
|||
|
|||
Ok, sorry for the lack of information :]
The code to show up in the profiles can be put in one of two places I believe. I decided to put it in the hook "mymodification" under "member_build_blocks_start". This is as is the tutorial I linked in the first post says to do. The code for the whole thing is the following: Code:
$blocklist = array_merge($blocklist, array( 'mymodification' => array( 'class' => 'MyModification', 'title' => 'XBL', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_MyModification extends vB_ProfileBlock { var $template_name = 'memberinfo_block_mymodification'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['mymodification'] != ''); } function prepare_output($id = '', $options = array()) { $this->block_data['mymodification'] = '<iframe src="http://gamercard.xbox.com/$profilefield[field5].card" scrolling="no" frameBorder="0" height="140" width="204">$profilefield[field5]</iframe>'; } } Code:
<div class="alt1 block_row"> <ul class="list_no_decoration"> $block_data[mymodification] </ul> </div> Thanks for trying to help btw :] |
#9
|
||||
|
||||
You did not change the variable name like I suggested in the plugin. You cannot use
$profilefield[field5] in that plugin - it will not work. And you said the tab was empty, but what was in the page source? |
#10
|
|||
|
|||
Ah, I didn't really understand what you meant. So I should try "$userinfo[field5]"?
The page source for that block is this: Code:
<div id="mymodification" class="tborder content_block"> <h4 class="thead block_title"> <a href="#top" rel="nofollow" class="collapse_gadget" onclick="return toggle_collapse('mymodification')"><img id="collapseimg_mymodification" src="http://www.360elites.net/images/greenfox/buttons/collapse_generic.gif" alt="" border="0" /></a> <a name="mymodification"></a> <span class="block_name">XBL</span> </h4> <div class="block_content" id="collapseobj_mymodification" style=""><div class="alt1 block_row"> <ul class="list_no_decoration"> <iframe src="http://gamercard.xbox.com/$profilefield[field5].card" scrolling="no" frameBorder="0" height="140" width="204">$profilefield[field5]</iframe> </ul> </div></div> </div> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|