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
  #32  
Old 09-21-2005, 06:35 PM
hbalagh1's Avatar
hbalagh1 hbalagh1 is offline
 
Join Date: Jun 2005
Location: San Diego
Posts: 230
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great little mod, ive been having alot of new users these days... great to see the new members names
Reply With Quote
  #33  
Old 10-23-2005, 12:54 AM
swa swa is offline
 
Join Date: Apr 2005
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice! working on my site!
Reply With Quote
  #34  
Old 11-01-2005, 08:59 PM
dknelson dknelson is offline
 
Join Date: Oct 2004
Posts: 412
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any chance of this being ported to 3.5? Really enjoyed it.
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:26 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.04306 seconds
  • Memory Usage 2,283KB
  • Queries Executed 20 (?)
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
  • (8)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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