1

Topic: set default avatar

hey is there (i know there is) a way to setup the default avatar for people that don't use one
i mean for register users
the second req is a way to setup a diffrent default avatar for guests

thanx for helping

Re: set default avatar

I suppose so...

Finds this in viewtopic.php:

if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';
        }
        else
            $user_avatar = '';

Replace it by:

if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';
        }
        elseif($pun_user['is_guest'])
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/guest.png" alt="" />';
        else
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/standard.png" alt="" />';

Create the images guest.png and standard.png. It should do it.

3

Re: set default avatar

thanx

but guest doesn't have anything , no image

members has a image, avatar but from the guest

Re: set default avatar

The try removing

elseif($pun_user['is_guest'])
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/guest.png" alt="" />';

And put

if($pun_user['is_guest'])
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/guest.png" alt="" />';

after the checks.

5

Re: set default avatar

now everyone got the same avatar

Re: set default avatar

Lemme think now...

<?php
if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';
        else if($cur_post['g_id'] == 3)
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/guest.png" alt="" />';    
        }
        else
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/standard.png" alt="" />';
?>

Try that ^^ If that doesn't do it, I don't know anymore =/

7

Re: set default avatar

thanx for helping

now it is better, it works with the members, show the standard.png

but guests doesn't show anything

Re: set default avatar

I'll figure that out tomorrow, too sleepy for it now =/

9

Re: set default avatar

Ok, maybe someone else will come before you smile
Anyway thanks.

10

Re: set default avatar

so here is another day, any suggest from you ?

Re: set default avatar

Let me try ^^

if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' alt="" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' alt="" />';
        }
        elseif($cur_post['g_id'] == 3)
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/guest.png" alt="" />';
        else
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/standard.png" alt="" />';

Does that do it?

12

Re: set default avatar

sad
it is the same , members got the standard.png
and guest nothing

sorry i am not good at that php loops so i can't help with that sad
but if you can please try more smile

Re: set default avatar

Oh, I see what's wrong =P Silly me =/

FIND

// If the poster is a guest (or a user that has been deleted)
    else
    {

Add after:

$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/guest.png" alt="" />';

You can delete the

elseif($cur_post['g_id'] == 3)
            $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/guest.png" alt="" />';

from the previous code too.

14

Re: set default avatar

hehe
Works great !

Re: set default avatar

Excellent big_smile I'll go add this to the wiki =P

16

Re: set default avatar

Yee that would be a good decision smile
Thanks again for your help.