vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Show Your XBOX 360 Gamertag as your Avatar in Postbit (https://vborg.vbsupport.ru/showthread.php?t=137154)

Nazarath 01-20-2007 10:00 PM

Show Your XBOX 360 Gamertag as your Avatar in Postbit
 
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.

Qwest 01-21-2007 10:04 PM

Where's teh demo?

jgommel 01-21-2007 11:12 PM

I modified it to show in the Members profile instead, but thanks for the idea.

Nazarath 01-22-2007 12:09 AM

Quote:

Originally Posted by Qwest (Post 1164599)
Where's teh demo?

Oops... Forgot to put a screenshot... my bad.. Kind of hard to show a demo though as it deals with a member profile...(goes to do that now)

GruntHalo 01-25-2007 12:38 AM

Fantastic Thanks Alot!

xboxchatdotus 02-05-2007 12:22 AM

forsome reason i cant get this too work

Nazarath 02-05-2007 04:46 AM

What problems are you having with this? Is it not showing up when you make a post?

Make sure that you made this modification on the postbit (Not postbit_legacy I will post up the modification to postbit_legacy in a couple of days as I just changed it on my board to work)

SnapOff Racing 02-05-2007 09:44 AM

Quote:

Originally Posted by Nazarath (Post 1174989)
What problems are you having with this? Is it not showing up when you make a post?

Make sure that you made this modification on the postbit (Not postbit_legacy I will post up the modification to postbit_legacy in a couple of days as I just changed it on my board to work)

it's not showing up for me either...i made all changes accordingly...i am running iskinblack...would this make a difference?

all profile fields are filled out accordingly but it's not showing up :(

Nazarath 02-06-2007 07:06 AM

Quote:

Originally Posted by SnapOff Racing (Post 1175091)
it's not showing up for me either...i made all changes accordingly...i am running iskinblack...would this make a difference?

all profile fields are filled out accordingly but it's not showing up :(

Copy your postbit template to a text document and attach it here and i'll take a look at it and see what the problem could be. Same goes for you xboxchatdotus

SnapOff Racing 02-06-2007 07:23 AM

Quote:

Originally Posted by Nazarath (Post 1175822)
Copy your postbit template to a text document and attach it here and i'll take a look at it and see what the problem could be. Same goes for you xboxchatdotus

hope that's all u needed...i'd like to get this working asap. thanks man! :up:


All times are GMT. The time now is 02:41 AM.

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.01212 seconds
  • Memory Usage 1,857KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete