PDA

View Full Version : Default Avatar if None is Selected


GuruXL
10-20-2002, 10:00 PM
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
10-21-2002, 09:18 PM
Thanks for the recognition.

AviationForum
10-22-2002, 07:50 PM
*Installed* :)

sasjamal
10-25-2002, 06:35 PM
It does not work on 2.28?

Chris M
10-25-2002, 06:42 PM
It should do:)

Satan

NTLDR
10-25-2002, 07:09 PM
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
11-09-2002, 06:40 AM
works for me on 2.2.8 on posts, anit checked other parts

OmaniMan
05-07-2003, 03:49 AM
Great Friends

nnjj.net
05-07-2003, 04:29 AM
work greaaaaaaaat thanx :)

Dean C
05-07-2003, 03:41 PM
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
05-08-2003, 09:49 AM
Guests cannot see contents of [php] and [code] tags in any case. :) But it is recommended to put instructions in a text file.

lordofgun
05-27-2003, 01:25 AM
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??