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

stevecrisp at gmail.com stevecrisp at gmail.com
Sun Jul 13 14:29:43 CDT 2008


2008/7/13 Patrick R. Michaud <pmichaud at pobox.com>:
> FWIW, here's my version of the above (in PmWiki 2.2.0-beta66,
> locally adding {$LastModifiedTime}):
>
>  [@
>  [[#colorbydate]]
>  (:if     date -7days..  @{=$LastModifiedTime} :)>>bgcolor=#ffcccc<<
>  (:elseif date -30days.. @{=$LastModifiedTime} :)>>bgcolor=#ccccff<<
>  (:else:)>>bgcolor=#ccffcc<<
>  (:ifend:)
>  * [[{=$FullName}]] {=$LastModified}
>  [[#colorbydateend]]
>  @]
>
> No need to use {(ftime)} at all.  :-)
>
> Demonstrated at http://www.pmwiki.org/wiki/Test/ColorByDate .

Wow, this is turning out to be a competition ;-)

Thanks for your version Patrick.  I see it working on your site, but
does not on mine.  All items go green (#ccffcc) - the last else case
is used.  I'm from the UK so do you think our system date formats
might be to blame?  This might be why Han's version doesn't work as
expected also.

-Steve.



More information about the pmwiki-users mailing list