Tags:
search1Add my vote for this tag create new tag
view all tags

Question

TimeSincePlugin does not work as expected in the SEARCH{"text"}

I would like to use TimeSincePlugin to show how old is a change of page in easily readable way.

I have following in 25 most recent topic changes in Codev, Plugins, TWiki, Support webs:

%TABLE{sort="on" initsort="1" initdirection="up"}%
| *Last Modified* | *Web.Topic* | *Last Editor* | *Edit Age* |
%SEARCH{ "." regex="on" nosearch="on" nototal="on" limit="%URLPARAM{"limit" default="3"}%" web="%URLPARAM{"web" default="TWiki, Main"}%" excludetopic="WebStatistics" reverse="on" order="modified" format="| $date - [[%SCRIPTURL%/compare%SCRIPTSUFFIX%/$web/$topic?_foo=$rev][diff]] / [[%SCRIPTURL%/rdiff%SCRIPTSUFFIX%/$web/$topic?type=last&render=sequential&context=9000&_foo=$rev#diff001][in-line diff]] - $rev | [[%SCRIPTURL%/view%SCRIPTSUFFIX%/$web/$topic#foo_$rev][$web.$topic(35, ...)]] | $wikiusername " | %TIMESINCE{ from=$date }% |}%

Neither above solution in last table column nor solutions below work for me. I get a table data converted into one row without any space = something completely unreadable.

| %TIMESINCE{ from="$date" }% |
| %TIMESINCE{ from=$date   }% |
| %TIMESINCE{ from=%MAKETEXT{"[_1]" args=$date}% }% |
| %TIMESINCE{ from=%MAKETEXT{"[_1]" args=" $date "}% }% |

Could someone give me a hint how should directive TIMESINCE use $date variable to obtain proper result?

Or is it some bug in TimeSincePlugin?

For example

| %MAKETEXT{"[_1]" args="$date"}% |
as a last table column renders the $date variable well.

Thank you in advance!

Here is an example how TWiki renders the table (need TimeSincePlugin installed):

Last Modified Web.Topic Last Editor Edit Age
%SEARCH{ "." regex="on" nosearch="on" nototal="on" limit="3" web="Walter, WKUWS, TWiki, Main" excludetopic="WebStatistics" reverse="on" order="modified" format="| $date - diff / in-line diff - $rev | $web.$topic(35, ...) | $wikiusername | %TIMESINCE{ from=$date }% |" }%

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: SpreadSheetPlugin (Dakar, 8154) CommentPlugin (Dakar, 8164) EditTablePlugin (Dakar, 8154) InterwikiPlugin (Dakar, $Rev: 8713$) PreferencesPlugin (Dakar, 8170) SlideShowPlugin (Dakar, $Rev: 8713$) SmiliesPlugin (Dakar, 8154) TablePlugin
Server OS: Suse 2.4.21-226-smp
Web server: Apache/1.3.26 (UnitedLinux?) mod_ssl/2.8.10 OpenSSL/0.9.6g mod_perl/1.27
Perl version: 5.8.0
Client OS: W'XP SP2
Web Browser: Firefox
Categories: Search, Plugins

-- DaliborSvoboda - 02 Mar 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

There's a syntax error in the above SEARCH: the closing quote in the format string is at the wrong position. Furthermore, the TIMESINCE expression is evaluated before the SEARCH expression. You need to escape quotes using \" and rewrite % as $percnt. See FormattedSearch for more help. Good luck smile .

-- MichaelDaum - 02 Mar 2006

Thanks a lot! It works now.

Sorry for stupid question...

The solution is: | $percntTIMESINCE{ from=\" $date \" }$percnt |

-- DaliborSvoboda - 03 Mar 2006

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2006-03-03 - DaliborSvoboda
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.