(Im)Personal Old Stuff

Blog Administration

The requested page could not be found (404). This is the default page.

Rob A's (Im)personal Blog :: Gallery Image Plugin

I prefer to use Gallery (version 1.x) for managing my images. I've even set it up so that the gallery is embedded in my Serendipity template. One thing that was not nice, however, was using those images within blog entries.

I did a quick search and discovered a WordPress plugin[?] called WP-Gallery by Geoff Hutchison. His code was a starting point for the Serendipity plugin I put together.

Using the plugin is simple. Just install in the usual fashion, and configure the album URL and gallery URL. These must be full URLs (start with http://) and MUST NOT HAVE A TRAILING BACKSLASH, and will depend on where you installed Gallery.

For example, my configuration has URL of Gallery set to http://www.silent9.com/gallery and URL of the Gallery album directory set to http://www.silent9.com/albums

There is also a new option to specify the maximum window size when using the image popup target, which defaults to 640pixels

The basic usage of the markup plugin is [GImage]album/image.ext[/GImage] with the .ext optional unless the image is something other than the default .jpg.

An example of this basic usage:

[GImage]summer05trip/IMG_0542[/GImage] shows up as $this->gimage_thumb('summer05trip/IMG_0542', trim('')).

This is using the defaults, use the thumbnail, format it as a link, no alignment, and make the link point to the gallery page of that image.

Parameters

These parameters can be in any order and must be separated by semicolons ";"

size=sized|full|thumbwill use the gallery medium sized image in the body, full will use the full size image, thumb is the default thumbnail

[GImagesize=sized]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('size=sized'))

There is no example for full here cause my full sized images are all pretty big.

link=image|album|page will set the target link as the raw image, page (default) in the gallery for the image, or the whole album in the gallery. hover the mouse over to see the differences in the links. Note that I am currently running the Lightbox+ plugin at this site, which will cause any links to images to open using that method, rather than the default, bare image in a window.

[GImage link=image]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('link=image'))

[GImage link=album]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('link=album'))

align=left|center|right|none will set the alignment. Note none and center are equivalent if using the fancy style.

[GImage align=left]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('align=left'))This should be left aligned

[GImage align=right]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('align=right'))This image should be right aligned

[GImage align=center]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('align=center'))

caption=text string will be the ALT tag for images and links, or caption text if fancy style is used. the default is "[PHOTO]" if none supplied.

style=link|fancy|image defines the formating link (default) is the standard link, image displays it as an inline image, and fancy formats it using the Serendipity image manager css class of the current theme. An example of fancy is just above, so no need to repeat it here.

[GImage style=image]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('style=image'))

New for version 1.1 is the ability to specify a link target:target=new|popup|default where new is open in a new window, popup is a javascript popup window and default is the default, or current window. Note that popup can only be used in conjunction with link=image and if popup is specified for any other link type, it wil revert to default.

[GImage style=fancy;target=new]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('style=fancy;target=new')) should open the image page in gallery in a new window.

[GImage link=image;target=popup]summer05trip/IMG_0542[/GImage]

$this->gimage_thumb('summer05trip/IMG_0542', trim('link=image;target=popup')) should open the image in a popup window.

And these can be combined in any reasonable permutation...

For example, If I want to use the resized image in a blog posting, fancy format and linking to the full size image in a popup window I would use: