PDA

View Full Version : Default Avatar if None is Selected


GuruXL
21 Oct 2002, 22:06
Please note I will NOT provide support for this hack as it is not mine, I am posting it because I made a request for it and I thought it would be nice to be available for those who wanted to use it. I made one small modification to it but other than that its Copyright 2002 to Neo.

FIND In admin/functions.php


if ($post[avatarid]!=0) {
$avatarurl=$post[avatarpath];
} else {
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
} else {
$avatarurl="";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}


AND REPLACE WITH


if ($post[avatarid]!=0) {
$avatarurl=$post[avatarpath];
} else {
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
} else {
$avatarurl="http://www.domain.com/forum/images/avatars/default.gif";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="http://www.domain.com/forum/images/avatars/default.gif";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}


Now you will see that part that I edited. The blank $avatarurl.
Now you can change the path within the one that contains $avatarurl="http://www.domain.com/forum/images/avatars/default.gif"; to any path you want. Just dont touch the other two with parses the avatars on the site.

Thanks again Neo and also hellsatan for his nice input!

Neo
21 Oct 2002, 22:18
Thanks for the recognition.

AviationForum
22 Oct 2002, 20:50
*Installed* :)

sasjamal
25 Oct 2002, 19:35
It does not work on 2.28?

Chris M
25 Oct 2002, 19:42
It should do:)

Satan

NTLDR
25 Oct 2002, 20:09
No reason for it not to work with 2.2.8, however this only covers the postbit and not the numerous other places avatars appear.

sauron2002
09 Nov 2002, 07:40
works for me on 2.2.8 on posts, anit checked other parts

OmaniMan
07 May 2003, 04:49
Great Friends

nnjj.net
07 May 2003, 05:29
work greaaaaaaaat thanx :)

Dean C
07 May 2003, 16:41
Ok i know this is a really old hack but if the author is still around please update the first post and put the hack instructions in a textfile :)

Thanks

- miSt

Erwin
08 May 2003, 10:49
Guests cannot see contents of [php] and [code] tags in any case. :) But it is recommended to put instructions in a text file.

lordofgun
27 May 2003, 02:25
This works well unless you turn avatars off in your profile. Then it shows the link to the avatar and takes up half the width of the page. :D

Any fix??