MyBB Community Forums

Full Version: A few issues.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I have a few things I'd like to bring forward for some answers.


Displaying totals today.
Example
[Image: sCvGhed.png]
I want to be able to display the total posts and members joined today on the forums and not just in the ACP. How would I do this?

Removing banned members from Online Today
Example
[Image: i0S4AdT.png]
I have the online today plugin in effect, I want to be able to remove banned members from Online today. I've managed to get them out of the Online recently but not sure about today.

Any assistance would be great.
Best thing to do is make a plugin for this, and make it display in the board stats. That's my guess.

And use SQL querie's to grab the stuff

// Get the number of new posts for today
	$query = $db->simple_select("posts", "COUNT(*) AS newposts", "dateline > '$timecut' AND visible='1'");
	$newposts = my_number_format($db->fetch_field($query, "newposts"));

// Get the number of new threads for today
	$query = $db->simple_select("threads", "COUNT(*) AS newthreads", "dateline > '$timecut' AND visible='1' AND closed NOT LIKE 'moved|%'");
	$newthreads = my_number_format($db->fetch_field($query, "newthreads"));

	// Get the number of new users for today
	$timecut = TIME_NOW - 86400;
	$query = $db->simple_select("users", "COUNT(uid) AS newusers", "regdate > '$timecut'");
	$newusers = my_number_format($db->fetch_field($query, "newusers"));

	// Get the number of active users today
	$query = $db->simple_select("users", "COUNT(uid) AS activeusers", "lastvisit > '$timecut'");
	$activeusers = my_number_format($db->fetch_field($query, "activeusers"));

The queries above will get the Past 24 hours stats.