View Single Post
  #2  
Old 11-27-2006, 07:49 AM
DigitalDesktops DigitalDesktops is offline
 
Join Date: Mar 2003
Location: Scotland, UK
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After searching the entire vBulletin.org forums for exactly the same thing, and finidng nothing, I decided to make this myself. N.b. This is a template modification at the moment. I am working on a plugin but it wont be done for ages as it isn't high on my priority list at the moment.

First, you need to create a new User Profile Field. It is to be a text box that users can put a URL to an image in that will eventually be their own custom RPG avatar. Note down the field name for future use.

Then, go to the style you want these changes to show in and edit templates. Find postbit or postbit_legacy. Then find the following code:

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 it with this code:
Code:
<if condition="$show['avatar']">
	<if condition="in_array($thread[forumid], array(42, 70, 43, 149, 44, 146, 103, 145, 52, 65, 82, 73, 77, 74, 47, 137, 138, 139, 50, 108, 177, 176, 178, 143, 101, 164, 63,  175, 174,  147, 144, 182))">
		<if condition="$post['field24']">
			<div class="smallfont">
				&nbsp;<br />
			<a href="member.php?$session[sessionurl]u=$post[userid]">
			<img src="$post[field24]" $post[avwidth] $post[avheight] alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" 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>
	<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>

Look at the above code, you can see a long list of numbers in an array. Those numbers are the forum ids for the forums you want the avatars to change in. Adjust those numbers for the forum ids that are on your forums that you want the avatars to change in.
Underneath that code there is an if conditional with "field24" listed. Replace the number 24 with whatever number your new custom user profile field is. Then do the same for the field24 part further down which is the image url for the avatar to use. And then you are done.
Make sure to do the template changes in any styles you want this to work in. I have masses of templates on my forums so it took a while, but luckily it is just a copy and paste job and only in one template.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01250 seconds
  • Memory Usage 1,771KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete