Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Show Your XBOX 360 Gamertag as your Avatar in Postbit Details »»
Show Your XBOX 360 Gamertag as your Avatar in Postbit
Version: 1.00, by Nazarath Nazarath is offline
Developer Last Online: Jun 2008 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.4 Rating:
Released: 01-20-2007 Last Update: Never Installs: 14
Template Edits
Code Changes  
No support by the author.

Ok for those of you that have an xbox 360 site that is running this great software I have a mod for you.

If you would like to have it when your members post a message it shows there gamertag instead of the avatar that they post then follow these simple steps. Please keep in mind that this mod implies that you have not modified your postbit template. If you have modified your postbit template then you will need to change this around a bit.

Modifications:
2 Extra Fields
1 Template modification

Add 2 New Fields:

Note the field IDs for each new UserField, which you will need in the template code.

1st New UserField

Go to AdminCP -> User Profile Fields -> Add New User Profile Field
Profile Field Type: Single-Selection Radio Buttons
Title: XBOX 360 (or what ever you want it to be)
Description: Do you have an XBOX 360 Gamertag? If so Please select Yes. (or what ever you want it to be)
Options:

No
Yes
Note... these options have to be exactly Yes and No otherwise the changes won't work

Set Default: Yes (This will set "No" To the default Option if you put "No" First)
Field Required: No, but display at registration (or what ever you want it to be)
Field Editable by User: Yes
Allow user to input their own value for this option: No
Click Save.

2nd New UserField

Go to AdminCP -> User Profile Fields -> Add New User Profile Field
Profile Field Type: Single-Line Text Box
Title: XBOX 360 Gamertag (or what ever you would like it to be)
Description: Please type your Gamertag Here. (or what ever you would like it to be)
Field Required: No, but display at registration (or what ever you want it to be)
Field Editable by User: Yes
Click Save.

Now don't forget to get the Field ID's From these 2 options. Cause you are going to need them in the next step.

Template Modification:

Go to AdminCP -> Styles & Templates -> Style Manager
In the drop down for your style click on the "Edit Template"
In the list expand the "Postbit Templates"
Then double-click on "postbit"

Find The Following:
PHP Code:
<!-- user info -->
            <
table cellpadding="0" cellspacing="$stylevar[cellpadding]border="0" width="100%">
                <
tr>
                    <
td>
                        <if 
condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]$post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></if>
                        <
div id="postmenu_$post[postid]">
                            <if 
condition="$show['profile']">
                                <
class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                                
$post[onlinestatus]
                                <
script type="text/javascript"vbmenu_register("postmenu_$post[postid]"true); </script>
                            <else />
                                
$post[musername]
                            </if>
                        </
div>
                        <if 
condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
                        <if 
condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
                        <if 
condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
                        <
br>
                        <
div class="smallfont">
                            <if 
condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
                            <if 
condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
                            <if 
condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
                            <
div>
                                
$vbphrase[posts]: $post[posts]
                            </
div>
                            <if 
condition="$show['infraction']"><div>$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div></if>
                            <
div>$post[icqicon$post[aimicon$post[msnicon$post[yahooicon$post[skypeicon]</div>
                        </
div
Change that to be:
PHP Code:
<!-- user info -->
            <
table cellpadding="0" cellspacing="$stylevar[cellpadding]border="0" width="100%">
                <
tr>
                    <
td>
                        <
div id="postmenu_$post[postid]">
                            <!-- 
Xbox 360 Gamertag Hack -->
                            <if 
condition="$post['fieldX'] == 'Yes'">
                                <
iframe src="http://gamercard.xbox.com/$post[fieldX].card" scrolling="no" frameBorder="0" height="140" width="204"></iframe>
                            <else />
                                <if 
condition="$show['avatar']"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]$post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></if>
                                    <if 
condition="$show['profile']">
                                        <
br>
                                        <
class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                                        
$post[onlinestatus]
                                        <
script type="text/javascript"vbmenu_register("postmenu_$post[postid]"true); </script>
                                    <else />
                                        
$post[musername]
                                </if>
                            </if>
                            <!-- / 
End Xbox 360 Gamertag Hack -->
                        </
div>
                        <if 
condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
                        <if 
condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
                        <if 
condition="$show['reputation']"><if condition="$show['reppower']">$vbphrase[reppower]: <span id="reppower_$post[postid]_$post[userid]">$post[reppower]</span> </if><div><span id="repdisplay_$post[postid]_$post[userid]">$post[reputationdisplay]</span></div></if>
                        <
br>
                        <
div class="smallfont">
                            <if 
condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
                            <if 
condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
                            <if 
condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
                            <
div>
                                
$vbphrase[posts]: $post[posts]
                            </
div>
                            <if 
condition="$show['infraction']"><div>$vbphrase[infractions]: $post[warnings]/$post[infractions] ($post[ipoints])</div></if>
                            <
div>$post[icqicon$post[aimicon$post[msnicon$post[yahooicon$post[skypeicon]</div>
                        </
div
After Changing it find the following line:
PHP Code:
<if condition="$post['fieldX'] == 'Yes'"
Change the X in $post['fieldX'] == 'Yes' to match the Field ID of the Single-Selection Radio Buttons Field

Next, Find:
PHP Code:
<iframe src="http://gamercard.xbox.com/$post[fieldX].card" scrolling="no" frameBorder="0" height="140" width="204"></iframe

Added on 02/12/07.

If you would like to have it display just the gamercard without taking the place of anything else just put the code below where ever you like.


PHP Code:
<if condition="$post['fieldX'] == 'Yes'">
                                <
iframe src="http://gamercard.xbox.com/$post[fieldX].card" scrolling="no" frameBorder="0" height="140" width="204"></iframe>
                            </if> 
Change the X in $post[fieldX].card to the Field ID of the Single-Line Text Box.

Thats It for any changes. Save your template and go add your gamertag to your profile and have a look.

If you have any questions feel free to ask.

Help support me and my site by going to http://www.ravensreapers.com and helping our site grow.

If you use this Mod Please click Installed.

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 02-12-2007, 08:45 AM
SnapOff Racing SnapOff Racing is offline
 
Join Date: Apr 2006
Posts: 336
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see you just fixed my issue! can i have a detailed explanation as to what i did wrong?
Reply With Quote
  #23  
Old 02-12-2007, 08:54 AM
Nazarath Nazarath is offline
 
Join Date: Jan 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the gamercard is a height of 140 pixels and a width of 204 pixels
Reply With Quote
  #24  
Old 02-12-2007, 09:08 AM
Nazarath Nazarath is offline
 
Join Date: Jan 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SnapOff Racing View Post
I see you just fixed my issue! can i have a detailed explanation as to what i did wrong?
Here is what was wrong. When you had created the select radio box option to have the "Yes" and "No" options you had put them like this "* Yes" and "* No".

Then when the section that looks for this option was running it was looking for just "Yes" not "* Yes". So after racking my brain on the code for a bit....lol trying to see what could be causing it I checked the options and saw that. Changed them to just say "Yes" and "No" and then went back to my profile and reset the option to "Yes" and it started displaying.

Thanks for pointing out that small problem to me too. I am going to update my original post to state this and also put in the code to have it just display with it not taking the place of the avatar.

Edit:

Sorry about that I noticed that in my explination at the top the options have the * on them. I should have specified it a bit better....lol
Reply With Quote
  #25  
Old 02-12-2007, 06:10 PM
xboxchatdotus xboxchatdotus is offline
 
Join Date: Feb 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it just dowsnt show up for me no matter what i do maybe youcan have a look at it for me?

i have attached my postbit in a text file canyou havea look at it
Reply With Quote
  #26  
Old 02-13-2007, 03:52 PM
Nazarath Nazarath is offline
 
Join Date: Jan 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xboxchatdotus View Post
it just dowsnt show up for me no matter what i do maybe youcan have a look at it for me?

i have attached my postbit in a text file canyou havea look at it
Ok try these things.

Check to see if you are using postbit or postbit_legacy. to do this go to
[B]vBulletin Options -> Style & Language Settings -> Use Legacy (Vertical) Postbit Template[B]

See if you have that set to Yes or No. If it is set to yes then you will need to add this hack to the postbit_legacy instead of postbit.

Check to see if you have specified the options correctly (Instead of *No and *Yes change them to No and Yes without the *) and then save and go back to your profile and choose the option again.

Check to see if you are applying it to the correct style (if you have multiple styles)

Check that stuff and if that doesn't work then please post a link to your site and I may need to do the same thing on your site as I did for SnapOff (Which was to register and for you to give me super admin and if you don't trust me just ask SnapOff that I will not do anything to harm your site or steal any data from your site. I am trust worthy and how else am I supposed to support my hacks/mods.....lol)
Reply With Quote
  #27  
Old 02-22-2007, 04:30 PM
Mojito Mojito is offline
 
Join Date: Dec 2006
Location: Moscow, Russia
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be cool to be able to display the gamertag in certain forums (not all forums on my board are xbox related"
Reply With Quote
Reply

Thread Tools

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:49 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.03993 seconds
  • Memory Usage 2,362KB
  • Queries Executed 22 (?)
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
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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