Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2019-10-17 07:06:20

Hungmi
FluxBB Donor
Registered: 2010-08-04
Posts: 23
Website

Time Format in the Last post column (tcr)

Hello!
Now, Time Format in the Last post column is like:

2019-09-13 05:01:34
by GWR

or

Yesterday 09:29:33
by Visman

How can I change it to:

2019-09-13
by GWR

(Only data)
and

Yesterday 09:29:33
by Visman

(No change)

It means, when the last post time is today or yesterday, use "Today hh:mm:ss", and when the time is earlier, just use date, "YYYY-MM-DD".

Thanks, FluxBB 1.5.

Offline

#2 2019-10-17 07:39:33

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 1,381
Website

Re: Time Format in the Last post column (tcr)

include/function.php
add

function format_time2($timestamp, $date_only = false, $date_format = null, $time_format = null, $time_only = false, $no_text = false, $user = null)
{
	$tmp1 = format_time($timestamp, true, $date_format, $time_format, $time_only, false, $user);
	$tmp2 = format_time($timestamp, true, $date_format, $time_format, $time_only, true, $user);
	if ($tmp1 === $tmp2)
		return $tmp1;
	else
		return format_time($timestamp, $date_only, $date_format, $time_format, $time_only, $no_text, $user);
}

index.php and viewforum.php
replace

format_time

to

format_time2

Offline

#3 2019-10-17 08:45:36

Hungmi
FluxBB Donor
Registered: 2010-08-04
Posts: 23
Website

Re: Time Format in the Last post column (tcr)

Visman wrote:

include/function.php
add
...

Good, Thank you!

Offline

Board footer

Powered by FluxBB