vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Add avatar to each member group , HELP PLZ (https://vborg.vbsupport.ru/showthread.php?t=116508)

coolphim 05-23-2006 10:57 PM

Add avatar to each member group , HELP PLZ
 
I'm looking around to add an avatars to my members group ( 1 for guest, 1 for members, 1 for smod) but i cant find a place to do it. Please help me, appreciate that.

peterska2 05-23-2006 11:17 PM

Do you mean as a default avatar, or in addition to their personal avatars?

coolphim 05-23-2006 11:20 PM

the default please, thanks

peterska2 05-23-2006 11:40 PM

ok, you need to upload an avatar for each usergroup that you have in the format x.gif where x is the usergroupid number for that usergroup (eg for admins you would use 6.gif)

Then in your postbit

FIND

Code:

<if condition="$show['avatar']"><td class="alt2"><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></td>
</if>

REPLACE WITH

Code:

                <if condition="$show['avatar']"><td class="alt2"><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></td>
<else />
<td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$stylevar[imgdir_misc]/$post[usergroupid].gif" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td>
</if>

then in the memberinfo template

FIND

Code:

<if condition="$show['avatar']">
                                <td><img src="$userinfo[avatarurl]" $userinfo[avatarsize] alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>
                        <else />
                                <td>&nbsp;</td>
                        </if>

Replace with

Code:

                <if condition="$show['avatar']">
                                <td><img src="$userinfo[avatarurl]" $userinfo[avatarsize] alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>
                <else />
<td><img src="$stylevar[imgdir_misc]/$userinfo[usergroupid].gif" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></td>
</if>

Just a little warning, if you miss a usergroup then there will be broken images.

coolphim 05-24-2006 12:02 AM

for the code

Code:

        <if condition="$show['avatar']">
                                <td><img src="$userinfo[avatarurl]" $userinfo[avatarsize] alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>
                <else />
<td><img src="$stylevar[imgdir_misc]/$userinfo[usergroupid].gif" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></td>
</if>

Can I locate the source of image from another HOST. I tried to paste the imgage link to this : .......
Code:

<else />
<td><img src="http://www.myimgagelink/2.gif" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></td>
</if>

........ but it doesnt work. THANKS

peterska2 05-24-2006 12:09 AM

Yes you can link to images on another host. Just use
Code:

<img src="[high]FULL URL TO IMAGES FOLDER[/high]/$post[usergroupid].gif" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
in place of the image code in the postbit and
Code:

<img src="[high]FULL URL TO IMAGES FOLDER[/high]/$userinfo[usergroupid].gif" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" />
in place of the image code in the memberinfo template.

so if your images are at http://www.mysite.com/files/graphics/avatars then this will be what you place where it has [high]FULL URL TO IMAGES FOLDER[/high]

Please can you also put your code in the above post into [ code][ /code] tags. Thanks.

ChrisBaktis 09-15-2006 03:59 AM

I have tried and tried I cannot get this to work

peterska2 09-15-2006 10:58 AM

Where are your images located and what are they called?

What code exactly are you using?

Are you getting broken images, or something else?

ChrisBaktis 09-15-2006 03:15 PM

I used the above code (minus the </td> since that was adding an extra column).

The files are in the avatars directory and called 10.gif and 31.gif to represent the 2 usergroups i want to have default avatars.

All I get is the Alt Text message 'Username's Avatar' with the link for people with no avatars, normal avatars for people outside those 2 groups, and nothing new for the people in the 10 & 31 usergroups...

I have tried with the code you have and then I also tried with hard coding the url to the avatars to make sure that wasnt the problem.

ChrisBaktis 09-17-2006 02:58 AM

Any continued support on this would be greatly appreciated.

rogersnm 09-17-2006 08:04 AM

Can you post your code here please.

peterska2 09-17-2006 10:37 AM

As you want it for just 2 usergroups then your code will always cause broken images.

If you can post further details of exactly which usergroups you want it to work for, how exactly you want it to work, and if it is postbit or postbit legacy then I'll have a look at it for you.

ChrisBaktis 09-17-2006 02:11 PM

This is the code im using - the only thing changed are the <td> parts - I removed these so a new column was not created.

Code:

<if condition="$show['avatar']"><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>
                        <else />
                        <a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$stylevar[imgdir_misc]/$post[usergroupid].gif" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</if>

With this code - all members that do not have an avatar selected show the alt message 'Username's Avatar'....Members that have an avatar selected do show properly...

I have 2 gif files setup 10.gif and 33.gif (was 31 in 1st post but groups changed) - the members in these 2 groups only show the 'Username's Avatar' link or the regular avatar if they have selected one.

Maybe I misunderstood the point of this code - now that I have reread the 1st post - maybe this isnt for me...I want members to be able to use regular avatars, but members that I put into certain groups (banned, suspended, etc) I want default avatars to show instead of ones they may have selected.

rogersnm 09-17-2006 02:20 PM

Well if you want usergroup 1/2/default code then you need something like this:
HTML Code:

<if condition="$show['avatar']">
        <if condition="$post['usergroupid'] == X">
                Usergroup X code here
        <else />
        <if condition="$post['usergroupid'] == Y">
                Usergroup Y code here
        <else />
                <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>
        </if>
        </if>
</if>


ChrisBaktis 09-17-2006 03:53 PM

Ok I had to alter the code a little - I couldnt figure out why it wasnt working until I realized that the way it was setup anyone not having an avatar was being skipped - I changed the code to this and it worked great.

Code:

<if condition="$post['usergroupid'] == 10">
                                        <br><center><img src="http://www.site.com/forums/images/avatars/10.gif" border="0" /></center>
                        <else />
                        <if condition="$post['usergroupid'] == 33">
                                        <br><center><img src="http://www.site.com/forums/images/avatars/33.gif" border="0" /></center>
                        </if>
                        <if condition="$show['avatar']">
                                        <br><center><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></center>
                        </if>

Just one more question - I want to do the same thing in the memberinfo template - but I do not think I use the $post[usergroupid] variable - what is the equivalant to this in the member info?


All times are GMT. The time now is 01:04 AM.

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.01453 seconds
  • Memory Usage 1,768KB
  • 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
  • (10)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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