Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: ccbtimewiz on August 11, 2008, 11:47:51 AM

Title: Changing "Today" Interval
Post by: ccbtimewiz on August 11, 2008, 11:47:51 AM
As we all know, SMF has a "Today" and "Yesterday" feature in the admin panel so we can see when posts were made more easily.

However, I'm trying to make it so it only says "today" when the post was after 4am. So if the post was made today at 2:21am, it would be listed as "yesterday" instead of "today".

Is there any simple solution to do this?
Title: Re: Changing "Today" Interval
Post by: [SiNaN] on August 11, 2008, 12:16:57 PM
You should edit time_format in Subs.php file.

Maybe something like this can work:

$now[0] - $then[0] > 72000
Title: Re: Changing "Today" Interval
Post by: ccbtimewiz on August 12, 2008, 03:21:07 PM
Quote from: [SiNaN] on August 11, 2008, 12:16:57 PM
You should edit time_format in Subs.php file.

Maybe something like this can work:

$now[0] - $then[0] > 72000

Alright, I'll give that a go.
Title: Re: Changing "Today" Interval
Post by: [SiNaN] on August 13, 2008, 02:20:02 AM
Also this could be an alternative:

if({original_today_statement} && $then['hour'] > 4)
echo today
and

if({original_yesterday_statement} || ({clone_of_original_today_statement} && $then['hour'] < 5))
echo yesterday