PDA

View Full Version : Miscellaneous Hacks - Show Your XBOX 360 Gamertag as your Avatar in Postbit


Nazarath
01-20-2007, 10:00 PM
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:
<!-- 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[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></if>
<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a 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:
<!-- 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[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></if>
<if condition="$show['profile']">
<br>
<a 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:
<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:
<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.

<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 (javascript:vborg_doinstall(131143,true)).

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
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
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
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
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:

Nazarath
02-06-2007, 05:51 PM
hope that's all u needed...i'd like to get this working asap. thanks man! :up:

Hmm... The code looks like it is in there correctly, Try taking a look at your usergroup permissions and also your forum permissions to see if you have it where it displays custom fields from a users profile.

SnapOff Racing
02-07-2007, 10:09 AM
Hmm... The code looks like it is in there correctly, Try taking a look at your usergroup permissions and also your forum permissions to see if you have it where it displays custom fields from a users profile.


i can't find where you're talking about...can you paste a screenshot?

SnapOff Racing
02-09-2007, 08:44 AM
nothing to do with my skin either...it's something in the coding or something...

i think you need to check it bro.

i did it on the base default skin and it didnt work either...i REALLY want this to work on my boards, please take a look at it bro

Nazarath
02-10-2007, 08:02 AM
hmm post a link to your site and i'll register on there and see what could be going on. You may have to give me admin rights for me to be able to see what could be causing it. But that is completely up to you

SnapOff Racing
02-10-2007, 06:22 PM
hmm post a link to your site and i'll register on there and see what could be going on. You may have to give me admin rights for me to be able to see what could be causing it. But that is completely up to you

i'm willing to do that.


www.sanpoffracing.com/forums


thanks dude, sooner the better =)

Nazarath
02-11-2007, 08:38 AM
hmm I tried to go to your site and it wouldn't load? were you having server troubles with your site the other night?

EDIT:

lol I saw the problem.... you had www.sanpoffracing.com/forums

should have been www.snapoffracing.com/forums (it was spelled sanp instead of snap.)....lol no probs though

EDIT #2:

Ok I have registered on your site and my username is (what else) Nazarath. I will need admin access and the ability to edit the styles to see what could be going on.... though right now it looks like it may deal with the zoints add-on you have. won't know till i can see the code

SnapOff Racing
02-11-2007, 08:58 AM
oops, sorry about that.

I'm giving your name temp. admin priveleges

Nazarath
02-11-2007, 10:06 PM
OK I have registered on your site. Ill need admin to see what could be causing it. Right now it looks like it might be the zoints but I won't know till i get in there.

Actually it looks like you may need to give me super admin rights... the only way to do that is through the config.php file and find the line that says
$config['SpecialUsers']['superadministrators'] = '1'; and add my user ID number to that and that will get me super admin.... sorry for the trouble

SnapOff Racing
02-12-2007, 03:38 AM
OK I have registered on your site. Ill need admin to see what could be causing it. Right now it looks like it might be the zoints but I won't know till i get in there.

Actually it looks like you may need to give me super admin rights... the only way to do that is through the config.php file and find the line that says
$config['SpecialUsers']['superadministrators'] = '1'; and add my user ID number to that and that will get me super admin.... sorry for the trouble

ok, you're superadmin now...i edited the file

Noonster
02-12-2007, 08:03 AM
Can someone tell me how big in size the avatar will be?

Thanks
Darren

SnapOff Racing
02-12-2007, 08:45 AM
I see you just fixed my issue! can i have a detailed explanation as to what i did wrong?

Nazarath
02-12-2007, 08:54 AM
the gamercard is a height of 140 pixels and a width of 204 pixels

Nazarath
02-12-2007, 09:08 AM
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

xboxchatdotus
02-12-2007, 06:10 PM
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

Nazarath
02-13-2007, 03:52 PM
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)

Mojito
02-22-2007, 04:30 PM
It would be cool to be able to display the gamertag in certain forums (not all forums on my board are xbox related"