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
  #52  
Old 03-31-2010, 01:34 PM
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Location: England
Posts: 447
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works nicely on vb4.0.2 thank you kindly...
Reply With Quote
  #53  
Old 03-31-2010, 07:01 PM
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Location: England
Posts: 447
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One small issue I just noticed... It doesn't exclude members from the banned group. Could this be considered for future updates please?
Reply With Quote
  #54  
Old 03-31-2010, 07:18 PM
Steve_GB Steve_GB is offline
 
Join Date: Oct 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Karlm,

I notice you also have the same problem mentioned earlier in this thread, that your first image of the three doesn't actually link to anything.. the other 2 do.

Re the banned folks, until you get a way to do that one idea for a work around would be to delete their profile pictures and then they won't be displayed.

Steve
Reply With Quote
  #55  
Old 04-01-2010, 12:54 AM
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Location: England
Posts: 447
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, how odd - I've just checked using Chrome, Firefox and even MSIE - and could not replicate the unlinked profile issue you've addressed.

Eitherway, I appreciate your tip for the banned members problem. Thanking you kindly!
Reply With Quote
  #56  
Old 04-01-2010, 04:13 AM
Professional2's Avatar
Professional2 Professional2 is offline
 
Join Date: Nov 2009
Location: 1/2 Of the World
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry i dont have this option:
Go to Admin CP > vBulletin CMS > Widgets > create new widget
Reply With Quote
  #57  
Old 04-01-2010, 08:20 AM
Steve_GB Steve_GB is offline
 
Join Date: Oct 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by karlm View Post
Hmm, how odd - I've just checked using Chrome, Firefox and even MSIE - and could not replicate the unlinked profile issue you've addressed.

Eitherway, I appreciate your tip for the banned members problem. Thanking you kindly!
Karim,

For me using IE8, the first profile image on your site has no link at all. The other two do. Others have reported that problem on their site in this thread. I also saw it on my site when I installed this. I suspect there is a tiny change needed to the code.

IE8 does do things its own way and does not support a lot of css 3 etc. Those using it see commas at the end of most lists in vBulletin, and extra spaces in some widgets, and so on. This all gets mentioned in places on vBulletin.com - they seem to say it is because IE8 doesn't support commands like last-child that they are using. A number of browsers are said not to.

Steve
Reply With Quote
  #58  
Old 04-04-2010, 01:50 PM
desi-boy's Avatar
desi-boy desi-boy is offline
 
Join Date: Nov 2008
Location: France
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice man but i need some thing like ( Attachment) can u creat some thing likhe this 1
Attached Images
File Type: jpg like this.JPG (29.9 KB, 0 views)
Reply With Quote
  #59  
Old 04-05-2010, 01:19 AM
Verionia Verionia is offline
 
Join Date: Jul 2009
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Id like something similar to the post above of top users, newest members, etc. I can place even in forum sidebars or below navbar with or without style.
Reply With Quote
  #60  
Old 04-16-2010, 10:14 AM
baerwurz baerwurz is offline
 
Join Date: Nov 2005
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice.

I can see the link to userprofile and the avatar of the user, but guests only see the link to the userprofile?

Any Tip how to change this?
Reply With Quote
  #61  
Old 04-17-2010, 10:52 AM
Antiblank Antiblank is offline
 
Join Date: May 2005
Location: PDX
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can tell the function is working for my Avatars but I'm also not getting images, I'm assuming this is because I'm storing the avatars via filesystem instead of using the database.

If you came up with an option for this as I see a few other people had the issue I'd appreciate the choice for avatars NOT being stored in the database.
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 10:52 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.09435 seconds
  • Memory Usage 2,327KB
  • 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
  • (2)bbcode_code
  • (1)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
  • (2)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