We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Using the timesince plugin with {edit_date}

Development and Programming

dwex's avatar
dwex
94 posts
16 years ago
dwex's avatar dwex

I tried using the Timesince plugin with the {edit_date} variable, and got crazily negative results. After verifying that it did work correctly for {entry_date}, I did a little looking in the database. {edit_date} is stored in the database in a totally different format from the other dates, so that plugin isn’t going to work without a lot of reworking.

Am I missing something? Any suggestions?

Thanks

Moved to Plugins: Discussion and Questions by Moderator

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

dwex, that plugin doesn’t support edit_date. You’d need to modify the plugin to make it work. I’m going to move this to the Plugins forum for additional community involvement.

       
dwex's avatar
dwex
94 posts
16 years ago
dwex's avatar dwex

OK, so I hacked together a version of the Timesince plugin that takes an ‘edit_date’ parameter, and if it’s set to “yes”, runs the date through $LOC->timestamp_to_gmt() before processing.

This seems rather ugly, but I can’t figure out any good way to figure out whether or not to do that based solely on the input, except perhaps to choose to do it heuristically based on the length of the input data.

Any thoughts?

The documentation link in the Timesince plugin leads to a 404 page; I’m guessing this isn’t supported any more. Any suggestions on what to do with an updated plugin? Create my own ‘Timesince2’ and post that?

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
16 years ago
Lisa Wess's avatar Lisa Wess

That plugin was created awhile ago, the author may have moved on. You can redistribute it only i the licensing allows - you can check the PHP file for the type of licensing.

Otherwise, you’ll just need to re-code it or use it on your own sites and not distribute the changes. =)

       
dwex's avatar
dwex
94 posts
16 years ago
dwex's avatar dwex

Hmm. The only copyright in the plugin itself is a 2004 edition pMachine copyright statement, and the download library lists the license type as ‘Freeware’. Your suggestion?

I’m still not satisfied with the technical approach; this just has the feel of a bad hack…

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.