Simplify post dates by aproximating calculating how much time has passed

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
User avatar
Dragosvr92
Registered User
Posts: 1450
Joined: Sat Sep 12, 2009 7:27 am
Location: Romania
Name: Dragos Valentin Rădulescu
Contact:

Simplify post dates by aproximating calculating how much time has passed

Post 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)
Formerly known as TheKiller
3.0| Avatar on Memberlist 1.0.3
svennson
Registered User
Posts: 60
Joined: Wed Jun 01, 2005 4:54 pm
Location: Belguim
Contact:

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

Post by svennson »

I think with phpBB 3.1's requirements to PHP 5.3.3+, it might be doable with dateinterval
User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

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

Post 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
Last edited by MuhClaren on Wed Aug 05, 2015 8:41 am, edited 1 time in total.
svennson
Registered User
Posts: 60
Joined: Wed Jun 01, 2005 4:54 pm
Location: Belguim
Contact:

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

Post 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!
User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

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

Post 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.
User avatar
Dragosvr92
Registered User
Posts: 1450
Joined: Sat Sep 12, 2009 7:27 am
Location: Romania
Name: Dragos Valentin Rădulescu
Contact:

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

Post 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 :)
Formerly known as TheKiller
3.0| Avatar on Memberlist 1.0.3
User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

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

Post 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 :)
;)
User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

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

Post 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.
elawrenc
Registered User
Posts: 131
Joined: Thu Jul 21, 2011 2:41 pm

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

Post 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.
elawrenc
Registered User
Posts: 131
Joined: Thu Jul 21, 2011 2:41 pm

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

Post 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.
User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

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

Post 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
User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

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

Post 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.
svennson
Registered User
Posts: 60
Joined: Wed Jun 01, 2005 4:54 pm
Location: Belguim
Contact:

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

Post by svennson »

Can't wait :D
User avatar
MuhClaren
Registered User
Posts: 126
Joined: Sat Feb 21, 2015 5:23 am

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

Post 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.
User avatar
Dragosvr92
Registered User
Posts: 1450
Joined: Sat Sep 12, 2009 7:27 am
Location: Romania
Name: Dragos Valentin Rădulescu
Contact:

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

Post by Dragosvr92 »

Awesome @MuhClaren ! Thanks. I am waiting for it :)
Formerly known as TheKiller
3.0| Avatar on Memberlist 1.0.3
Post Reply

Return to “Extension Requests”