Translations of this page?:

In need of a simple integration/plugin capability for inline php includes I created a simple custom php include handler. It uses simple syntax and regular expression matching so that the instructions/data sent to the custom php code is not executed arbitrarily. This works similar to the custom.php handler for text replacements, but executes and processes the resulting php code, placing the results inline with the rest of the page.

As currently implemented, the inline wiki tag looks like:

::sparkline-bar>5,1,3,4,2,6,2,1,2::

The above include calls a sparkline drawing utility that uses the library available at http://sparkline.org/

I've created two simple examples of working customphp.php includes. One of them draws sparklines using the Sparkline PHP library and the other includes a Singapore Image Gallery using an identical namespace to the page's namespace.

CustomPHP Sparklines: http://sjf.poeticpublishing.com/doku.php?id=sparkline

A patch for dokuwiki-2005-02-06 to include the customphp functionality is available at: http://sjf.poeticpublishing.com/doku.php#scripts_and_sources

Singapore Gallery integration still needs some debugging as this required some changes to the Singapore gallery software.

I think that the addition of the customphp capability would greatly round out DokuWiki's capabilities and provide a very simple plugin capability. I can image how other alternate functionality could be easily added using this mechanism; like an inline 'Reply' textarea to post additional content to a page in a 'forum/discussion' style, but keeping the simplicity of plain-text robustness that we all love about dokuwiki.

::sparkline-line>4,2,2,5,2,12,4,3,4:: → inline Sparkline

::gallery>wiki:discussion:customphp:: → inline image gallery

::form>post-reply:: → inline reply form/textarea

mailto:sunny [at] poeticpublishing [dot] com

Discussion

This Patch uses an outdated version of DokuWiki (with the old parser). It's functionality would be much better integrated by using the plugin API. — Andreas Gohr 2005-06-13 09:12

 
wiki/discussion/customphp.txt · Last modified: 2006/11/13 14:48 by andi
 
Imprint Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate