The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
I'm trying to create a hack which displays member's avatars in memberlist.php. So, in memberlist.php, where it says this...
PHP Code:
PHP Code:
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
hmm im not sure why but maybe try to use a variable w/o array
ie $avatar and are u sure $userinfo[avatar] is actually the avatar? try this: PHP Code:
|
|
#3
|
||||
|
||||
|
Code:
$[high]avatarurl[/high]=getavatarurl($[high]userinfo[/high][userid]);
if ($[high]avatarurl[/high]!='') {
eval("\$userinfo[avatar] = \"".gettemplate("postbit_avatar")."\";");
} else {
$[high]userinfo[avatar][/high] = " ";
}
eval("\$userinfo[profile] = \"".gettemplate("postbit_profile")."\";");
And [high]avatarurl[/high] because that's what postbit_avatar uses. |
|
#4
|
||||
|
||||
|
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")."\";");
}
Code:
if ($userinfo[homepage]!="" and $userinfo[homepage]!="http://") {
Code:
$users=$DB_site->query("SELECT *
FROM user,userfield
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
|
|
#5
|
||||
|
||||
|
Oh, that's perfect, FireFly! Thanks for helping out a PHP-newbie!
|
|
#6
|
|||
|
|||
|
This doesn't seem to display custom avatars tho... can anyone post a mod that will allow this to show them?
|
|
#7
|
||||
|
||||
|
[QUOTE]Originally posted by HellRazor
This doesn't seem to display custom avatars tho... can anyone post a mod that will allow this to show them? |
|
#8
|
|||
|
|||
|
OK, i'm probably going to get smacked down for asking a stupid question, but where do you put $userinfo[avatar] in the template???
Thanks :cheeky: h Eric C |
|
#9
|
||||
|
||||
|
[QUOTE]Originally posted by svoec
OK, i'm probably going to get smacked down for asking a stupid question, but where do you put $userinfo[avatar] in the template??? Thanks :cheeky: h Eric C |
|
#10
|
|||
|
|||
|
that worked great, I was trying to edit the wrong template.
only problem is, it throws the columns off one row. Did I miss something?? or do I need to change another template?? Thanks again! Eric C |
![]() |
|
|