Not Solved [How To?] I would like to see it for 24 hours
#1
Not Solved
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]
Reply
#2
Not Solved
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_1...s.php#L333
You can read "relative" time starting from here: https://github.com/mybb/mybb/blob/mybb_1...s.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_1...s.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.
Could be wrong but worth a try.
Reply
#3
Not Solved
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.
I don't answer questions about localhost forums or forums without URL, I'm not a seer.  Cool
Reply
#4
Not Solved
(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 ?
Reply
#5
Not Solved
can anyone help me with this?
Reply
#6
Not Solved
(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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)