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
Members who have registered today Details »»
Members who have registered today
Version: 1.00, by ericgtr ericgtr is offline
Developer Last Online: Feb 2022 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 12-15-2004 Last Update: Never Installs: 26
 
No support by the author.

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 https://vborg.vbsupport.ru/showpost....5&postcount=18


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

Supporters / CoAuthors

Show Your Support

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

Comments
  #22  
Old 01-29-2005, 01:40 PM
MajorFm.com MajorFm.com is offline
 
Join Date: Dec 2004
Location: UK
Posts: 402
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats what we are tryin to do now, the original hack does the last 24 hours, we are tryin to make it so it counts from midnight.
Reply With Quote
  #23  
Old 01-29-2005, 01:50 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Paul's code in post 18 will do that.
Reply With Quote
  #24  
Old 01-29-2005, 01:51 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, you are right Boofoo it works. Thanks Paul! and sorry for posting the wrong query up there guys I have to learn to label my code better in my index.php.
Reply With Quote
  #25  
Old 01-29-2005, 02:03 PM
MajorFm.com MajorFm.com is offline
 
Join Date: Dec 2004
Location: UK
Posts: 402
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok it works for you guys, im gettin a blank spot for some reason... i assume this will work when my forum passes midnight maybe..
Reply With Quote
  #26  
Old 01-29-2005, 02:11 PM
ericgtr's Avatar
ericgtr ericgtr is offline
 
Join Date: Apr 2003
Location: Portland, Oregon
Posts: 1,407
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should still get a value of zero, I just registered and it still doesn't show. Try pasting it Paul's code above exactly if you haven't already I just tested on my site and it works.
Reply With Quote
  #27  
Old 01-29-2005, 02:31 PM
MajorFm.com MajorFm.com is offline
 
Join Date: Dec 2004
Location: UK
Posts: 402
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i pasted that exactly replacing your original code... strange...

The segment in my index.php looks like this

Code:
	{
		$getstats_thread[isdeleted] = true;
	}
	eval('$stats_threads .= "' . fetch_template('forumhome_stats_thread') . '";');
}
// Who Regeistered Today - using Paul Marsden's code 
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false)); 
// $cutoff = $now - 86400 ;  // Uncomment this line if you want a rolling last 24 hours. 
$whousers = $DB_site->query_first(' 
SELECT COUNT(*) AS count 
FROM ' . TABLE_PREFIX . 'user 
WHERE joindate >= " .$cutoff. " 
'); 
$newmembers = number_format($whousers['count']); 
// Who Regeistered Today - using Paul Marsden's code 
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
eval('$vbpopup = "' . fetch_template('forumhome_vbpopup') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('FORUMHOME') . '");');
Reply With Quote
  #28  
Old 01-29-2005, 08:05 PM
MajorFm.com MajorFm.com is offline
 
Join Date: Dec 2004
Location: UK
Posts: 402
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any idea? i still get a blank spot..
Reply With Quote
  #29  
Old 01-29-2005, 08:29 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MajorFm.com
Any idea? i still get a blank spot..
Yeah, actually, it might be a small error in what I posted above - I notice a couple of of the quotation marks are doubles, when they ought to be singles (it was done in a hurry );

The two to change are hilighted below (on the WHERE line) ;


Code:
	{
		$getstats_thread[isdeleted] = true;
	}
	eval('$stats_threads .= "' . fetch_template('forumhome_stats_thread') . '";');
}
// Who Regeistered Today - using Paul Marsden's code 
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false)); 
// $cutoff = $now - 86400 ;  // Uncomment this line if you want a rolling last 24 hours. 
$whousers = $DB_site->query_first(' 
SELECT COUNT(*) AS count 
FROM ' . TABLE_PREFIX . 'user 
WHERE joindate >= " .$cutoff. " 
'); 
$newmembers = number_format($whousers['count']); 
// Who Regeistered Today - using Paul Marsden's code 
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
eval('$vbpopup = "' . fetch_template('forumhome_vbpopup') . '";');
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('FORUMHOME') . '");');
Change them both to single quote marks ;

Code:
WHERE joindate >= ' .$cutoff. '
Reply With Quote
  #30  
Old 01-29-2005, 08:35 PM
MajorFm.com MajorFm.com is offline
 
Join Date: Dec 2004
Location: UK
Posts: 402
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did this, still a blank... :-(
Reply With Quote
  #31  
Old 01-29-2005, 08:58 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, I'm not sure how I've ended up supporting someone elses hack - but yes, I can see the problem.

In the code I posted, change

PHP Code:
$whousers $DB_site->query_first(
to

PHP Code:
$newusers $DB_site->query_first(
and it should work.

The reason is that the line changed in the FORUMHOME template is using the array value, not the subsequently created $newmembers variable;

Code:
<div>$vbphrase[reged_today]: $newusers[count], $vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div>
This would appear to be an oversight by the hack author.
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 04:13 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04812 seconds
  • Memory Usage 2,320KB
  • Queries Executed 26 (?)
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
  • (6)bbcode_code
  • (4)bbcode_php
  • (1)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
  • (4)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