And,
besides Jeff's solution which works in the template only and not inside the
content, use this hack below.
This enables these special page macros.
But jeff already had better ideas for these kinds of dynamic content,
With dynamic extendable %%extension attribute=value ...%% markup.
See http://phpwiki.sourceforge.net/phpwiki/index.php?MagicPages
Add this hack to lib/stdlib.php:
$transform->register(WT_SIMPLE_MARKUP, 'wtm_mostpopular');
// Bretin hack
$transform->register(WT_SIMPLE_MARKUP, 'wtm_currentdate');
$transform->register(WT_SIMPLE_MARKUP, 'wtm_currentdatetime');
...
// Bretin hack
// wiki token: %%CurrentDate%%
function wtm_currentdate($line, &$transformer) {
if (strpos($line, '%%CurrentDate%%') !== false) {
$html = date($dateformat);
$line = str_replace('%%CurrentDate%%', $html, $line);
}
return $line;
}
// wiki token: %%CurrentDateTime%%
function wtm_currentdatetime($line, &$transformer) {
if (strpos($line, '%%CurrentDateTime%%') !== false) {
$html = date($datetimeformat);
$line = str_replace('%%CurrentDateTime%%', $html, $line);
}
return $line;
}
Didier Bretin schrieb:
> I would like to display the current date in all my pages. I find how to
> do this in php, but I can't find where I can add this in the lib/*.php files.
> I have tried some changes but I go no solution. Can you help me ? Where I
> can add the code for the date ?
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
|