Page 1 of 2

Simplify post dates by aproximating calculating how much time has passed

Posted: Fri Jul 10, 2015 6:34 pm
by Dragosvr92
By whatever timeformat you have set in your acp, in its right side, between round brackets, the date should be calculated in the following example format.

Code: Select all

59 min. ago
1 hour ago
2 hours ago
1 week ago
2 weeks ago
1 month ago
2 months ago
1 year ago
For example,
Post by Dragosvr92 ยป 10 Jul 2015, 20:34 (3 weeks ago)

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Thu Jul 23, 2015 10:35 am
by svennson
I think with phpBB 3.1's requirements to PHP 5.3.3+, it might be doable with dateinterval

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Fri Jul 24, 2015 11:06 pm
by MuhClaren
I have an extension which does this. It's not packaged for distribution yet, but if you can wait for a few days, I'll put one out. I'm traveling right now, so once I get home on the 28th, I will work on a distribution.

It uses units from "Seconds" all the way through "Decades" and every increment in-between. It updates the times on viewforum.php via jQuery / AJAX automatically, so the times change without page reloads.

If the user has javascript blocked, this extension provides a PHP based failover providing the same functionality, instead of breaking.

You're welcome to use it, or to modify it if you need additional capabilities.

I'll update this thread when I've submitted the package for download.

Image

Image

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Tue Aug 04, 2015 6:21 pm
by svennson
MuhClaren wrote:I have an extension which does this. It's not packaged for distribution yet, but if you can wait for a few days, I'll put one out. I'm traveling right now, so once I get home on the 28th, I will work on a distribution.

It uses units from "Seconds" all the way through "Decades" and every increment in-between. It updates the times on viewforum.php via jQuery / AJAX automatically, so the times change without page reloads.

If the user has javascript blocked, this extension provides a PHP based failover providing the same functionality, instead of breaking.

You're welcome to use it, or to modify it if you need additional capabilities.

I'll update this thread when I've submitted the package for download.
Sounds great ! Looking forward to trying it out!

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Wed Aug 05, 2015 8:35 am
by MuhClaren
svennson wrote:Sounds great ! Looking forward to trying it out!
Ah, so I guess there is interest. I figured after not getting any response from OP, that he wasn't interested in what I had to offer, therefore, I took it off of my to do list. I'll put it back on the list, and see what I can do with it in a day or two. If I recall, we needed an event which doesn't exist (yet) in order to make the extension truly plug-n-play, but I may be able to work around that using some jQuery.

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Wed Aug 05, 2015 12:58 pm
by Dragosvr92
Of course i am. I was bit busy and didnt check phpbb. Didnt thought there will be any replies.
Looking forward for your extension :)

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Thu Aug 06, 2015 5:47 am
by MuhClaren
Dragosvr92 wrote:Of course i am. I was bit busy and didnt check phpbb. Didnt thought there will be any replies.
Looking forward for your extension :)
;)

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Fri Aug 07, 2015 11:13 am
by MuhClaren
Just a quick update: I'm tidying this up today, and will expand it with a settings page in the ACP, as well as provide a toggle to turn it on or off for both viewtopic and viewforum.

I expect to have it up on github in a day or so, and a beta release posted here.

I'll keep you updated as things progress.

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Sat Aug 08, 2015 7:34 am
by elawrenc
I am also interested in this. One of my biggest issues with PHPBB is that the main page can look very cluttered with full date/time especially if you have a lot of forums and also if you are running Recent Topics, etc.

IP Board does something similar but your extension looks even cleaner than that!

I'm willing to help test when you are ready to release a dev version.

Subscribed.

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Sat Aug 08, 2015 7:38 am
by elawrenc
If I may add something:

We probably don't care about the time if something is 2 days old. However, regarding the time frame from "Now" till "Yesterday", I think it would be helpful to include a time since we would probably want to know the chronology of a fresh post. i.e. Yesterday at 1:30 am or Today at 3:17pm.

Once a topic has aged past 1 day, the time is most likely irrelevant.

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Sat Aug 08, 2015 8:30 am
by MuhClaren
elawrenc wrote:If I may add something:

We probably don't care about the time if something is 2 days old. However, regarding the time frame from "Now" till "Yesterday", I think it would be helpful to include a time since we would probably want to know the chronology of a fresh post. i.e. Yesterday at 1:30 am or Today at 3:17pm.

Once a topic has aged past 1 day, the time is most likely irrelevant.
Currently, I'm using the native phpbb timestamps to populate the tool-tip when the user hovers the pointer over the TimeAgo timestamp (see image below). I found this to be an acceptable compromise in order to keep the UI clean and uncluttered, yet still offer this specificity if needed. I suspect that it could be improved a bit by adding an icon near the TimeAgo timestamp which would indicate that something more exists.

Image

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Sat Aug 08, 2015 6:20 pm
by MuhClaren
I spent the morning re-writing this extension. It's now 100% PHP, no javascript required.

I expanded support to the index page for the category forumlist view (last_post). It's also on viewforum, and viewtopic. Each has a toggle in the control panel to turn it on or off.

The admin can define the detail level for each instance. For example, perhaps on viewforum one would like "3 days, 9 hours ago", but on viewtopic "3 days, 9 hours, 22 seconds ago", or on the index (category) page just "3 days ago". Alternatively, any or all can be toggled off, in which case the native format is used.

Things left to do before I release it:

1. Finish admin module
2. Framework for language files
3. Drink a pint

If I don't get interrupted, probably tonight or tomorrow for a beta release package.

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Sun Aug 09, 2015 12:26 pm
by svennson
Can't wait :D

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Sun Aug 09, 2015 3:30 pm
by MuhClaren
This sprint is complete, and I'm setting up my github environment this morning. Not sure how long this will take me since I use SVN for everything, but once I have the project in git(hub) I'll post the extension in the Development forum and drop a link here on this thread.

Re: Simplify post dates by aproximating calculating how much time has passed

Posted: Sun Aug 09, 2015 3:45 pm
by Dragosvr92
Awesome @MuhClaren ! Thanks. I am waiting for it :)