Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Problems with Newest Nodes

by LanX (Saint)
on Jun 15, 2021 at 09:30 UTC ( [id://11133886]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Problems with Newest Nodes
in thread Problems with Newest Nodes

> it should be possible to implement a one level "undo" function.

If you really want to invest into this° , I'd suggest just permanently storing the result of the numdays dialog˛ into the "lastChecked or so" -field

because for a real undo you'd need a new field in the DB.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) for training purposes sounds OK

˛) see Re: Problems with Newest Nodes

Replies are listed 'Best First'.
Re^5: Problems with Newest Nodes
by cavac (Parson) on Jun 15, 2021 at 10:44 UTC

    Figured as much. Instead of blinking the field, mark it as invalid, like adding a '#' comment sign in front of it. I presume "Newest Nodes" is the only form that uses the field and the backend treats it as a text field?

    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
      I presume "Newest Nodes" is the only form that uses the field

      About the Newest Nodes view lists some of the other nodes/views which use it.


      🦛

      I doubt that, RAT should use it too.

      And there is some logic in Newest Nodes based on the "clear" status...

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        I think i have found all the logic bits in Newest Nodes. But yeah, code search revealed some other modules that also uses this, like the extra "clear" button in the user settings.

        Another way around might be to push the "last seen" timestamp about 30 years into the past. That way it's a valid timestamp, but it's just "long in the past" and the automatic limits would kick in in any code i overlooked. And in the couple of bits where logic depends on it (mainly which buttons to show in Newest Nodes), it would be easy to check if the timestamp is a few decades old.

        30 years seems a good number, as this shouldn't run into any 32 bit Unix epoch problems this might or might not still exist in the system. And if, in the future, a user logs back in after more than 30 years of inactivity, i'm pretty sure they wouldn't want to start reading where they left off.

        perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-19 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found