The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Members who have registered today Details »» | |||||||||||||||||||||||||
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:
PHP Code:
Code:
<div>$vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div> Code:
<div>$vbphrase[reged_today]: $newusers[count], $vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div> That's it, I am supporting this please click install if you find it useful Supporters / CoAuthors Show Your Support
|
Comments |
#22
|
|||
|
|||
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.
|
#23
|
||||
|
||||
Paul's code in post 18 will do that.
|
#24
|
||||
|
||||
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.
|
#25
|
|||
|
|||
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..
|
#26
|
||||
|
||||
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.
|
#27
|
|||
|
|||
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') . '");'); |
#28
|
|||
|
|||
Any idea? i still get a blank spot..
|
#29
|
||||
|
||||
Quote:
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') . '");'); Code:
WHERE joindate >= ' .$cutoff. ' |
#30
|
|||
|
|||
I did this, still a blank... :-(
|
#31
|
||||
|
||||
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:
PHP Code:
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> |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|