The users of my wiki _really_ want this.
The idea is to allow images to be placed in the wiki.
The easy way for the admin is clear: provide a cgi
that dumps the images to a directory accessible from
the web, and have your users link to the images, like:
"my image" http://foo.bar.baz/images/foo.png
But I think it should be made easier. There are a
couple of ways this could be solved, here are a few ideas:
- Minimalistic idea: images get a title just like any
page's, and when used, the link takes to the image (or
to a page containing the image). I imagine this should
be fairly easy to do.
- Special link: Provide a image link delimeter (say,
the pipe symbol, since that seems to be used for some
images already), so that images can be rendered inline.
Like, e.g., |carrot|, except with user-supplied images.
- Special view of some directory / set of directories
(i.e., no links to images from the rest of the wiki
allowed). I considered doing this, but I think people
will want more.
All three ideas would require a cgi to allow users to
upload the images to the server, sanitize the image
file names, and maybe make some checks to make sure
it's an image. Not rocket science, but it would have
to have the same look and feel as the rest of the site.
Logged In: NO
FWIW, I worked on this last weekend, and got something
working. It's not as clean as I'd like, but it works.
I did the following:
* Added some variables in the cf file for the graphics
directory as seen from the perl script (as opposed to from
the web).
* Made an html form that has a file upload box, as well as a
textbox for setting the image name.
* Implemented a new command in chiq.pl that handles the
form. Sanitizes the name, etc, etc, and copies it to the
graphics dir.
* In the startup routine of chiq.pl, it now looks in the
graphics dir and registers all the images as emoticons.
So now images can be embedded just by writing their name
inside pipe symbols, like named emoticons. i.e., |like_this|.
Problems with my implementation:
* I use the 'file' command, which is probably not portable
outside unix-ish platforms.
* It does feel kind of.. wrong.. to put all the images in
the emoticons db. otoh, emoticons are just a subset of all
user-embedded images.
I'll send you guys a patch once I clean things up a bit.
Cheers,
-Dan