Also using getavatarurl() adds an extra query whenever its run, so in a list with lots of members the page will really slow down.
Anyway, here's how you do it.
In memberlist.php, add this:
Code:
if ($userinfo[avatarid]!=0) {
$avatarurl=$userinfo[avatarpath];
} else {
if ($userinfo[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$userinfo[userid]&dateline=$userinfo[avatardateline]";
} else {
$avatarurl="";
}
}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$userinfo[avatar]="";
} else {
eval("\$userinfo[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
right after this:
Code:
if ($userinfo[homepage]!="" and $userinfo[homepage]!="http://") {
Now replace this:
Code:
$users=$DB_site->query("SELECT *
FROM user,userfield
with this:
Code:
$users=$DB_site->query("SELECT *,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline
FROM user,userfield
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
And now place $userinfo[avatar] in the memberlist template.