Posts: 17
Threads: 9
Joined: Sep 2016
Reputation:
0
2016-09-20, 09:13 PM
How i can do this on mybb 18?
https://community.mybb.com/thread-42850.html
This post is old and i don't find code exemple:
$lastpost_date = my_date($mybb->settings['dateformat'], $lastpost_data['lastpost']);
$lastpost_time = my_date($mybb->settings['timeformat'], $lastpost_data['lastpost']);
I hope someone can help me.
Thanks
Posts: 1,092
Threads: 57
Joined: May 2014
Reputation:
57
2016-09-20, 09:31 PM
$variable = my_date('relative', $another_variable);
?
Posts: 17
Threads: 9
Joined: Sep 2016
Reputation:
0
2016-09-21, 08:04 AM
(2016-09-20, 09:31 PM)Sazze Wrote: $variable = my_date('relative', $another_variable);
?
What i can do with this code?
Posts: 217
Threads: 12
Joined: Dec 2015
Reputation:
9
2016-09-21, 10:17 AM
(This post was last modified: 2016-09-21, 10:18 AM by Paradigm.)
(2016-09-21, 08:04 AM)shihrem Wrote: (2016-09-20, 09:31 PM)Sazze Wrote: $variable = my_date('relative', $another_variable);
?
What i can do with this code?
Any code that uses the relative format in the my_date function will display as x time ago within a specific timeframe.
You can find the function within inc/functions.php on line 332 or here
Posts: 17
Threads: 9
Joined: Sep 2016
Reputation:
0
2016-09-21, 07:35 PM
So i need to change code from line 332 to this code?
I don't understand very well is my first time when i use mybb i'm a noob.
Thanks for replyes.
Posts: 1,092
Threads: 57
Joined: May 2014
Reputation:
57
2016-09-21, 08:27 PM
As I said above, but here:
$lastpost_date = my_date('relative', $lastpost_data['lastpost']);
$lastpost_time = my_date('relative', $lastpost_data['lastpost']);
But I'm pretty sure MyBB already does this...
Posts: 17
Threads: 9
Joined: Sep 2016
Reputation:
0
2016-09-21, 09:48 PM
(2016-09-21, 08:27 PM)Sazze Wrote: As I said above, but here:
$lastpost_date = my_date('relative', $lastpost_data['lastpost']);
$lastpost_time = my_date('relative', $lastpost_data['lastpost']);
But I'm pretty sure MyBB already does this...
Yes but i want to change time, my database is old and i want to change time from yar 2011 to 2016
last post 01.10.2011 to 01.10.2016 or somethng like this..
Hope now understand my request...
Posts: 217
Threads: 12
Joined: Dec 2015
Reputation:
9
2016-09-22, 10:11 AM
(2016-09-21, 09:48 PM)shihrem Wrote: (2016-09-21, 08:27 PM)Sazze Wrote: As I said above, but here:
$lastpost_date = my_date('relative', $lastpost_data['lastpost']);
$lastpost_time = my_date('relative', $lastpost_data['lastpost']);
But I'm pretty sure MyBB already does this...
Yes but i want to change time, my database is old and i want to change time from yar 2011 to 2016
last post 01.10.2011 to 01.10.2016 or somethng like this..
Hope now understand my request...
You want to update all posts/threads timestamp to a more current date?
Posts: 17
Threads: 9
Joined: Sep 2016
Reputation:
0
2016-09-22, 09:29 PM
(2016-09-22, 10:11 AM)Paradigm Wrote: (2016-09-21, 09:48 PM)shihrem Wrote: (2016-09-21, 08:27 PM)Sazze Wrote: As I said above, but here:
$lastpost_date = my_date('relative', $lastpost_data['lastpost']);
$lastpost_time = my_date('relative', $lastpost_data['lastpost']);
But I'm pretty sure MyBB already does this...
Yes but i want to change time, my database is old and i want to change time from yar 2011 to 2016
last post 01.10.2011 to 01.10.2016 or somethng like this..
Hope now understand my request...
You want to update all posts/threads timestamp to a more current date?
Yes this is what i want to do.
|