Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Update post date after edit

by 1nickt (Canon)
on Nov 26, 2018 at 14:21 UTC ( #1226339=monkdiscuss: print w/replies, xml ) Need Help??

Hi all, I propose that the timestamp on a post be updated to the time of the most recent edit.

The original time should also be preserved and used for computing the Best/Worst nodes lists. But if someone edits their post I would like to be able to know that programmatically (ie in RAT, Newest Nodes) rather than having to scan all existing posts to see if an author has added/changed/cribbed something (*if* they declare it).

I will gladly help with implementing these changes if needed.


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re: Update post date after edit
by pryrt (Abbot) on Nov 26, 2018 at 14:39 UTC

    I have previously had a similar thought; I'm glad ++you took the important step of acting on the thought, rather than procrastinating like I did :-). It would be nice, when listed in the RAT/Newest Nodes, if such a post highlighted itself somehow (an asterisk or similar) to indicate it's a changed post, rather than a new post.

      ...a post highlighted itself somehow (an asterisk or similar) to indicate...

      I would suggest to tag an updated node using CSS class attribute (i.e. updated) with a sensible site-default:

      <div class="$AS_BEFORE updated"> ... </div>
      Now, every monk can fine-tune the layout using own CSS redefinitions (Help for Display Settings). Something like i.e.
      .updated { border-left: 1px solid red; }
      .updated::before { content: "UPDATED: "; }
      Perhaps add ud-$YYYYMMDD or updated-today or similar for more customisation options?

Re: Update post date after edit
by jdporter (Chancellor) on Nov 28, 2018 at 17:42 UTC
Re: Update post date after edit
by jdporter (Chancellor) on Nov 26, 2018 at 19:33 UTC

    Please point me to an example node. tia.

      A couple people sent me some examples via pm. Thank you! It turns out that we currently can't show that a node has been edited, because the fact is not recorded in the database. We have the infrastructure in place to do so -- there is a "last edited" timestamp field associated with every document-type node -- but currently this field is not used for ordinary writeup-type nodes. (It is used for wikis and things like that.) pmdevils, take a look at the lastedit field. Patches welcome. :-)

      I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://1226339]
Approved by davies
Front-paged by erzuuli
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2023-12-11 00:31 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.