[pmwiki-users] Highlight pagelist search results based on time thresholds

stevecrisp at gmail.com stevecrisp at gmail.com
Sun Jul 13 13:00:52 CDT 2008


Peter,

2008/7/13  <stevecrisp at gmail.com>:
> On yours Peter I get the elseif syntax on Wiki page so perhaps these
> things need to be on one line and copy/paste from your email is not
> quite good enough.

As above it was an issue introduced by copying/pasting from your email
(I expect a missing space?).  I've used Hans' block colouring on mine
and have yours working my end now.  For completeness this is what I'm
using:

!!!fmt=#ColorByDate2

A simple bullet list of page names. Colored %red%red%% if within last
7 days, %blue%blue%% if within last 30 days, %green%green%% if older.

[@
[[#ColorByDate2]]
(:if date {(ftime "%Y-%m-%d" "-1 days")}..{(ftime "%Y-%m-%d")} {(ftime
"%Y-%m-%d" "{=$LastModifiedYMD}")}:)>>bgcolor=#fcc<<
(:elseif date {(ftime "%Y-%m-%d" "-30 days")}..{(ftime "%Y-%m-%d")}
{(ftime "%Y-%m-%d" @{=$LastModifiedU})}:)>>bgcolor=#fed<<
(:else:)>>bgcolor=#eee<<(:ifend:)
* [[{=$FullName}]] {=$LastModified}
>><<
[[#ColorByDate2end]]
@]

I'm off now to work out Hans' solution so I can compare the two.

Thanks for your help with this,
-Steve.



More information about the pmwiki-users mailing list