The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Widget - Show random members with picture Details »» | |||||||||||||||||||||||||||||
Widget - Show random members with picture
Developer Last Online: Jun 2010
#Function:
#Installation:
#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:
$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(); Screenshots
Supporters / CoAuthors Show Your Support
|
Comments |
#22
|
|||
|
|||
Quote:
I just tested the code with vb 4.0 and it works with no problem. Please make sure your user have profile picture or avatars uploaded, else there will be no picture shown. |
#23
|
|||
|
|||
|
#24
|
|||
|
|||
that's weird because the usernames listed do have profile pictures .... Do i need to change anything in the code?
my vb is 4.0 patch level 1. also i store profile pics and avatars on the server (file system) not in the database.... would that make a different? |
#25
|
|||
|
|||
Quote:
when you create the widget, it show empty box or what? could you please explain your problem, i will try my best to help |
#26
|
|||
|
|||
when i create the widget, it shows some code in there. I replaced it everything with your code.
Thank you |
#27
|
|||
|
|||
and when you add it to your layout manager? what are shown on the front page?
|
#28
|
|||
|
|||
just 3 links (user names) to profiles without the profile pictures... looks like the widget was able to pull all users that have profile pix, but unable to display profile pix on the CMS
because i store profile pix on the server instead db, the profile pix URL is, for example : /forum/customprofilepics/profilepic1_1.gif ..... not image.php?u=xxx |
#29
|
|||
|
|||
Quote:
|
#30
|
|||
|
|||
Can it be set to pull from a specific user group ?
|
#31
|
|||
|
|||
yes you can, but there additional code to be added, how many group do you need? just one or some groups?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|