Serendipity ImageSelectorPlus Plugin Documentation
General description
ImageSelectorPlus plugin is used to facilitate manipulation with images, especially their insertion into posts.
QuickBlog
When uploading an image, you can post it directly. Follow the instructions above the QuickBlog form.
Modifying the design of QuickBlog post
Plugin uses template file "plugin_quickblog.tpl" to display the inserted pictures. So by modifying it, you can change the design of displayed images.
Information about pictures is stored in an array {$quickblog} which has several parts you can use in your template:
- fullimage - path and filename to the big image
- image - path and filename to the thumbnail
- body - the body of the post
- exif_mode - type of exif information extraction ('internal', 'jhead', 'none'
- exif - field of exif information, pleasu use the exif specifications to see the field values - use them like eq. $quickblog.exif.COMMENT or $quickblog.exif.Focal_length
Multiple image insertions
Another functionality of this plugin is multiple image insertion. If you write an xml structure in your entry, this plugin then replaces this xml structure by pictures from your media library.
When is it useful?
When you write a blog, where you want to include many pictures in your entries. When you have fifty images and these images numbered in an ascending row, it is lengthy to insert them one by one through the images selector. With this plugin, you can insert all of them using on a single line.
Examples
Example 1 - including parts of gallery
<mediainsert>
<gallery name="MyHolidays/" />
<media type="single" name="pict0034" />
<media type="single" name="pict0032" />
<media type="range" prefix="pict00" start="35" stop="52" />
</mediainsert>
This example inserts from the directory "MyHolidays" picture "pict0034", then picture "pict0032" and then all pictures from "pict0035" to "pict0052".
Plugin features:
- It shows only picturse which are in the database. So if pictures 44,45,48 and 50 does not exist, the plugin will not fail. Simply it will not display the non-existing pictures.
- It respects order of pictures, so 34 will be displayed before 32.
Example 2 - including whole gallery at once
<mediainsert>
<gallery name="MyHolidays/" />
<media type="gallery" />
</mediainsert>
Important
The plugin is sensitive to bad xml syntax. So if it is not perfect, for example if you ommit ending backslash in the media tag, it can cause fail to your whole blog!!!
Review of xml tags
- <mediainsert>
- general container of media insertion
- <gallery>
- from which gallery to choose the images, attribute name gives the path (prom the directory uploads/ - without the first backslash and WITH the final backslash - "MyHolidays" or "/MyHolidays/" is false. Right is "MyHolidays/".)
- <media>
- Defines which media to insert, first attribute is "type" and it can have next values:
- "single" - includes single image given by attribute "name"
- "gallery" - without other attributes, includes all images in gallery
- "range" - includes numbered images from "prefix""start" to "prefix""stop" (see example1)
Modifying the design of inserted galleries
Plugin uses template file "plugin_mediainsert.tpl" to display the inserted pictures. So by modifying it, you can change the design of displayed images.
Information about pictures is stored in an array {$plugin_mediainsert_media} which has these parts you can use in your template:
- name - name of picture (filename without extension)
- extension - extension of filename
- realname - filename, the same as {$name}.{$extension}
- thumbnail_name - you can get the thumbnail name by {$name}.{$thumbnail_name}.{$extension}
- path - the same value as you provide in gallery tag
- comment1 - comment from database
- width - width of original image
- height - height of original image
- thumbwidth - width of thumbnail
- thumbheight - height of thumbnail
Unzipping ZIP archives
What it is good for
Typically when you want to upload many pictures at once. You need not to select every image discinctly. Just pack them in the ZIP archive, upload this archive and it will be unzipped on your blog.
Features of unzipping
- Files from archive are unzipped into the same directory, where the archive is uploaded.
- Unzipped files (not necessarily images) will be inserted in the media database.
- When selecting "Edit properties", unzipped images will be displayed.
- Do not make zip files with subdirectories. I didn't tested it, but I am afraid it will not unzip the directories, it will put all files in the target directory.
- Take into account the size of the archive. You have some limitations on maximal upload file size (typically 10MB).
Authors
Garvin Hicking, Germany
VladimĂr Ajgl (vlada [at] ajgl [dot] cz), Czech Republic, 2007-11-19