Back to vBulletin 3.0 Add-Ons

Members who have registered today
Mod Version: 1.00, by ericgtr

This modification is in the archives.
vB Version: 3.0.3 Rating: (1 vote - 3.00 average) Installs: 26
Released: 16 Dec 2004 Last Update: Never Downloads: 2
Not Supported  

I was going to add this to my existing vbindex stats mod but it's a little too different so I will post it up as a new one, this has been requested a few times in the short time I have been here.

Update, corrected: Originally had forumindex.php when it should be index.php

What it does:
Adds a Registered Today (how many users in the last 24 hours) to the statistics on the forum index.

Modifications:
1 Template
1 File
1 Phrase

Add a phrase:
Global
Varname: reged_today
Text: Registered Today

In index.php find:

PHP Code:
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ### 
Above it add:

PHP Code:
// ### Registered Today ##
$newusers $DB_site->query_first('
SELECT COUNT(*) AS count 
FROM ' 
TABLE_PREFIX 'user
WHERE joindate >= "' 
strtotime("-1day") . '"
'
);
$newmembers number_format($newusers['count']);
// ### Registered Today ## 
In your FORUMHOME template find:

Code:
			<div>$vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div>
Change it to (or maker the proper addition as shown):

Code:
			<div>$vbphrase[reged_today]: $newusers[count], $vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div>
Update: Paul M has worked this out to start at midnight, instead of just the last 24 hrs here

Spoiler (click to open)


Quote by ericgtr
I tried changing the query to this which is partially borrowed from PaulM's code and should show who has registered since midnight:

and I get the exact same results as I do with my code.
Hmm, I doubt you do, not with what you have posted anyway.

This should work ;

PHP Code:
// Who Regeistered Today - using Paul Marsden's code
$now TIMENOW ;
require_once(
'./includes/functions_misc.php');
$cutoff vbmktime(000vbdate('m'$nowfalsefalse), vbdate('d'$nowfalsefalse), vbdate('Y'$nowfalsefalse));
// $cutoff = $now - 86400 ;  // Uncomment this line if you want a rolling last 24 hours.
$newusers $DB_site->query_first('
SELECT COUNT(*) AS count 
FROM ' 
TABLE_PREFIX 'user
WHERE joindate >= ' 
.$cutoff'
'
);
$newmembers number_format($newusers['count']);
// Who Regeistered Today - using Paul Marsden's code 
Edit: Updated with bug fixes from subsequent posts.

Close


That's it, I am supporting this please click install if you find it useful

Download

No files for download.

Supporters / CoAuthors

  • Paul M

Screenshots

 

Similar Mods

Forum Home Enhancements Members who have registered today. Modification Graveyard
Forum Home Enhancements Members Who Registered Today Modification Graveyard
Total members registered TODAY 1.0 (Forumhome) vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024