Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2009, 08:21 AM
euantor euantor is offline
 
Join Date: Aug 2009
Location: England
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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>
and other varients of it. However, it doesn't show up. I have got a user profile field for people's XBox Live gamertags (it's field ID is 5) and it all works perfectly with the gXboxlive modification.

I would really appreciate any help with this
Reply With Quote
  #2  
Old 08-31-2009, 03:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
  #3  
Old 08-31-2009, 05:21 PM
euantor euantor is offline
 
Join Date: Aug 2009
Location: England
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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.)
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)
Reply With Quote
  #4  
Old 09-02-2009, 02:52 PM
euantor euantor is offline
 
Join Date: Aug 2009
Location: England
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take it nobody can help then?
Reply With Quote
  #5  
Old 09-02-2009, 03:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I suggested using a different variable name. Did you try that?
Reply With Quote
  #6  
Old 09-02-2009, 06:08 PM
euantor euantor is offline
 
Join Date: Aug 2009
Location: England
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, but it didn't work. Possibly because I was doing it wrong due to me being a complete noob xD
Reply With Quote
  #7  
Old 09-02-2009, 06:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 09-02-2009, 06:29 PM
euantor euantor is offline
 
Join Date: Aug 2009
Location: England
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>';
	}
}
The code in the template which is for the tab's block is the following:

Code:
<div class="alt1 block_row">
	<ul class="list_no_decoration">
		$block_data[mymodification]
	</ul>
</div>
The result was that the tab showed up, but when clicked upon, there was nothing shown - it was completely empty.


Thanks for trying to help btw :]
Reply With Quote
  #9  
Old 09-02-2009, 08:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #10  
Old 09-03-2009, 06:43 AM
euantor euantor is offline
 
Join Date: Aug 2009
Location: England
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:33 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04408 seconds
  • Memory Usage 2,261KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete