-----Ursprüngliche Nachricht-----
Von: wikitech-l-bounces(a)wikimedia.org
[mailto:wikitech-l-bounces@wikimedia.org] Im Auftrag von Magnus Manske
Gesendet: Montag, 11. Oktober 2004 22:02
An: Wikimedia developers
Betreff: Re: [Wikitech-l] dynamic contents in WikiMedia pages?
Arvalux wrote:
Is it possible to add dynamic contents to the pages of
WikiMedia? For
example to include some statistics from an underlying .xml file?
You can register an extension (currently an euphemism;-) as it was done
for <math>. For your extenstion foo, the wiki text <foo>bar</foo> will
then pass "bar" to a PHP function of your choice. You can also access
the global $wgTitle or the like to include a file associated with the
article title, or something.
Magnus
--------------------------------------------
Yeeeeeeeehhaaaaaaa! :-)
I've added following lines at the end of Setup.php:
function ParsePHPTag($Content)
{
ob_start();
eval($Content);
$Result = ob_get_contents();
ob_end_clean();
return($Result);
}
$wgParser->setHook('php','ParsePHPTag');
and I've added the following to a regular site, edited by click 'edit':
<php>
echo date('Y-m-d H:i:s');
</php>
Whats the result?
2004-10-12 01:11:23
It does its work! Yeeepiee! :-)
Now WikiMedia is my favorite UECMS - User Editable CMS ;-)
Of course, I'll remove my changes from the native WikiMedia files and put
them in separate files.
Thanks for help!
Arvalux.