Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

ImageSets

Summary: Create galleries that are not tied to a single wiki page
Version: 0.2
Prerequisites:
Status:
Maintainer:
Categories: Images

Question

Can I create galleries that are not tied to a single wiki page (ie. the same gallery can be accessed from multiple pages), and also have more than one gallery per page?

Answer

ImageSets are a gallery system I made up because of my frustration with existing galleries. This page is my first module for pmwiki, so be gentle. It may have insecurities and may not comply 100% with the pmwiki conventions, I am working on this and would appreciate comments and suggestions to chojin at internode.on.net.

Notes and Comments

Current Version: 0.2

Instructions

Download imgset.phpΔ and copy it to cookbook/imgset.php

Add the following link into your config.php:

include_once("cookbook/imgset.php");

You may want to enable uploads and create a directory called /ImageSets/ inside your uploads directory, but the script *should* do this for you (this worked for me and I didn't need to create them, but if it doesn't, create them manually and chmod them to 777).

This recipe bypasses the standard upload form and creates its own. This is because I found the original confusing and inefficient for grouping images together. To create a page, simply create a tag of (:imgset name:) where name is the name of your gallery (this can be anything). Then click 'Edit ImageSet' and upload as many images as you like. In this edit page you can also delete images. To create more than one gallery, simple create more than one tag in a page. To link to the one gallery, just create the tag again with the same name on other pages.

The images are stored in /Uploads/ImageSets/Name/ where Uploads is your upload dir, and Name is the name of the gallery.

The script might also help those wanting to create their own cookbook recipies, as I tried to comment as much as I could, I found the existing documentation to be pretty vague, especially when overwriting existing functionality such as the edit page.

  • This recipe was last tested on PmWiki version: 2.0.beta54
  • This recipe requires at least PmWiki version: 2.0

Screenshots

Step 1: Create the tags in your page (these galleries were made using (:imgset SetOne:) and (:imgset SetTwo:)).

Step 2: Click the EditImageSet link in the pic above and upload images.

Step 3: Main Page automatically creates thumbs and links to the larger image.

ToDo

  • Add description tags, pretty up the code and visual style.

Contributors

Rob Saunders (chojin at internode.on.net)


Profiles January 21, 2005, at 20:13
copy() should be replaced with move_uploaded_file(). But -> next problem: wrong pathes are in the html code...

Profiles October 25, 2005, at 05:55 AM
Screenshots say this is what I am looking for!
But there are some strange things: Instead of the ImgSets/ folder the ImageSets/ was created
Working in the WikiSandbox I chose some .gif-s and .jpg-s, clicked Upload and wanted to enjoy my new gallery. But no pictures on the page. I checked the created folders and they are empty.
Then I copied some pictures directly to the folder Uploads/ImageSets/Try but the page Main.WikiSandbox where I have put (:imgset Try:) is empty.
Any idea where I am wrong?
(Windows XP P, Abyss web server, PHP5, PmWiki 2.0.11)
Jiri

Hi Jiri. The directory name is indeed ImageSets not ImgSets, probably just a typo. I changed it.
Just copying images to the directory doesn't work. The script relies on the presence of the generated thumbnails.
Without more details I can't see why uploading images didn't work for you. It worked for me. ;-) Do you have your WikiSandbox online?
--Su2, 19.11.2005
Jiri, could it be a thumbnailing issue? The script uses bilinear resizes, which only work on newer GD libraries.
Is your PHP install fairly recent? The other issue could be a permissions thing. Try chmodding your ImageSets directory
Or allowing the script to create the directories itself (which will automatically chmod them). The next version
will have more descriptive error messages and possibly a workaround for the GD issue above.
--Rob, 21.11.2005

Profiles February 15, 2005, at 22:09
The script doesn't upload images when register_globals = off


22 March 2006 SAFE MODE restriction in effect?!?!

i can upload the files no problem, but when it comes to deleteing it throws up user id #### cant access owner ##### also the file size has a similar problem.

stealth at fireflyuk dot net


I've added some code to this script so it will auto create the thumb images so you can just FTP your image files all at once to a imgset directory. Remember to chmod your new imgset directories. Just copy in the new file and upload your images. The first time you view the imgset page it will auto generate the tumb files. If you have a lot of images in one directory you may need to hit refresh a couple times due to timeouts.

Download imgsetAutoThumbΔ and copy it to cookbook/imgset.php


Jiri May 25, 2006, at 05:19 AM
I FTPed some pictures and this warnings appeared. I did chmod 777 for the directory, subdirs and files, but still all the same.
After the warnings the page was rendered but instead thumbs only placeholders could be seen. Try it at http://www.obutex.com/crm/index.php/Test/Test , please. What should I do ?

Warning: imagejpeg(): SAFE MODE Restriction in effect. The script whose uid is 12251 is not allowed to access /www/o/obutex/public_html/crm/uploads/ImageSets/Test owned by uid 33 in /www/o/obutex/public_html/crm/cookbook/imgset.php on line 343
Warning: imagejpeg(): Invalid filename in /www/o/obutex/public_html/crm/cookbook/imgset.php on line 343

This does not seem to allow groups. I noticed index.php?n=$pagename?... is hard coded in, which wont work for groups. -mason

Edit - History - Print - Recent Changes - Search
Page last modified on March 21, 2007, at 09:23 AM