MyBB Community Forums

Full Version: Relative Time Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

Was just wondering if it was possible for someone to make a working plugin for MyBB 1.8 that changes all times from the full date to "x days ago" or "x months ago"?

To me it just means a lot more than a full PHP date.
If you take a look, you can find options for this in your database i guess.. :-)
I mean. You can do it manually from there.
This is a default feature on MyBB 1.8 is it not?
It is not as I stated. You get relative time up until about "an hour ago", anything further does not work, and outputs either "today" "yesterday" or a full date.

I had a plugin that worked in 1.6 to do this, but it is not compatible with 1.8 unfortunately.

I've attached examples of both. (I have the working plugin on my forum for MyBB 1.6. Maybe there is a way I can modify MyBB's code to extend how long it uses relative time for?
You can use the hook: "my_date".

documentation: https://github.com/mybb/mybb/blob/featur...s.php#L503
(2014-10-28, 01:48 PM)dragonexpert Wrote: [ -> ]You can use the hook: "my_date".

documentation: https://github.com/mybb/mybb/blob/featur...s.php#L503

If only I was a PHP expert :p that's okay. Guess I'll just wait up and hope for the best. Thanks
(2014-10-29, 12:10 AM)Downfall Wrote: [ -> ]
(2014-10-28, 01:48 PM)dragonexpert Wrote: [ -> ]You can use the hook: "my_date".

documentation: https://github.com/mybb/mybb/blob/featur...s.php#L503

If only I was a PHP expert :p that's okay. Guess I'll just wait up and hope for the best. Thanks

If you have basic knowledge of both logic and PHP syntax you could do this pretty easily.
http://learnxinyminutes.com/docs/php/
(2014-10-29, 03:38 AM)ectomatt Wrote: [ -> ]
(2014-10-29, 12:10 AM)Downfall Wrote: [ -> ]
(2014-10-28, 01:48 PM)dragonexpert Wrote: [ -> ]You can use the hook: "my_date".

documentation: https://github.com/mybb/mybb/blob/featur...s.php#L503

If only I was a PHP expert :p that's okay. Guess I'll just wait up and hope for the best. Thanks

If you have basic knowledge of both logic and PHP syntax you could do this pretty easily.
http://learnxinyminutes.com/docs/php/

Thanks for the link. I do know PHP, just not terribly good at it, and I haven't done anything for a while due to uni assessments and exams piling up. I'll have to give this a go when I have some free time in a couple of months.

Thanks for your responses everyone :3
Maybe your old plugin can be updated?