I'm writing an image gallery recipe.

Part of what it does is reads an existing wiki pages and isolates any lines that contain "Attach:".

Once the lines are isolated, it extracts the file name by taking everything after Attach: but before .jpg to determine the path of the file.

*The problem *is that if a user has changed the default value of $UploadPrefixFmt to use slashes instead of dots (for example), or the user has enabled Per Page attachments instead of Group attachments, the script breaks.

I need a way to determine the upload path (or URL) to the image when given nothing more than what is on the wiki page (Eg. Attach: Group/Name/File.jpg)

Another problem which I foresee happening is what if a user specifed Attach:File.jpg without specifying the Group or Page name where the image is to be stored? That's another problem, but I haven't got to that bridge yet.

I suspect I need to use the FmtPageName or some similar function, but I'm not really sure.

Thanks in advance!

S Leite
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to