PDA

View Full Version : vBulletin CMS Widgets - Widget - Show random members with picture


slumbermann
02-09-2010, 10:00 PM
#Function:

Show random members which have profile picture
Clickable picture and username to go to member's profile page


#Installation:

Go to Admin CP > vBulletin CMS > Widgets > create new widget
Widget type > PHP Direct Execution . Title > Random Members . Description > Show random members
click save
then click configure and put the code below


#code to use custom profile picture as the source of picture

$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.'"><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 [U]custom avatar as the main source for the picture

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

Boosted Panda
02-10-2010, 01:49 AM
Can you make this avatar instead?

slumbermann
02-10-2010, 01:56 AM
Can you make this avatar instead?

yes sure... give me some time then i will make an avatar version too...

slumbermann
02-10-2010, 02:01 AM
Can you make this avatar instead?

to show the profile picture using avatar function use this code instead

$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 user.userid AS userid, user.username AS username, customavatar.dateline AS dateline FROM ".TABLE_PREFIX."customavatar
LEFT JOIN ".TABLE_PREFIX."user
ON ".TABLE_PREFIX."customavatar.userid=".TABLE_PREFIX."user.userid
WHERE 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].'" alt="'.$newuser[username].'"/><br />'.$newuser[username].'</a><br />';
}
$output_bits .= '</p>';
$output = $output_bits;
ob_end_clean();

Boosted Panda
02-10-2010, 03:24 AM
That didn't work

slumbermann
02-10-2010, 03:46 AM
That didn't work

do you use custom avatar?

blake247
02-10-2010, 04:04 AM
Is there anyway to make the profile pics smaller?

cykelmyggen
02-10-2010, 04:20 AM
I get a database error on content.php every time I put this widget on!?
Database error in vBulletin 4.0.1:

Invalid SQL:

SELECT user.userid AS userid, user.username AS username,
customprofilepic.dateline AS dateline FROM vbcustomprofilepic
LEFT JOIN vbuser
ON vbcustomprofilepic.userid=vbuser.userid
WHERE customprofilepic.visible = 1
ORDER BY RAND()
LIMIT 3;

MySQL Error : Unknown column 'user.userid' in 'field list'
Error Number : 1054

slumbermann
02-10-2010, 04:34 AM
Is there anyway to make the profile pics smaller?

yes you can add in width and height to the img code example like below:

$output_bits .= '<a href="member.php?u='.$newuser[userid].'"><img src="image.php?u='.$newuser[userid].'&dateline='.$newuser[dateline].'" alt="'.$newuser[username].' width="50px" height="50px""/><br />'.$newuser[username].'</a><br />';


I get a database error on content.php every time I put this widget on!?
Database error in vBulletin 4.0.1:

Invalid SQL:

SELECT user.userid AS userid, user.username AS username,
customprofilepic.dateline AS dateline FROM vbcustomprofilepic
LEFT JOIN vbuser
ON vbcustomprofilepic.userid=vbuser.userid
WHERE customprofilepic.visible = 1
ORDER BY RAND()
LIMIT 3;

MySQL Error : Unknown column 'user.userid' in 'field list'
Error Number : 1054


hurmm that's weird, please try this code instead

$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 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();

kevinfx
02-10-2010, 04:59 AM
i got the links to the profiles, but not profile picture? what's wrong? thanks

slumbermann
02-10-2010, 05:06 AM
i got the links to the profiles, but not profile picture? what's wrong? thanks

could you please give me your website url...

kevinfx
02-10-2010, 05:07 AM
oh i'm using vb 4.0, maybe that's why? i haven't upgraded yet

asj
02-10-2010, 05:13 AM
oh i'm using vb 4.0, maybe that's why? i haven't upgraded yet
Same problem

slumbermann
02-10-2010, 05:16 AM
oh i'm using vb 4.0, maybe that's why? i haven't upgraded yet

Same problem

haven't tried on vb 4.0 because i'm running this on 4.0.1... but will try to look into vb 4.0 too and see how it goes...

slumbermann
02-10-2010, 05:19 AM
That didn't work

please try this code instead for avatar.

$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();

Boosted Panda
02-10-2010, 02:20 PM
please try this code instead for avatar.

$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();

Awesome! Thank you sir!

Talk-Pets
02-10-2010, 03:19 PM
Could it leave out members with no avatars and just shows the ones that has?

slumbermann
02-11-2010, 12:11 AM
Awesome! Thank you sir!
ur welcome
Could it leave out members with no avatars and just shows the ones that has?

yes, only members with profile picture or avatars will be shown.

kevinfx
02-11-2010, 02:29 AM
were you able to figure out what wrong with using this code with vb version 4.0?

thank you

blake247
02-11-2010, 03:08 AM
Thanks for the tip! Great widget!

slumbermann
02-11-2010, 04:37 AM
were you able to figure out what wrong with using this code with vb version 4.0?

thank you

Hi,

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.

slumbermann
02-11-2010, 04:38 AM
Thanks for the tip! Great widget!

Ur welcome... :)

kevinfx
02-11-2010, 05:13 AM
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?

slumbermann
02-11-2010, 05:24 AM
that's weird because the usernames listed do have profile pictures .... Do i need to change anything in the code?

You don't need to change anything in the code, you just need to choose either to use the profile picture or avatar, currently i separated the code, so each will only work with one source, i will try to integrate both into the code.

when you create the widget, it show empty box or what? could you please explain your problem, i will try my best to help

kevinfx
02-11-2010, 05:39 AM
when i create the widget, it shows some code in there. I replaced it everything with your code.

Thank you

slumbermann
02-11-2010, 05:44 AM
when i create the widget, it shows some code in there. I replaced it everything with your code.

Thank you

and when you add it to your layout manager? what are shown on the front page?

kevinfx
02-11-2010, 05:49 AM
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

slumbermann
02-11-2010, 06:07 AM
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

ok, so that was the reason, could you please PM me your website url?

Martyh
02-11-2010, 07:30 AM
Can it be set to pull from a specific user group ?

slumbermann
02-11-2010, 08:47 AM
Can it be set to pull from a specific user group ?

yes you can, but there additional code to be added, how many group do you need? just one or some groups?

Martyh
02-13-2010, 01:33 AM
Hi, sorry for the late response, just one group.

mobilewo
02-14-2010, 04:05 AM
hello sir can you please help me how to add this widget in profile page

(I hope this is good idea for connecting friends)

:):):)

Pro-eSports.com
02-14-2010, 04:38 AM
Where on the forum will it show up? Screenshot or demo link maybe? :)

australiaforum
02-14-2010, 12:18 PM
I am having the same problem where just the link is showing up. I am on 4.01.

http://balipod.com

nomoreturn
02-14-2010, 12:36 PM
I am having the same problem where just the link is showing up. I am on 4.01.

http://balipod.com

I also have same problem and i'm useing vb 4.0.1
http://www.mastdunya.com

eternal_
02-15-2010, 09:23 PM
can this be used for the forums sidebar instead of the cms?

Pangramma
02-19-2010, 09:48 PM
Is it possible to only show the ACTIVE members?

Nice widget ;)

iadventure
02-21-2010, 09:08 PM
I installed it, but it only shows link to names, no photo. CAn you help?

http://jk-adventure.com/JKA/content.php

Scroll down on left side

alfanexus
02-28-2010, 07:37 AM
I got the same problem with the photo not being shown. Using vb 4.0.2

Doctor Death
03-08-2010, 01:34 PM
This works great on my 4.0.2 install. Is there an easy way to ensure that images are resized appropriately? A few user images are larger than the frame.

Thanks and great work.

archet1337
03-08-2010, 01:51 PM
Is it possible to make this work with Forum Blocks as well?

GONUMBER6
03-10-2010, 03:24 AM
Great widget, really excellent for my forum!

ahmedipa
03-10-2010, 03:55 AM
so nice thank you so much

FASEOFMARS
03-17-2010, 03:56 AM
i would also like to know how to pull random members from a group..

well three groups.. admin, supermods and v.i.p's..

thanks and loving this widget,,

sensimilla
03-17-2010, 02:31 PM
How come the first one is not clickable ? :) TIA

9mmPreacher
03-17-2010, 04:34 PM
Maybe I'm retarded but I went into my Admin CP and cannot find vBulletin CMS, where the heck is it?

FASEOFMARS
03-18-2010, 12:32 AM
its the third section on the left..

first is settings..

second is vbulletin blog..

thrid is vbulletin CMS..

can we please get the code to pull members from certain groups?

thanks..

9mmPreacher
03-18-2010, 02:10 PM
heres what my options look like, still can't find vbulletin CMS

http://i141.photobucket.com/albums/r49/9mmPreacher/PreviewofvBulletinOptions-HardcoreC.jpg

FASEOFMARS
03-18-2010, 03:03 PM
do you even have a publishing suite?

by the looks of it your running a forum classic..

http://forums.christian-gaming.com/ is this your forum?

yea you dont have a publishing suite.. i.e. cms and blogs..

alashram
03-19-2010, 06:22 PM
How can you make them appear horizontally?

karlm
03-31-2010, 01:34 PM
This works nicely on vb4.0.2 thank you kindly...

karlm
03-31-2010, 07:01 PM
One small issue I just noticed... It doesn't exclude members from the banned group. Could this be considered for future updates please?

Steve_GB
03-31-2010, 07:18 PM
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

karlm
04-01-2010, 12:54 AM
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!

Professional2
04-01-2010, 04:13 AM
sorry i dont have this option:
Go to Admin CP > vBulletin CMS > Widgets > create new widget

Steve_GB
04-01-2010, 08:20 AM
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

desi-boy
04-04-2010, 01:50 PM
nice man but i need some thing like ( Attachment) can u creat some thing likhe this 1

Verionia
04-05-2010, 01:19 AM
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.

baerwurz
04-16-2010, 10:14 AM
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?

Antiblank
04-17-2010, 10:52 AM
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.

alfanexus
04-17-2010, 11:44 AM
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.

I have tried it on a system with avatars in database and this worked. I have also tried on a system with avatars stored on filesystem ad this did not work, so I think you are right.

So I would also appreciate a choice for avatars NOT being stored in the database :)

It would also be great to limit the ramdom users to the last 500 og 1000 users logged in :) Or someother option that dident show Inactive users.

Anyway this is still a great widget for the once who can use it :) Thanks :)

Antiblank
04-17-2010, 10:04 PM
I modified it a little to work with custom avatars stored in the file system. Might not be the best way but it works, hopefully this helps out.


$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."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 = '<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();

Antiblank
04-17-2010, 10:20 PM
Regardless which setup you are using, if you want to limit it just to a single usergroup find line:

After

$member_count = 3;

Add

$usergroup_limit = 6;


Find

WHERE ".TABLE_PREFIX."customavatar.visible = 1


Replace with

WHERE ".TABLE_PREFIX."customavatar.visible = 1 AND ".TABLE_PREFIX."user.usergroupid = $usergroup_limit


Now just change the usergroup_limit number to match the usergroup you want to display. 6 for example is Administrators.

TripleChin
05-07-2010, 02:03 AM
This is a nice add-on. I am completely new to Vb and php. If someone could advise me of how to limit this to logged in members, that would be great. Again, nice add-on.

BadgerDog
05-12-2010, 01:37 PM
Installed and works great in CMS with v4.03 .. thanks .. :up:

Any chance of getting similar piece of code to create a "block" for the side block function in v4?

Regards,
Badger:up:

goxy63
05-12-2010, 10:36 PM
Installed nominated and rated, thank you very much for this widget code

Is there a way to show this horizontaly not verticaly?
That is can we display avatars/profile pic left to right instead up and down?

Taurus MFF
05-16-2010, 12:29 PM
Installed nominated and rated, thank you very much for this widget code

Is there a way to show this horizontaly not verticaly?
That is can we display avatars/profile pic left to right instead up and down?

I second the request to display images horizontally!

nice mod, installed & working great on CMS v4.0.3

JayCat
06-05-2010, 08:49 AM
Is it possible to make this work with Forum Blocks as well?

I'd really like that too :)

vivamexico55
07-25-2010, 12:00 AM
In 4.04 for some reason only the 2nd or 3rd avatar can be clicked, not the first. I can't find why...

mse2k
08-17-2010, 07:48 PM
Hallo ... i use VB 4.0.6 ... the widget shows the name of the user but not a picture ... what`s wrong? THX

tattooz
09-14-2010, 12:44 AM
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....?

dang3rzon3
09-16-2010, 09:43 PM
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 :mad:

tattooz
09-17-2010, 06:19 PM
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.


$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();

tattooz
01-08-2011, 07:21 PM
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;"


$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();

erikcx
01-27-2011, 05:21 PM
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

MrBig
01-28-2011, 07:19 AM
will this work with forums? if not will you make one that works?

ProFifaLeagues
01-28-2011, 07:28 AM
will this work with forums? if not will you make one that works?


Check out post 73 :up:

MrBig
01-29-2011, 09:40 AM
Check out post 73 :up:

thanks! , im using vbseo on my forum donno if that's what is making the avatars not show up?

MrBig
02-11-2011, 06:00 AM
how can i move it to other parts of the forum?

dooch
04-22-2011, 03:37 PM
the first random member has no link to their profile?

rob01
04-29-2011, 04:43 AM
is possible to show 3 random users per month?

i mean the same 3 users during a whole month

jgt58
05-01-2011, 08:17 PM
This works on vb 4.1.1 and by the way works as a sideblock when used as php

Wordplay
05-07-2011, 10:59 AM
@rob just set the cache time to a month (do the math to figure out how many minutes are in 30 days), then clear the cache on the 1st of next month.

i have the same problem as dooch the first user has no link.

Savage Circuits
05-17-2011, 09:07 PM
I know this thread is old and all, but for those that were having problems with the first item not being linked I have solved the problem with the help of my Super Moderator on my website. He noticed that the following line was malformed. I am showing the original and the corrected versions in the hope it helps some of you. Take care!

$output_bits = '<p align="center"';


And the corrected version:

$output_bits = '<p align="center">';

rob01
05-19-2011, 07:40 PM
avatars dosnt seem to show up, and neither the catch up, also i apply the fix savage mentions.. but still im having the same problem (the first dosnt show up)

Savage Circuits
05-23-2011, 05:11 PM
rob01, your avatars are stored in the DB, yes?

DNN
05-26-2011, 11:59 PM
good stuff, SON!

dune3000
05-27-2011, 01:34 PM
I can't get this work. I my widget window I have only this:
05-27-2011


Any help please?

voter
06-08-2011, 07:02 PM
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.


$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();

You forgot to include the line
$usergroup_limit=something

Anopheles
06-19-2011, 07:38 AM
I know this thread is old and all, but for those that were having problems with the first item not being linked I have solved the problem with the help of my Super Moderator on my website. He noticed that the following line was malformed. I am showing the original and the corrected versions in the hope it helps some of you. Take care!

$output_bits = '<p align="center"';


And the corrected version:

$output_bits = '<p align="center">';


It doesn't work!
The first item not being linked!

Steve_GB
06-19-2011, 09:46 AM
It doesn't work!
The first item not being linked!

It worked for me and I'm very pleased to at last have the random profile image linked and fully working.

Steve

MySaltyreef
07-10-2011, 12:46 AM
works 100%

kamalia
07-19-2011, 08:02 AM
there's no option to create widget..i'm using vbulletin 4.1.3 classic (standard)..any idea?

Davey-UK
07-23-2011, 06:35 AM
Excellent. Working 100% now in VB4.1.4

I would prefer the Latest members, rather than random members though. Could someone modify it slightly? Please.

Marked installed. :D

cykelmyggen
07-28-2011, 06:12 AM
I know this thread is old and all, but for those that were having problems with the first item not being linked I have solved the problem with the help of my Super Moderator on my website. He noticed that the following line was malformed. I am showing the original and the corrected versions in the hope it helps some of you. Take care!

$output_bits = '<p align="center"';


And the corrected version:

$output_bits = '<p align="center">';


Solved problem with first item not being linked, Thanks :). However images aren't showing up?

Konsolenheld
08-25-2011, 06:24 PM
Thanks!!

Savage Circuits
09-23-2011, 09:42 PM
Yeah, I'm afraid I discontinued use of this widget until the author makes some updates. I had several reports of banned members (spammers on my site) being shown. That's not good. =(

just77me
08-17-2012, 12:29 PM
Hello, does anyone has a code that works horizont -> 6 Pictures in a line? There is a guy describing that on a page bevore, but that doesn't show any pictures...

please anyone fixing the code from the first side to view pictures in a line.

Thank you very much.

Greetings

just77me
08-21-2012, 09:47 AM
Hello there - can anyone help me to get the horizont version working?

just77me
09-09-2012, 07:03 PM
no one there who can help me?

AFemaleProdigy
09-20-2012, 11:35 PM
In the line for $output_bits just wrap the link and image in a div with a class name. You can make horizontal layout work with CSS.

Also, it shouldn't show banned users if you use the edited version that specifies a certain usergroup.

I too would like to know how to specify x most recent new users. Anyone have any ideas on how to edit this for that purpose?

John Lester
10-16-2012, 09:22 PM
These changes will show the avatars (or profile pics depending on which one you chose to show) only if the member is in the user group(s) you specify. The current code only allows for one user group, this allows for more :)

Delete

$usergroup_limit = 2;
Replace

$usergroup_limit
With (you can add other user group ids if you want just follow the format in the ( )'s )

IN (2, 6, 7)

ringnews24
12-16-2012, 04:09 PM
Is it possible to add stats below the picture

Like

Username
Joined Date
Total Posts

And set it to say only show users with posts over 1000 ?