MyBB Community Forums
[How To?] I would like to see it for 24 hours - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] I would like to see it for 24 hours (/thread-225565.html)



I would like to see it for 24 hours - MyBBEinstein - 2019-12-02

I would like to ask how can this be done?

my forum  only shows until 11 o'clock, after that it adds a date, but I would like to show it to 23 o'clock without a date, is there a solution?

can anyone help me with this?

Thx.

so I would like to see it as shown in the picture

[Image: vSBro04.png]


RE: I would like to see it for 24 hours - noyle - 2019-12-02

I was thinking in OP's same way for displaying a relative time which have span greater than "half a day", i.e., 12 hours. But unfortunately, it can't be done easily without modifying MyBB core function, I suppose.

The very function involved here is my_date(): https://github.com/mybb/mybb/blob/mybb_1821/inc/functions.php#L333
You can read "relative" time starting from here: https://github.com/mybb/mybb/blob/mybb_1821/inc/functions.php#L401:
However, there's a hook at the end of this function that makes it possible to do some dirty work: https://github.com/mybb/mybb/blob/mybb_1821/inc/functions.php#L468 . I think it'd be hard & heart breaking if one decided to use this hook. For myself, I haven't come up with a feasible idea to use this plugin under this circumstance.


RE: I would like to see it for 24 hours - NoRules - 2019-12-02

Hi,

as Noyle said, you'll have to edit the inc/functions.php file and change the line:
elseif($ty != 2 && abs(TIME_NOW - $stamp) < 43200)

to:
elseif($ty != 2 && abs(TIME_NOW - $stamp) < 86400)
To have a 24 hour mode.

Remember: on every MyBB's update if the functions.php file is changed, you'll have to edit it again.

Remember 2: if you're going to edit core files, 1st make a backup, 2nd make a backup, 3rd have you made a backup of the file?, and 4th use a program like Notepad++ or similar to edit it.


RE: I would like to see it for 24 hours - MyBBEinstein - 2019-12-02

(2019-12-02, 02:13 PM)NoRules Wrote: Hi,

as Noyle said, you'll have to edit the inc/functions.php file and change the line:
elseif($ty != 2 && abs(TIME_NOW - $stamp) < 43200)

to:
elseif($ty != 2 && abs(TIME_NOW - $stamp) < 86400)
To have a 24 hour mode.

Remember: on every MyBB's update if the functions.php file is changed, you'll have to edit it again.

Remember 2: if you're going to edit core files, 1st make a backup, 2nd make a backup, 3rd have you made a backup of the file?, and 4th use a program like Notepad++ or similar to edit it.


hi @Noyle

super ,and how can i set this up? 1day ago / 2 day ago / 3 day ago / 4 day ago / 5 day ago / 6 day ago / 1 weeks ago / 2 weeks ago / 3 weeks ago / 4 weeks ago ?


RE: I would like to see it for 24 hours - MyBBEinstein - 2019-12-04

can anyone help me with this?


RE: I would like to see it for 24 hours - MyBBEinstein - 2019-12-06

(2019-12-05, 10:24 PM)AndreaSoto Wrote: The problem with the time zone. Check it and install the necessary one. And everything goes OK.

hi @AndreaSoto

thank you

but how?