Thread: Default Avatar
View Single Post
  #191  
Old 08-31-2007, 06:09 PM
Arminios Arminios is offline
 
Join Date: Apr 2006
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ultima07 View Post
HI I hate to see everyone having the same avatar, so i suggest a mod in the apropriate section so that each new registered member will have an apropriate COUNTRY avatar according to the COUNTRY they choose from the registeration. Tell me if this is possible.
The code for it is already written. However, I found it easier without using this plugin.

https://vborg.vbsupport.ru/showthrea...highlight=menu <-- Where I found the code.

However, this is what you do:

Go into the postbit_legacy template and 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>

Change it to
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>
			<else />
<br />
<if condition="$post[fieldX]"><img src="images/YOURPATH/$post[fieldX].gif" alt="$post[fieldX]"></if>

			        </if>
You will need to change the "fieldX" to the User Profile Field that have your country list. Then you change the url to the location where you got your avatars saved.

It's important they are called the same thing as the inputs you have in the User Profile fields.

F.ex if Denmark, Norway and Sweden are in your list you need to have avatar files called Denmark.gif, Norway.gif and Sweden.gif.

If it's .png or .jpg files, even something else, you need to change ".gif" to that in the code.

Just PM me if you need more assistance with it.

However, that will only show the avatar in the postbit field, I'm trying to find out how to change it in the profile and memberlist also, I'm just experimenting my way through hacks.


edit:
I would be delighted if anyone could tell me how to modify my memberlsit by doing what I did in my postbit. https://vborg.vbsupport.ru/showthrea...49#post1329549

I tried a little, but it didn't work out, and I'm getting a little tired after a long workday

The code I was trying to change was in the memberlist_resultbit
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" /><else />&nbsp;</if></td></if>
I tried replacing "&nbsp;" with my code, but think that was wrong since nothing came up.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01108 seconds
  • Memory Usage 1,778KB
  • 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
  • (3)bbcode_code
  • (1)bbcode_quote
  • (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