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)
-   -   Profile Enhancements - XBox Live Avatar (https://vborg.vbsupport.ru/showthread.php?t=225516)

smokin1337 10-18-2009 10:00 PM

XBox Live Avatar
 
1 Attachment(s)
This is a mod to allow users to use their XBox live avatar as their forum avatar. For this there will need to be 2 custom profile fields added.

Install time: 10 min.

The first is:

Single-line text box

Name: XBox live Gamertag

Description: whatever you like

The second is:

Multiple-Selection Checkbox

Name: Use XBox Live avatar

Description: whatever you like

Options: Yes

Then there are 3 template mods to be made:

In memberinfo_block_ministats find:

Code:


<if condition="$prepared['avatarurl']">
<td>
<img src="$prepared[avatarurl]" alt="<phrase 1="$prepared[username]">$vbphrase[xs_avatar]</phrase>" $prepared[avatarsize] class="alt2" id="user_avatar" /></td>
</if>

Replace with:

Code:

<if condition="$prepared['avatarurl']">
<if condition="$userinfo[fieldX]"><td><img src="http://avatar.xboxlive.com/avatar/$userinfo[fieldX]/avatarpic-l.png" border="0" /></td>
<else />

<td>
<img src="$prepared[avatarurl]" alt="<phrase 1="$prepared[username]">$vbphrase[xs_avatar]</phrase>" $prepared[avatarsize] class="alt2" id="user_avatar" /></td></if>
                </if>

In memberlist_resultsbit find:

Code:

<if condition="$show['avatarcol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['avatar']"><img src="$avatarurl" border="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" /></if><else />&nbsp;</if></td>
Replace with:

Code:

<if condition="$show['avatarcol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['avatar']">
<if condition="$userinfo[fieldX]"><img src="http://avatar.xboxlive.com/avatar/$userinfo[fieldX]/avatarpic-l.png" border="0" />
<else />
<img src="$avatarurl" border="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" /></if><else />&nbsp;</if></td></if>

In postbit or postbit_legacy 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:

<if condition="$show['avatar']">
        <if condition="$post[fieldX]"><div>
                                <br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="http://avatar.xboxlive.com/avatar/$post[fieldX]/avatarpic-l.png" border="0" /></a></div>
<else />               
<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>

Replace the red X with the field id for the gamertag.

Replace the blue X with the field id for the avatar.

And that's it their avatar will be replaced with their xbox live avatar pic.

This is optional to show it on the navbar too,

In navbar find:

Code:

<if condition="$show['member']">
<td class="alt5" nowrap="nowrap">
        <div class="smallfont">
<strong><phrase 1="$bbuserinfo[musername]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />

Above it add:

Code:

<if condition="$bbuserinfo[fieldX]"><td><img src="http://avatar.xboxlive.com/avatar/$bbuserinfo[field23]/avatarpic-l.png" border="0" /></td></if>
Please mark installed if you use it.

Have any questions feel free to ask. :D

Big-Pete 10-23-2009 12:49 PM

Cheers, I'll have a go at this over the weekend... Thanks!


All times are GMT. The time now is 02:56 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.01345 seconds
  • Memory Usage 1,725KB
  • 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
  • (8)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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