Allows Gallery 3 photo images or photo or album fields to be embedded in external sites based on the item id. Using the item id allows items to be moved to different albums without breaking links to the item.
Unpack contents into modules folder. Rename the folder embeditem. Activate the module: Login -> Admin -> Modules. Check the box next to the module Embed Item. Click 'update' at the bottom of the page.
http://EXAMPLE.com/gallery3/index.php/embeditem/type/argument/item_id
item_id is the id number of the photo or album.
type
Album or Photo fields:
http://EXAMPLE.com/gallery3/index.php/embeditem/field/title/10
Where title is the field name and 10 is the item id number. This will return the title of item 10.
Album or Photo images:
http://EXAMPLE.com/gallery3/index.php/embeditem/image/thumb/10
Where thumb is the image size and 10 is the item id number. This will return the thumbnail image of item 10.
Album or Photo image urls:
http://EXAMPLE.com/gallery3/index.php/embeditem/imageurl/resize/10
Where resize is the image size and 10 is the item id number. This will return the url of the resized image of item 10.
To embed an item image on a page of an external website add the following code to the page:
For HTML
<img src="http://example.com/gallery3/embeditem/image/resize/10">
For PHP
<?php $value = file_get_contents("http://example.com/gallery3/embeditem/imageurl/resize/10"); print '<img src="' . $value . '" />'; ?>
Discussion about this module, including bugs and feature requests, can be found on the forums at http://galleryproject.org/node/101254
To find the item id number, users with proper permissions can access the context menu for the photo or album and find the item id number in the links of the menu items.
Example: Photo context menu item "Edit this photo" links to http://example.com/gallery/quick/form_edit/5?from_id=2 where 5 is the item id number.
For the more adventurous, your Gallery theme can be modified to display the item id. I include the item id in the <img> title attribute of the image thumbnail for users with edit permission so that the item id appears when they hover over the thumbnail.
version 1.0