Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
List of new members during last 24h Details »»
List of new members during last 24h
Version: 1.02, by Olsufr Olsufr is offline
Developer Last Online: Mar 2005 Show Printable Version Email this Page

Version: 3.0.6 Rating:
Released: 02-12-2005 Last Update: 03-21-2005 Installs: 14
 
No support by the author.

Simple hack to display new registered members during last 24 hours.

A very simple display of all members who have registered in the forum during last 24 hours.

It displays statistics and the list of new registered members (last 24h) on Forum Home
under the "Users online" display.

The list is now in chronological order (newest first, oldest last).

example:
" Welcome to our newest members: (18) name18, name17, name16, name15, name14, name13, name12, name11, name10, name9, name8, name7, name6, name5, name4, name3, name2, name1 "

There is no additional SQL query.

----------------------------------

Installation (there is in attached file)

Step 1

In includes/functions_databuild.php

Find:

PHP Code:
// ###################### Start saveuserstats #######################
// Save user count & newest user into template
function build_user_statistics()
{
    global 
$vboptions$DB_site;

    
// get total members
    
$members $DB_site->query_first("SELECT COUNT(*) AS users, MAX(userid) AS max FROM " TABLE_PREFIX "user");

    
// get newest member
    
$newuser $DB_site->query_first("SELECT userid, username FROM " TABLE_PREFIX "user WHERE userid = $members[max]");

    
// make a little array with the data
    
$values = array(
        
'numbermembers' => $members['users'],
        
'newusername' => $newuser['username'],
        
'newuserid' => $newuser['userid']
    );

    
// update the special template
    
build_datastore('userstats'serialize($values));


And replace by this code:

PHP Code:
// ###################### Start saveuserstats #######################
// Save user count & newest user into template
// Function is modified by Oleg Subel for STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h
function build_user_statistics()
{
    global 
$vboptions$DB_site;

    
// get total members
    
$members $DB_site->query_first("SELECT COUNT(*) AS users, MAX(userid) AS max FROM " TABLE_PREFIX "user");

    
// get last newest members 24h
    
$cattime24 TIMENOW 24 60 60;
    
$newusers $DB_site->query("SELECT joindate, userid, username FROM " TABLE_PREFIX "user WHERE joindate > $cattime24");
//    $newuser = $DB_site->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid = $members[max]");

    
$newusers24 = array();
    while (
$newuser $DB_site->fetch_array($newusers))
    {
        
$newusers24["{$newuser['joindate']}"] = array('id' => $newuser['userid'], 'name' => $newuser['username']);
    }
    
// reverse sort keys
    
krsort($newusers24);

    if (empty(
$newusers24[0]))
    {
        
$lastnewuser $DB_site->query_first("SELECT userid, username FROM " TABLE_PREFIX "user WHERE userid = $members[max]");
    }

    
// make a little array with the data
    
$values = array(
        
'numbermembers' => $members['users'],
        
'newusername' => ( (empty($newusers24[0])) ? $lastnewuser['username'] : $newusers24[0]['name'] ),
        
'newuserid' => ( (empty($newusers24[0])) ? $lastnewuser['userid'] : $newusers24[0]['id'] ),
        
'lastregusers24h' => $newusers24
    
);

    
// update the special template
    
build_datastore('userstats'serialize($values));


Step 2

In index.php

Find:

PHP Code:
// get total members and newest member from template
$userstats unserialize($datastore['userstats']);
$numbermembers vb_number_format($userstats['numbermembers']);
$newusername $userstats['newusername'];
$newuserid $userstats['newuserid']; 
And insert this code below:

PHP Code:
// ### STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ####################

$lastregusers24 $userstats['lastregusers24h'];
$numbernewregusers24 0;
$newusers24 '';
$cattime24 TIMENOW 24 60 60;
if (
is_array($lastregusers24) && count($lastregusers24) > 0)
{
    foreach(
$lastregusers24 AS $regjoindate => $regnewuser)
    {
        if (
$regjoindate $cattime24)
        {
            
$numbernewregusers24++;
            eval(
'$newusers24 .= ", ' fetch_template('forumhome_regnewuser') . '";');
        }
    }
}
$newusers24 substr($newusers24 2); // get rid of initial comma

// ### End of STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ############# 
Step 3

Add new phrase

Phrase Type: GLOBAL
Varname: welcome_to_our_newest_members
Text:
Code:
Welcome to our newest members

Step 4

Add new template (Title: forumhome_regnewuser):

Code:
<a href="member.php?$session[sessionurl]u=$regnewuser[id]">$regnewuser[name]</a>
Step 5

FORUMHOME template modification

Find:

Code:
			<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
and replace with:

Code:
			<if condition="$numbernewregusers24"><div>$vbphrase[welcome_to_our_newest_members]: ($numbernewregusers24) $newusers24</div></if>

END

Now, if you want to have statistics more than for 24 hours (for example - 3 days)
you need:

1) to change line of this hack for includes/functions_databuild.php (see step 1 of installation):
PHP Code:
$cattime24 TIMENOW 24 60 60
to
PHP Code:
$cattime24 TIMENOW 324 60 60
and

2) to change line of this hack for index.php (see step 2 of installation):
PHP Code:
$cattime24 TIMENOW 24 60 60
to
PHP Code:
$cattime24 TIMENOW 324 60 60

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 02-15-2005, 07:46 AM
JC's Avatar
JC JC is offline
 
Join Date: Sep 2002
Location: California, USA
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, worked out great!
Reply With Quote
  #13  
Old 02-15-2005, 06:25 PM
Olsufr Olsufr is offline
 
Join Date: Feb 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a little modification of hack's code.

v.1.01
Install instructions and downloaded file at first post in this topic is renewed.

Modification is in index.php:

this code:
PHP Code:
// ### STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ####################

$lastregusers24 $userstats['lastregusers24h'];
$numbernewregusers24 0;
$newusers24 '';
if (
is_array($lastregusers24) && count($lastregusers24) > 0)
{
    foreach(
$lastregusers24 AS $regjoindate => $regnewuser)
    {
        
$numbernewregusers24++;
        eval(
'$newusers24 .= ", ' fetch_template('forumhome_regnewuser') . '";');
    }
}
$newusers24 substr($newusers24 2); // get rid of initial comma

// ### End of STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ############# 
change to:
PHP Code:
// ### STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ####################

$lastregusers24 $userstats['lastregusers24h'];
$numbernewregusers24 0;
$newusers24 '';
$cattime24 TIMENOW 24 60 60;
if (
is_array($lastregusers24) && count($lastregusers24) > 0)
{
    foreach(
$lastregusers24 AS $regjoindate => $regnewuser)
    {
        if (
$regjoindate $cattime24)
        {
            
$numbernewregusers24++;
            eval(
'$newusers24 .= ", ' fetch_template('forumhome_regnewuser') . '";');
        }
    }
}
$newusers24 substr($newusers24 2); // get rid of initial comma

// ### End of STATISTICS AND LIST OF NEW REGISTERED MEMBERS 24h by Oleg Subel ############# 
Now, if you want to have statistics more than for 24 hours (for example - 3 days)
you need:

1) to change line of this hack for includes/functions_databuild.php (see step 1 of installation):
PHP Code:
$cattime24 TIMENOW 24 60 60
to
PHP Code:
$cattime24 TIMENOW 324 60 60
and

2) to change line of this hack for index.php (see step 2 of installation):
PHP Code:
$cattime24 TIMENOW 24 60 60
to
PHP Code:
$cattime24 TIMENOW 324 60 60
Reply With Quote
  #14  
Old 02-15-2005, 08:52 PM
Rick Sample Rick Sample is offline
 
Join Date: Apr 2004
Location: Ohio
Posts: 407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

awesome hack, but is their anyway the counter can reset at midnight instead of the last 24h after you install it?

THANKS
Reply With Quote
  #15  
Old 02-17-2005, 05:07 AM
WreckRman2 WreckRman2 is offline
 
Join Date: Dec 2001
Location: Indianapolis, IN
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question you set up a condition "<if condition="$numbernewregusers24">" but how to you set that condition as on?
Reply With Quote
  #16  
Old 02-17-2005, 07:41 AM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IndyWebDesign
Question you set up a condition "<ifcondition="$numbernewregusers24">" but how to you set that conditionas on?
what exactly do you want to know?
Reply With Quote
  #17  
Old 02-23-2005, 07:31 PM
xtreme-mobile xtreme-mobile is offline
 
Join Date: Jul 2004
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ive just installed this but it doesnt show the 8 members that i have had register? or will it start from when the next member signs up?
Reply With Quote
  #18  
Old 02-23-2005, 10:48 PM
Olsufr Olsufr is offline
 
Join Date: Feb 2003
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xtreme-mobile
ive just installed this but it doesnt show the 8 members that i have had register? or will it start from when the next member signs up?
xtreme-mobile, this statistics is updated when new member registers.
Reply With Quote
  #19  
Old 02-24-2005, 02:52 PM
xtreme-mobile xtreme-mobile is offline
 
Join Date: Jul 2004
Posts: 366
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep all working now

great hack
Reply With Quote
  #20  
Old 03-07-2005, 11:42 AM
Q-v-n-s-Q Q-v-n-s-Q is offline
 
Join Date: Mar 2005
Posts: 289
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hacks
Reply With Quote
  #21  
Old 03-07-2005, 04:55 PM
TLCanna TLCanna is offline
 
Join Date: Feb 2003
Location: around here somewhere
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added this hack and it's working fine, but now my latest new member isn't there (at the top). It says 'Welcome to our newest member, " but no name. How can I get that added back AND have this hack show at the bottom?

http://www.javajane.com/images/GAGscreen.gif

If the link doesn't work the first time clicking it, refresh and it should show up. It's just an image of the area I'm talking about.

Thanks
Reply With Quote
Reply


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 08:49 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.04714 seconds
  • Memory Usage 2,376KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (14)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete