Back to vBulletin 4.x Add-ons

Widget - Show random members with picture
Mod Version: 1.01, by slumbermann

vB Version: 4.0.1 Rating: (6 votes - 4.67 average) Installs: 106
Released: 10 Feb 2010 Last Update: Never Downloads: 0
Not Supported Auto-Template Re-usable Code Translations  

#Function:
  • Show random members which have profile picture
  • 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 to use custom profile picture as the source of picture

Code:
$member_count = 3;
  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."customprofilepic.dateline AS dateline FROM ".TABLE_PREFIX."customprofilepic
	LEFT JOIN ".TABLE_PREFIX."user
			ON ".TABLE_PREFIX."customprofilepic.userid=".TABLE_PREFIX."user.userid
    WHERE ".TABLE_PREFIX."customprofilepic.visible = 1
   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="image.php?u='.$newuser[userid].'&dateline='.$newuser[dateline].'&type=profile" alt="'.$newuser[username].'"/><br />'.$newuser[username].'</a><br />';
  }
  $output_bits .= '</p>';
  $output = $output_bits;
  ob_end_clean();
#code if you want to use custom avatar as the main source for the picture

Code:
$member_count = 3;
  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."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
   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="image.php?u='.$newuser[userid].'&dateline='.$newuser[dateline].'" 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.

Download

No files for download.

Supporters / CoAuthors

  • slumbermann

Screenshots

Click image for larger version
Name:	random-members.jpg
Views:	2176
Size:	16.0 KB
ID:	111997  

Similar Mods

vBulletin CMS Widgets Photopost Pro Random Image Widget vBulletin 4.x Add-ons

vblts.ru supports vBulletin®, 2022-2024