vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Is there a user chooser mod/plugin? (https://vborg.vbsupport.ru/showthread.php?t=214981)

Wild Bronco 05-31-2009 10:59 AM

Is there a user chooser mod/plugin?
 
I don't know if this is the right place to ask, but it did not fit anywhare else...

I am having a game on my site and need to pull out 3 random usernames who have registered in Mai.

Is there a mod/plugin for this ??

Lynne 05-31-2009 05:38 PM

I have not seen a mod for this.

Wild Bronco 06-01-2009 10:50 PM

It would be nice to have this in/for vBulletin

But I solved it by using http://random.org/

By using User ID's I could make a random draw :)

SamirDarji 03-23-2011 05:03 AM

I'm looking for almost exactly the same thing. Except I want to choose from the active users in a given month. I don't need anything fancy, just the sql query. But I don't know how to construct those. :(

Any assistance appreciated.

Lynne 03-23-2011 04:10 PM

Getting active users in a given month is going to be more difficult than getting registered users. Registration dates are kept; dates a user logged in are not. You will need to set up a database/field/something to actually log all times a user is logged in if you wish to find when they were active.

SamirDarji 03-23-2011 04:49 PM

Isn't there a last login date? And if the query (or manually if I have to) can determine the number of days in the current month, then it could check the number of days between the last login date and the current date and if it doesn't exceed the number of days in the month, it's a valid user.

Then take all these valid users and pull a random one. Is there not a way?

Lynne 03-23-2011 05:11 PM

But if you are looking for anybody who was active in the month of February, someone could come log in right now, and not have been online since last year, and that means their last login date would be March, but they were definitely not an active user in February.

SamirDarji 03-23-2011 05:40 PM

True, but that's why I was going to run the query at the end of each month on the last day. Either via a cron or manually.

Lynne 03-23-2011 05:44 PM

Then that would work. You hadn't said that before which is why I couldn't see how that would work. :)

SamirDarji 03-23-2011 06:02 PM

Sorry. :( I didn't know if there was a way to make it work outside of the current month or not.

Now I just need the db query. :)

Lynne 03-23-2011 09:05 PM

Something like:
SELECT count(*) as count FROM user WHERE lastvisit > xxxxxxxx

I'm a trial and error query writer, so I'm sure you'll have to play with that.

SamirDarji 03-24-2011 01:09 AM

Thank you! It's a start. It's a little like the blind leading the blind, but so appreciated!

MoMan 03-24-2011 05:52 AM

There's a mod called usermodlog which logs every login. Based on that data, you could easily find users based on more specific activity.

SamirDarji 03-24-2011 06:39 AM

I searched and found it. It's a lot more than what I need. :(

DragonByte Tech was kind enough to quickly hammer out a script that does the job:
https://vborg.vbsupport.ru/showpost....2&postcount=81


All times are GMT. The time now is 08:35 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.01054 seconds
  • Memory Usage 1,736KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete