Simple Picture Gallery
From time to time I shoot some pictures. Holidays, rowing events the usual snapshot stuff, no world press photo for me. Still I want to show them to the world
There are a lot of fancy gallery programs. There is another cookbook about integration of one of them into pmwiki. This one is very K.I.S.S.. It uses the wiki itself for comments. And it allows hosting the image files on a different host as the wiki. (This is the main reason why I ever bothered about writing my own gallery-script)
I would like to share the bits of code although it is quite ugly. Comments for improvements are welcome I will try to tidy the code.
- Download the file simplegallery.phpΔ and add it to the (farm)config.php
- The image files are uploaded using ftp to a server somewhere.
- Create a configuration-page e.q. GalleryName/Config.. See the parameters section below
- Add a list of images
- image1.jpg:some fancy description
- Create a GalleryName/HomePage
- Create a groupheader GalleryName/GroupHeader, add
- Consider protecting the GalleryName/Config and GalleryName/GroupHeader for writing.
- After saving the header page the gallery should show up.
Each image will show on a single page, users can edit this page to add comments. Since the Gallery directive is in the groupheader there is no need to create every single page in advance. Pages that do not match a image file name will show the thumbnail index.
Each on a line, using a bullet * makes reading easier
some fancy name for your gallery.
- Full URL to the location of the files e.q.
No default value
maximum numbers of columns on a page.
There is no control to limit the number of rows, simply create two galleries to split a large amount of pictures
Prefix for the thumb files. Can be a directory or filename.
Width of the thumbnails
Height of the thumbnails
Number of Thumbnails per page
- You could write the Configurations into a different group
Then in GalleryName1/GroupHeader(:Gallery Galleries.GalleryName1:)
- Use Location:Attach: and something like Thumb:tn_, to upload files and thumbnailes
- Use Thumb: to use the big files as thumbnailes. The css will crunch them but users still download the large files.
- Use (:nogroupheader:) to disable the display of the index on selected pages.
- Instead of GroupHeader GroupFooter can be used as well of course.
- There is no need for the image files to be on the same server as pmwiki. I use free hosts for the files.
- All files for a gallery must be in a single directory.
- Thumbnails must be pre-generated.
- Image names must differ case-insensitive, thus foo.jpg and Foo.jpg are not allowed together in one gallery.
- Image names must differ on character and numbers, thus foo_bar.jpg and foobar.jpg are not allowed together in one gallery.
- Image names my not match the DefaultName ( HomePage on a default installation)
- Only jpg supported.
- Partial image name matching is not handled well: image names foo.jpg and foobar.jpg will create chaos.
Using the Attach: Location
Using a remote Location
- This is a horribly written recipe... imposible to follow. Please consider revising!
- Sorry, but i understand nothing! Can you give an example from the pages please. Thanks
Where does the confusion start? Above are some links with examples, including the syntax. Feel free to email me, my cloacked address is at the bottom of the example pages ( Contact )
This would be sweet if the script could automatically generate the wikitext list of images - all the user would have to do is upload files and describe them. - Sproaticus September 13, 2005, at 12:11 PM
- SimpleGallery could be used with folders created with any script gallery and I would like to use different galleries whitch use themselves differents thumbs extension (_ThumB_, th, thumb, etc.)
So It would be fine to have in the SimpleGallery config. Any body an idea of how to do this? thanks ed