Knowledge Base > How To’s > Customizations > How to Add Xbox Live Gamercard to Your Postbit

in CustomizationsHow To’s

This is a simple bit of coding that you have to do to get your Xbox Gamer Cards to show in your postbit area. This guide was not written by me. It was written by VBleecher here. This guide is to help users who may be curious to know how to add the Xbox Live Gamercard to your postbit like I did on www.Xbox360Clans.net.

  1. Create a new User Profile Field
  2. Select “Single-Line Text Box
  3. Enter Gamertag as the title
  4. Put, Enter your Xbox Live Gamertag Here, as your description
  5. The rest of the settings are you up to you to decide

Remember to make a note of your Field Number that you have just created.

We chose to put the gamercard under the users Avatar, but your free to place it where you want. Now you need to make one edit to the coding.

Go to postbit_legacy template

Find:

PHP Code:
<vb:if condition="$show['avatar']">
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" /></a>
</vb:if>

and after that, add:

PHP Code:
<vb:if condition="$post['fieldX']">
<a class="postuseravatar">
<iframe src="http://gamercard.xbox.com/{vb:raw post.fieldX}.card" scrolling="no" frameBorder="0" height="140" width="204">{vb:raw post.fieldX}</iframe>
</a>
</vb:if>                        

Now in the code that you have just added, you need to change the ‘X‘ with your Gamertag field number that you created earlier!

Now the postbit width in default vB4.0 style is smaller than the gamercards actual size. You can edit the width of the post bit area to ensure that the Gamercard fits. To do this:

  1. Go to Styles & Templates and select Style Manager.
  2. Then select StyleVars for the theme your editing.
  3. Find Postbitlegacy-Userinfo-Width.
  4. Change the size to 220 and save.

If you already have the GamerCards Block in Profile mod, then you can simply use the Xbox Live profile field #that you created for the Xbox Live gamertag instead of creating a new profile field for your postbit.

Your finished.