This plugin shows a list of media files for a given wikipage which are either linked in the page itself or belong to its namespace. If there is no media directory named like the page the plugin looks for media in the next upper namespace
Compatible with DokuWiki
> 2009-02-14, 2008-05-05
This plugin shows a list of media files for a given wikipage which are either linked in the page itself or belong to its namespace. If there is no media directory named like the page the plugin looks for media in the next upper namespace
Similar to filelist
If you're looking for a really versatile/flexible solution for listing media files I suggest you give the filelist plugin a try!
Actually the filelist-plugin currently does not work with Rincewind. Medialist seems to be the only working alternative (if you use the patch below)
| Download | plugin-medialist.tgz |
|---|---|
| Github URL | http://github.com/chimeric/dokuwiki-plugin-medialist |
This plugin shows a list of media files for a given wikipage which are either linked in the page itself or belong to its namespace. If there is no media directory named like the page the plugin looks for media in the next upper namespace. Note, the plugin is aware of your ACLs.
Because the plugin parses the page instructions of the wikipage you`ll see the correct output not in the preview but after the page is saved!
Download the archive and unpack it into <dokuwiki>/lib/plugins.
The plugin is also available via git.
% cd <dokuwiki>/lib/plugins % git clone git://github.com/chimeric/dokuwiki-plugin-medialist.git medialist
To list the media files linked in the given page use:
{{medialist>wikipage}}
To list the media files linked in the current page use:
{{medialist>@PAGE@}}
To list the media files contained in the current namespace use:
{{medialist>@NAMESPACE@}}
To list both, media files linked in the current page and contained in the current namespace use:
{{medialist>@ALL@}}
A complete changelog is available here.
Please report bugs and feature requests at the bug tracker.
Thanks for good plugin. But It doesn't work with @PAGE@. so I patched the code below.
syntax.php line 172
if(($mode == 'page') or ($mode == 'all')) { // check permissions for the page if(auth_quickaclcheck($id) >= AUTH_READ) { // get the instructions $ins = p_cached_instructions(wikiFN($id),true,$id); // get linked media files foreach($ins as $node) { if($node[0] == 'internalmedia') { array_push($linked_media,$node[1][0]); } elseif($node[0] == 'externalmedia') { array_push($linked_media,$node[1][0]); } } } } ... // remove unique items $media = array_unique(array_merge($linked_media,$intern_media));
if($mode == 'all') { $dir = utf8_encode('/'); } elseif ($mode == 'page') { $dir = utf8_encode(str_replace(':','/', $id)); } else { // $mode == 'ns' $dir = utf8_encode(str_replace(':','/', getNS($id))); } // check permissions for the page if(@is_dir($conf['mediadir'] . '/' . $dir)) { if(auth_quickaclcheck($dir) >= AUTH_READ) { // get mediafiles of current namespace $res = array(); // search result require_once(DOKU_INC.'inc/search.php'); search($res,$conf['mediadir'],'search_media',array(),$dir); foreach($res as $item) { array_push($intern_media,$item['id']); } } } // remove unique items $media = array_unique(array_merge($linked_media,$intern_media));
— Kim.Jun-Gi 2011/02/22