tattooz |
09-17-2010 06:19 PM |
Ok, this is for a block in the forum or the CMS widget, assuming that you have avatars set to filesystem, NOT database
Be sure to change the member count to however many you want to show. Also, look down at the bottom of the code where the <img src= tag is and make sure the path to the forums directory is right for your board.
I hope this works for you.
PHP Code:
$member_count = 1;
ob_start(); require_once('./includes/functions_user.php'); require_once('./includes/functions_bigthree.php'); // Get Random Members $newusers_get = vB::$db->query_read(" SELECT ".TABLE_PREFIX."user.userid AS userid, ".TABLE_PREFIX."user.username AS username, ".TABLE_PREFIX."user.avatarrevision AS avatarrevision, ".TABLE_PREFIX."customavatar.dateline AS dateline FROM ".TABLE_PREFIX."customavatar LEFT JOIN ".TABLE_PREFIX."user ON ".TABLE_PREFIX."customavatar.userid=".TABLE_PREFIX."user.userid WHERE ".TABLE_PREFIX."customavatar.visible = 1 AND ".TABLE_PREFIX."user.usergroupid = $usergroup_limit ORDER BY RAND() LIMIT $member_count"); $output_bits = '<p align="center"'; while($newuser = vB::$db->fetch_array($newusers_get)) { $output_bits .= '<a href="member.php?u='.$newuser[userid].'"><img src="/forums/customavatars/avatar'.$newuser[userid].'_'.$newuser[avatarrevision].'.gif" alt="'.$newuser[username].'"/ width="125" height="125"><br />'.$newuser[username].'</a><br />'; } $output_bits .= '</p>'; $output = $output_bits; ob_end_clean();
|