MyBB Community Forums

Full Version: Checking posts made today
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm looking at the best way to calculate the posts made today for the entire forum I have two theories on how I would do this.

Theory 1:
I select dateline and numposts from the mybb_stats table select the latest datelines number of posts and deduct the the other rows number of posts from the current datelines number of posts.

Theory 2:
I check the mybb_posts table for where the dateline is todays date the issue with this is it's a unix timestamp that includes the date/time so specifying todays date in a unix timestamp would be an issue as it wouldn't have the same timestamp as a post.


Any help would be appreciated.
can you check the code used for getting view today's posts (eg.)
https://github.com/mybb/mybb/blob/featur....php#L1385
(2016-01-19, 10:11 AM).m. Wrote: [ -> ]can you check the code used for getting view today's posts (eg.)
https://github.com/mybb/mybb/blob/featur....php#L1385

Thank you, forgot there is a function in mybb that practically does this anyway.

(2016-01-19, 10:11 AM).m. Wrote: [ -> ]can you check the code used for getting view today's posts (eg.)
https://github.com/mybb/mybb/blob/featur....php#L1385
This would only check posts over the last 24 hours I need it to check for the current date.
Then simply calculate the time since the day started - e.g. by % UNIX time by a day (86400 seconds) or with strtotime().