Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Widget - Show random members with picture Details »»
Widget - Show random members with picture
Version: 1.01, by slumbermann slumbermann is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.1 Rating:
Released: 02-09-2010 Last Update: Never Installs: 106
Auto-Templates
Re-useable Code Translations  
No support by the author.

#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.

Screenshots

File Type: jpg random-members.jpg (16.0 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 09-14-2010, 12:44 AM
tattooz tattooz is offline
 
Join Date: Aug 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mse2k View Post
Hallo ... i use VB 4.0.6 ... the widget shows the name of the user but not a picture ... what`s wrong? THX
Same here, sometimes it shows all photos, sometimes it shows some of them and sometimes none....?
Reply With Quote
  #73  
Old 09-16-2010, 09:43 PM
dang3rzon3 dang3rzon3 is offline
 
Join Date: Sep 2009
Location: Milano (Italy)
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mse2k View Post
Hallo ... i use VB 4.0.6 ... the widget shows the name of the user but not a picture ... what`s wrong? THX
i have the same problems
Reply With Quote
  #74  
Old 09-17-2010, 06:19 PM
tattooz tattooz is offline
 
Join Date: Aug 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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(); 
Reply With Quote
  #75  
Old 01-08-2011, 07:21 PM
tattooz tattooz is offline
 
Join Date: Aug 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tweaked this widget to work HORIZONTALLY. Let me know if it's good. You can change the member count and the avatar size. Also, if you do not want to limit it to a certain usergroup, remove this line "$usergroup_limit = 2;"

Code:
$member_count = 8;
$usergroup_limit = 2;

  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
   ORDER BY RAND()
   LIMIT $member_count");
  $output_bits = '<table cellpadding="5"><tr>';
  while($newuser = vB::$db->fetch_array($newusers_get))
  {
        $output_bits .= '<td><a href="member.php?u='.$newuser[userid].'"><img src="/customavatars/avatar'.$newuser[userid].'_'.$newuser[avatarrevision].'.gif" alt="'.$newuser[username].'"/ width="100" height="100"><br />'.$newuser[username].'</a></td>';
  }
  $output_bits .= '</tr></table>';
  $output = $output_bits;
  ob_end_clean();
Reply With Quote
  #76  
Old 01-27-2011, 05:21 PM
erikcx erikcx is offline
 
Join Date: Dec 2010
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to show recent new member avatar not random member ?
displayed horizontaly or verticaly automaticly ?

or random member avataro showed horizontaly and vertically automatic adjust ?

Installed nominated and rated, thank you very much for the widget code
Reply With Quote
  #77  
Old 01-28-2011, 07:19 AM
MrBig's Avatar
MrBig MrBig is offline
 
Join Date: May 2005
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will this work with forums? if not will you make one that works?
Reply With Quote
  #78  
Old 01-28-2011, 07:28 AM
ProFifaLeagues's Avatar
ProFifaLeagues ProFifaLeagues is offline
 
Join Date: Aug 2009
Location: Uk
Posts: 1,191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MrBig View Post
will this work with forums? if not will you make one that works?

Check out post 73 :up:
Reply With Quote
  #79  
Old 01-29-2011, 09:40 AM
MrBig's Avatar
MrBig MrBig is offline
 
Join Date: May 2005
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rammieone View Post
Check out post 73 :up:
thanks! , im using vbseo on my forum donno if that's what is making the avatars not show up?
Reply With Quote
  #80  
Old 02-11-2011, 06:00 AM
MrBig's Avatar
MrBig MrBig is offline
 
Join Date: May 2005
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how can i move it to other parts of the forum?
Reply With Quote
  #81  
Old 04-22-2011, 03:37 PM
dooch dooch is offline
 
Join Date: Dec 2005
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the first random member has no link to their profile?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:08 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04838 seconds
  • Memory Usage 2,342KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete