Inserts a non PNG or otherwise modified SVG file, just its clean version. Plugin should work - mostly tested on SVGs from http://www.openclipart.org/ and Inkscape output. Any comments - place for them below.
Compatible with DokuWiki
DokuWiki-2007-06-26b
Inserts a non PNG or otherwise modified SVG file, just its clean version. Plugin should work - mostly tested on SVGs from http://www.openclipart.org/ and Inkscape output. Any comments - place for them below.
Plugin name contains underscore, will not generate popularity points.
Here you can download plugin (supports remote installation): svgpureinsert.zip or in this post at the DokuWiki-forum.
Do normal remote installation (ctrl+c → ctrl+v upper link in admin/manage plugins section of your DokuWiki)
Or manually after downloading plugin extract it and copy all the files to your DokuWiki /lib/plugins/ folder.
To enable the “media” support edit or create conf/mime.local.conf and add at the bottom entry: SVG image/svg+xml
If you want to disable cache for SVG files edit lib/plugins/svgpureInsert/svgpureInsert.php:
Caching is enabled by default:
My intention was to create plugin which enables using built-in SVG images visualization engine in Firefox, Opera browsers. I just didn't want to have PNG's or JPG's - I love vector graphics ;)
Thanks to Konstantin for sharing better code. Open Source rox!
I tried your plugin and found what follows:
define('SVG_ROOT_PATH', '../../../'); fails on my install (Centos5.6). The value from $conf['savedir'] (stripped of the final data/) should be used insteadCheers, Alessandro Forghieri (alf at orion dot it ).
Err404:
your plugin is conflict with another svg plugin: svg
but i want use theses two plugin, one to insert SVG file image (your plugin), and second to insert SVG code in source page (another plugin).
I think is a conflict name.
I propose you to rename svg folder to svgfile
Re: Error404 Lechup
thanks, there is new name, just uninstall old plugin and install new one please
Media Support?
To enable the “media” support and not lose it on the next upgrade, edit (or create) conf/mime.local.conf and add at the bottom entry: SVG image/svg+xml
Sadly, the plugin can not recognize chinese namespace, and can not find the svg file…
thx for the plugin, but if I want to use the plugin with the standard advanced image syntax like:
{{wiki:dokuwiki-128.png?linkonly}}
it's not work. It is possible to include this option in the plugin to create a svg-file link?
Great plugin! SVGs from other sites worked great, but I couldn't get it to display an internal SVG. It turns out that there was a extra '/' in the path. Here is a patch that fixes this:
diff -u svgpureInsert/syntax.php svgpureInsert_new/syntax.php --- svgpureInsert/syntax.php 2009-03-27 15:21:12.000000000 -0700 +++ svgpureInsert_new/syntax.php 2010-06-23 10:16:30.000000000 -0700 @@ -59,7 +59,7 @@ //src $GLOBALS['data_svgpureInsert']['src'] = $p_match[2]; if(strpos($GLOBALS['data_svgpureInsert']['src'], "http://")===false && strpos($GLOBALS['data_svgpureInsert']['src'], "ftp://")===false) - $GLOBALS['data_svgpureInsert']['src'] = 'data/media/'.str_replace(':', '/', $GLOBALS['data_svgpureInsert']['src']); + $GLOBALS['data_svgpureInsert']['src'] = 'data/media'.str_replace(':', '/', $GLOBALS['data_svgpureInsert']['src']); $GLOBALS['data_svgpureInsert']['src'] = urlencode($GLOBALS['data_svgpureInsert']['src'].'.svg'); // }
–Andy
besides the bug mentioned above by Andy, the whole thing does not work if the data path (“savedir”) is changed in the dokuwiki config. That variable should be used instead of the hardcoded path.
–Sebastian