vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - Widget - Show random members with picture (https://vborg.vbsupport.ru/showthread.php?t=235460)

alfanexus 04-17-2010 11:44 AM

Quote:

Originally Posted by Antiblank (Post 2022624)
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.

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."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
Code:

$member_count = 3;
Add
Code:

$usergroup_limit = 6;
Find
Code:

    WHERE ".TABLE_PREFIX."customavatar.visible = 1
Replace with
Code:

    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

Quote:

Originally Posted by goxy63 (Post 2036019)
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

Quote:

Originally Posted by archet1337 (Post 1999834)
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


All times are GMT. The time now is 02:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01205 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete