vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Show Thread Enhancements - Use XBox Live stuff as avatars (https://vborg.vbsupport.ru/showthread.php?t=228506)

euantor 11-20-2009 10:00 PM

Use XBox Live stuff as avatars
 
1 Attachment(s)
This is yet another XBox Live based mod. This one allows your users the choice to use their gamercard as an avatar, their official XBox Live avatar as their avatar or a standard uploaded one.

There are two profile fields to create (assuming you already have a profile field for XBox Live Gamertags...)

#1

Name: Use XBL Gamercard
Type: Multiple-Selection Checkbox
Description: Do you wish to use your XBox Live Gamercard as your avatar on the site? For this to work, you must enter your gamertag in the gamertag field.
Fields: Use XBox Live Gamertag?

#2

Name: Use XBL Avatar?
Type: Multiple-Selection Checkbox
Description: Do you wish to use your XBox LiveAvatar as your avatar on the site? For this to work, you must enter your gamertag in the gamertag field.

Note: You cannot have both this option ticked and the option to use your gamercard. Please make sure only one is ticked.
Fields: Use XBox LiveAvatar?

__________________________________________________ ________

Now for some template edits!

Open up your postbit or postbit_legacy template - depending on which yu are using.

Find:

Code:

<if condition="$show['avatar']">
                                <div class="smallfont">
                                        &nbsp;<br /><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>


                                </div>
</if>

Replace with:

Code:

<!-- Avatar -->
<if condition="$post[fieldY]">
<div class="smallfont">
&nbsp;<br /><iframe src="http://gamercard.xbox.com/$post[fieldX].card" scrolling="no" frameBorder="0" height="140" width="204">$post[fieldX].</iframe>
</div>
<else />
<if condition="$post[fieldZ]">
<div class="smallfont">
                                        &nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="http://avatar.xboxlive.com/avatar/$post[fieldX]/avatarpic-l.png" alt="XBL Avatar" title="$post[fieldX]" border="0" /></a>

</div>
<else />
<if condition="$show['avatar']">
                                <div class="smallfont">
                                        &nbsp;<br /><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>


                                </div>
</if>
</if>
                        </if>
<!-- /Avatar -->

Ok, to get this to work with your site, you're going to need to change the field IDs.

Change the IDs as shown belo:

Change fieldX -> the field ID of your gamertag field
Change fieldY -> the field ID of the field that asks if the user wants to use their gamercard
Change fieldZ -> The field ID of the field that asks if the user wants to use their XBL Avatar

_____________________________________________

Now just save and reload the template. If the user selects the checkbox to use their gamerard as their avatar, the avatar shown in their posts will be replaced by their gamercard.

Screenshots below.


All times are GMT. The time now is 03:52 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.01539 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete