deathemperor
08-29-2004, 10:00 PM
Well this is likely to be my first hack (glad to hear that ^^)
the funny thing is that I am answering for my own requests (2 here and 1 at vb.com)
but forget it, here is what this hack does:
it simply let you show all buddies when viewing profile.
In member.php find:
$userinfo = verify_id('user', $userid, 1, 1, 15);
add under it:
$whichlist = "buddylist";
// (Dis)Likes
$outuserids = array();
$outuserids = explode(' ', trim($userinfo[$whichlist]));
if (trim($userinfo[$whichlist]) != "") {
$outusers = $DB_site->query("SELECT ".TABLE_PREFIX."user.username,".TABLE_PREFIX."user.userid,".TABLE_PREFIX."usertextfield.".$whichlist." FROM
".TABLE_PREFIX."user,".TABLE_PREFIX."usertextfield WHERE
".TABLE_PREFIX."user.userid = ".TABLE_PREFIX."usertextfield.userid AND
".TABLE_PREFIX."user.userid IN (".implode(',',$outuserids).")
ORDER BY username");
while ($outuser = $DB_site->fetch_array($outusers)) {
if ($outuser[avatarurl]!= ""){$outuser[avatarurl]="clear.gif";}
else {$outuser[avatarurl] = fetch_avatar_url($outuser['userid']);}
$buddyavatar .= "<img src=\"$vboptions[bburl]/$outuser[avatarurl]\">";
$outuserlist .= "<a class=\"smallfont\" href=\"$vboptions[bburl]/member.php?u=$outuser[userid]\"/>$outuser[username]</a>";
}
}
in MEMBERINFO templates:
add $buddyavatar for buddy(s) avatar
add $outuserlist for buddy(s) username
and you are done
how bad is this very minor script add 5 queries, if any veteran coder know how to solve this, please have a post, tnx.
don't blame me, this is my first hack you know. ;P
the funny thing is that I am answering for my own requests (2 here and 1 at vb.com)
but forget it, here is what this hack does:
it simply let you show all buddies when viewing profile.
In member.php find:
$userinfo = verify_id('user', $userid, 1, 1, 15);
add under it:
$whichlist = "buddylist";
// (Dis)Likes
$outuserids = array();
$outuserids = explode(' ', trim($userinfo[$whichlist]));
if (trim($userinfo[$whichlist]) != "") {
$outusers = $DB_site->query("SELECT ".TABLE_PREFIX."user.username,".TABLE_PREFIX."user.userid,".TABLE_PREFIX."usertextfield.".$whichlist." FROM
".TABLE_PREFIX."user,".TABLE_PREFIX."usertextfield WHERE
".TABLE_PREFIX."user.userid = ".TABLE_PREFIX."usertextfield.userid AND
".TABLE_PREFIX."user.userid IN (".implode(',',$outuserids).")
ORDER BY username");
while ($outuser = $DB_site->fetch_array($outusers)) {
if ($outuser[avatarurl]!= ""){$outuser[avatarurl]="clear.gif";}
else {$outuser[avatarurl] = fetch_avatar_url($outuser['userid']);}
$buddyavatar .= "<img src=\"$vboptions[bburl]/$outuser[avatarurl]\">";
$outuserlist .= "<a class=\"smallfont\" href=\"$vboptions[bburl]/member.php?u=$outuser[userid]\"/>$outuser[username]</a>";
}
}
in MEMBERINFO templates:
add $buddyavatar for buddy(s) avatar
add $outuserlist for buddy(s) username
and you are done
how bad is this very minor script add 5 queries, if any veteran coder know how to solve this, please have a post, tnx.
don't blame me, this is my first hack you know. ;P