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
You are not logged in. Please login or register.
PunBB Forums → Feature requests → 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
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.
thanx
but guest doesn't have anything , no image
members has a image, avatar but from the guest
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.
now everyone got the same 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 =/
thanx for helping
now it is better, it works with the members, show the standard.png
but guests doesn't show anything
I'll figure that out tomorrow, too sleepy for it now =/
Ok, maybe someone else will come before you
Anyway thanks.
so here is another day, any suggest from you ?
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?
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
but if you can please try more
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.
hehe
Works great !
Excellent I'll go add this to the wiki =P
Yee that would be a good decision
Thanks again for your help.
PunBB Forums → Feature requests → set default avatar
Powered by PunBB, supported by Informer Technologies, Inc.