Test /
NextEventAnchor
Events are held on the Events page.
The next event is: Test.Events#noevent
Problem with headings in the middle being shown:
(:include Events#t20060419# lines=4:) | ||||||||||||
| ||||||||||||
Even with display=none there is a small (invisible without tableborders) line.
%define=monat display=none% (:include Events#t20060419# lines=4:) | ||||||||||||
| ||||||||||||
Find the next event:
(:include {Events$NextEventAnchor} :)
|
Print the remaining calendar:
(:include {Events$NextEventAnchor}# :)
|
Print only the next three events:
(:include {Events$NextEventAnchor}# lines=3:)
|
Here's the code for the {$NextEventAnchor} page variable:
$FmtPV['$NextEventAnchor'] = 'NextEventAnchor($pn)';
function NextEventAnchor($pagename) {
global $Now;
$npat = '[[:alpha:]][-\\w]*';
$page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
$todayanchor = strftime('#t%Y%m%d', $Now);
if ($page
&& preg_match_all("/\\[\\[(#$npat)\\]\\]/", $page['text'], $alist)) {
foreach($alist[1] as $a)
if ($a >= $todayanchor) { return "$pagename$a"; }
}
return "$pagename#noevent";
}