OBSOLETE: PicLens Lite
This module will be removed when a new version of the img package (pointing to the Piclens module) will be released.
Gallery can optionally use a Flash and JavaScript based slideshow from PicLens to provide users with the best possible viewing experience. (Gallery2)
This module has no an user interface, but other modules can use it. See the img package.
How to?
1) define the hook_media_rss() to declare media items for a piclens slideshow
Example:
<?php
function img_comments_media_rss(&$node) {
global $img_comments_thumbnail_size;
img_comments_custom_boot();
$num = 0;
$items = array();
$query = '
SELECT
c.cid,
ic.filepath,
ic.filetitle,
ic.filemime
FROM
{comments} c
JOIN {img_comments} ic
ON (c.cid = ic.cid)
WHERE
c.nid = %d
';
$result = db_query($query, $node->nid);
while($file = db_fetch_object($result)) {
$comment = array('cid' => $file->cid);
if($sizes = image_get_info($file->filepath)) {
$thumbnail_url = img_comments_create_thumbnail($comment, $file);
if($thumbnail_sizes = image_get_info(img_comments_thumbnail_path($comment, $file))) {
$items[$num]['description'] = $file->filetitle;
$items[$num]['link'] = file_create_url($file->filepath);
$items[$num]['thumbnail']['url'] = $thumbnail_url;
$items[$num]['thumbnail']['height'] = $thumbnail_sizes['height'];
$items[$num]['thumbnail']['width'] = $thumbnail_sizes['width'];
$items[$num]['content']['url'] = file_create_url($file->filepath);
$items[$num]['content']['height'] = $sizes['height'];
$items[$num]['content']['width'] = $sizes['width'];
$num++;
}
}
}
$return['img_comments'] = $items;
return $return;
}
?>2) optionally call the piclens_lite_media_link() function to display a link to the 'piclens lite' slideshow
Example:
<?php
module_invoke('piclens_lite', 'media_link', $node, $img_comments); // $img_comments is a thumbnail
?>That's all.
