====== Daily Cartoon ======
I want the daily cartoon of userfriendly.org show up on one of my wiki pages. Since it has another URL every day, I try to do it via a syntax plugin. Unfortunately, everything works fine on preview, but the page is garbled after saving :-(
You can reproduce this when you save the code in a file named ''syntax.php'' in the ''lib/plugins/userfriendly'' directory of your DokuWiki installation. Then, place ''{~userfriendly~}'' in the page text (I have it on a separate line with one blank line above and one underneath) and see...
Here's the code, maybe you can give [[w.flamme@web.de|me]] some hints what I am doing wrong.
{$linkstart}This was *YOUR* link here.
* @date 2009-01-17
*/
if(!defined('DOKU_INC'))
die();
if(!defined('DOKU_PLUGIN'))
define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
require_once(DOKU_PLUGIN . 'syntax.php');
/**
* All DokuWiki plugins to extend the parser/rendering mechanism
* need to inherit from this class
*/
class syntax_plugin_userfriendly extends DokuWiki_Syntax_Plugin {
/**
* return some info
*/
function getInfo()
{
return array(
'author' => 'Werner Flamme',
'email' => 'w.flamme@web.de',
'date' => '2009-01-17',
'name' => 'Userfriendly.org Cartoon Plugin',
'desc' => 'Shows the daily cartoon from userfriendly org ' .
'as shown on http://ars.userfriendly.org/cartoons/?id=
" . htmlentities($myPrep) . '
'; // the next line causes the strange behaviour // $renderer->doc .= "\n" . $myPrep; return true; } // if ($mode == 'xhtml') return false; } // function render } // class syntax_plugin_userfriendly //Setup VIM: ex: et ts=4 enc=utf-8 :