View Full Version : Default Avatar if None is Selected
GuruXL
10-20-2002, 11:55 PM
This is important, i will see what I can do to make it work...but I would love to see what some others could do.
Neo-Storm
10-21-2002, 07:54 AM
i want that too, please someone make it :)
Automated
10-21-2002, 01:56 PM
That would be nice, it seems quite simple, i am suprise that no one else has ever made it ;)
Matthew
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="images/default.gif";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="images/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="images/default.gif"; to any path you want. Just dont touch the other two with parses the avatars on the site.
Hooloovoo
10-21-2002, 05:50 PM
Cool - thanks Neo. This was somthing I was wondering about. :)
Chris M
10-21-2002, 06:02 PM
Nice:)
Satan
Chris M
10-21-2002, 06:10 PM
You could alternatively try doing this :
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="$defaultavurl";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="$defaultavurl";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
Then going to :
yourdomain.com/forum/admin/setting.php?action=add
Properties :
Setting Category - Avatars
Title - Default Avatar Url
Variable Name - defaultavurl
Value - (leave blank)
Description - Url to the Default Avatar Image
Code to generate option - (leave blank)
Display Order - 1
Then Save...
Then edit your options and enter the url of the default avatar...
=-=
What are the advantages of my way? It is easier to change the Default Avatar url;)
Satan
GuruXL
10-21-2002, 08:58 PM
Originally posted by 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="images/default.gif";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="images/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="images/default.gif"; to any path you want. Just dont touch the other two with parses the avatars on the site.
Thanks from the bottom of my heart :devious:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.