Not logged in. · Lost password · Register
Forum: General Help and Support Development RSS
Access media in plugin
Avatar
agc #1
Member for 2 weeks · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Access media in plugin
Hello DokuWiki Developers,

in my Wiki many code files are uploaded and I would like to create a plugin that has the same function as the "head" command in Linux, simply displaying the first few lines of each file. I could not find a reference to an inbuild function in the documentation, which resolves the media identifiers (the name with the colons ":") to a path, which I could then read in a PHP-Script. I'm imagining something like

$path=resolve_identifier(":test.txt");
$handle=fopen($path,"r");

Does a function like this exists? And if not, would simply replacing the colons with slashes and adding data/media in front be a sufficient solution (or are there additional deviations from the file name in the identifier)?

Thanks a lot.
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4399 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
I think you are looking for wikiFN
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
schplurtz (Moderator) #3
Member since Nov 2009 · 310 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Is it not rather mediaFN for media files ?
http://schplurtz.free.fr/wiki/
Avatar
turnermm (Moderator) #4
Member since Oct 2009 · 4399 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
I puzzled over what he meant by "media",  but his example ":text.txt" suggests that he simply wants document pages and not media.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
schplurtz (Moderator) #5
Member since Nov 2009 · 310 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Yes. I too was surprised by the example. Well, now OP can choose ;-)
http://schplurtz.free.fr/wiki/
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-12-14, 04:33:38 (UTC +01:00)