I found the solution for how to show random members with picture from specific group.
The following code will allow you to:
1- Show random members which have profile picture from specific group.
2- Clickable picture and username to go to member's profile page.
Installation:
1- Go to Admin CP > vBulletin CMS > Widgets > create new widget.
2- Widget type > PHP Direct Execution . Title > Random Members . Description > Show random members.
3- Click save.
4- Then click configure and put the code below.
Code:
PHP Code:
$member_count = 3;
$usergroup_limit = 6;
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="/customavatars/avatar'.$newuser[userid].'_'.$newuser[avatarrevision].'.gif" alt="'.$newuser[username].'"/><br />'.$newuser[username].'</a><br />';
}
$output_bits .= '</p>';
$output = $output_bits;
ob_end_clean();
Note: You can edit the amount of members you want to show by changing the $member_count from 3 to whatever value you want. Also you can change the usergroup_limit number to match the usergroup you want to display. 6 for example is Administrators.
Reference:
https://vborg.vbsupport.ru/showthread.php?t=235460
Finally: Share what you know, learn what you don't.
Thanks