[pmwiki-users] Calendar / Event list

Hans design at softflow.co.uk
Fri Mar 31 05:14:18 CST 2006


Friday, March 31, 2006, 11:53:03 AM, Thomas wrote:
> ||[[#t200604]]|| || ||
> ||[[#t20060401]]01.04.2006 ||20.00 || Pizzaeating ||
> ||[[#t20060404]]04.04.2006 ||      || Holiday     ||
> ||[[#t20060411]]11.04.2006 ||20.00 || Party-Time  ||
> ||[[#t20060419]]19.04.2006 ||15.00 || Teatime     ||
> ||[[#t200605]]|| || ||

> My problem is, that i can't seem to get something like:

> Next three events
> (:include Eventpage date>=today lines=3:)
> must not show past events, but can not be started with #t_today because
> that might not exist.

you can create today's date a sa page variable in config.php:

# add page variable {$Today}, formats today's date as yyyy-mm-dd
$FmtPV['$Today'] = 'strftime("%Y-%m-%d", time() )';

and then use conditional markup:
prepend each line of your list with (:if date {$Today}..eventdate:)
eventdate in form yyyy-mm-dd or yyymmdd.
so you get:

(:if date {$Today}..20060401:)||[[#t20060401]]01.04.2006 ||20.00 || Pizzaeating ||
(:if date {$Today}..20060404:)||[[#t20060404]]04.04.2006 ||      || Holiday     ||
(:if date {$Today}..20060411:)||[[#t20060411]]11.04.2006 ||20.00 || Party-Time  ||
(:if date {$Today}..20060419:)||[[#t20060419]]19.04.2006 ||15.00 || Teatime     ||
(:if date {$Today}..200605:)||[[#t200605]]|| || ||

the anchors are not needed for this.

each line will be shown from today till the event date.
i suppose you can skip {$Today} as well and use a date in the past
instead, like (:if date 2006..20060401:)


Best,
 Hans                           





More information about the pmwiki-users mailing list