[dokuwiki] How to embed an external picture

  • From: Werner Flamme <werner.flamme@xxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 17 Jan 2009 23:28:52 +0100

Hi everyone,

I want the daily cartoon of userfriendly.org on one of my wiki pages.
Since there is a new URL every day, I try to do this through a syntax
plugin.

The plugin works fine so far - when doing the preview, I see the cartoon
where it should be. As soon as I press "Save", the page is rendered anew
and contains PHP source code instead of the text (and cartoon) I entered.

In the source view of my Firefox 2, I see
      <!-- wikipage start -->
      <?
///////////////////////////////////////////////////////////////////////////////////////////////////
// GIF Util - (C) 2003 Yamasoft (S/C)
// http://www.yamasoft.com
// All Rights Reserved
// This file can be frelly copied, distributed, modified, updated by
anyone under the only
// condition to leave the original address (Yamasoft,
http://www.yamasoft.com) and this header.
///////////////////////////////////////////////////////////////////////////////////////////////////

...and the whole code of this file, ending with '?>' The rest of the
page (text, footer) is not shown. As I said, in the preview everything
is fine. What am I doing wrong?

When I do not add $mycode to $renderer->doc but htmlentities($mycode),
the page shows
<p><a href="http://userfriendly.org/";><img
src="http://www.userfriendly.org/cartoons/archives/09jan/xuf012317.gif";
alt="userfriendly.org daily cartoon" title="userfriendly.org daily
cartoon" /></a></p>
- just what I expect... In the preview, when the cartoon is displayed,
the page source reads
<p><a href="http://userfriendly.org/";><img
src="http://www.userfriendly.org/cartoons/archives/09jan/xuf012317.gif";
alt="userfriendly.org daily cartoon" title="userfriendly.org daily
cartoon" /></a></p>

Do I have to add a method getAllowedTypes()? What had to be the return
value? array('externallink')? And then just adding
'[[http://www.userfriendly.org/cartoons/archives/09jan/xuf012317.gif]]'
instead of the code above to $renderer->doc?

BTW, I'm using the current devel version, updated by darcs. Thanks for
all the patches in the last few days :-)

Regards,
Werner
-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: