Tags:
create new tag
, view all tags

Render Page with Age information

I'm trying to come up with a way to indicate the amount of time that's passed since a page was edited, preferably in a more immediately visual way that the current text string. Something like the page turning grey as it got older, or a visual image at the top that got swapped out with a different one as time passed. I'm wondering if this is best done with templates or some kind of plug-in. I've written extensions for other software before, but have little idea how Twiki works on its backend, so any advice here would be appreciated.

-- ShaneLiesegang - 17 Jun 2006

I've used SpreadSheetPlugin to display images based on dates, though those were dates in a form. It works something like:

%<nop>CALC{$SET(weekold, $TIMEADD($TIME(), -7, day))}% 
%<nop>SEARCH{"^NieuwsBericht" scope="all" regex="on" nosearch="on" nosummary="on" nototal="on" reverse="on" order="created"
format="$percntCALC{$IF($TIME($date) < $GET(weekold) , <nop> , $percntICON{led-green}$percnt}$percnt"}%

This displayes %ICON{led-green}% only if topics are less then a week old. I'm not sure if you can access the time the topic was created, and i'm also not sure if this is the best way to go.

-- JosMaccabiani - 17 Jun 2006

It would be good to be able to do this with gradient colors. For example, hot fresh topics first display as green, and if not edited, start turning towards light gray. Or something. I guess you could use some javascripting to calculate the color based on the returned age? (Dont ask me how, I just got started with javascript)

-- MikkoLaakso - 11 Mar 2007

Yes, a "freshness stamp" would be handy on each page. See also : TimeSincePlugin

-- KeithHelfrich - 11 Mar 2007

How about calculating the time in days since last edit and mapping the background page color to some shade of yellow (since paper gets yellower as it gets older). CSS should make it easy to chage the background color right?

-- JohnRouillard - 11 Mar 2007

Yes, that can be done with some SpreadSheetPlugin magic and style sheets. Example:

  • Age factor: 10 (determines the "speed" of aging; factor x 5 is time for max color; here set to 10 x 5 = 50 sec to see effect)
  • Current epoc time: 1504439377
  • Topic epoc time: 1174174557 (format 2007/03/17 - 23:35:57 GMT)
  • Time diff: 330264820
  • Factor: 33026482
  • Cap: 5
  • Color: #FFFFAF

Test:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-- PeterThoeny - 12 Mar 2007

Another idea I've had, somewhat related, is AutoTwistingComments. Wouldn't it be nice, for example, to auto-twist older comments using the TwistyPlugin and color the text of the twisty container based on the age (> 1 year, >6 mo > 3 mo)

-- KeithHelfrich - 17 Mar 2007

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2007-03-17 - KeithHelfrich
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.