function photo_light_slide_thumb($entity, $entity_id)
{
    use_helper('Lightbox');
    //require_once('../model/sfPhotoGalleryPeer.php');
    // Recupera l'array delle foto
    $images_raw = sfPhotoGalleryPeer::getLightboxArray($entity, $entity_id);
    if (count($images_raw) > 0) {
        // TODO AGGIUNGERE IL THUMB
        foreach ($images_raw as $image_raw) {
            $image = array();
            $image['image'] = image_path('/' . sfConfig::get('sf_upload_dir_name') . '/photos/' . $image_raw['real_name']);
            $image['thumbnail'] = image_path('/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/' . $image_raw['real_name']);
            $image['options'] = $image_raw['options'];
            $images[] = $image;
        }
        $link_opt = array('title' => $entity, 'slidename' => $entity . '_' . $entity_id);
        return light_slide_image($images[0]['thumbnail'], $images, $link_opt);
    }
    return '';
}
Exemple #2
0
$images[] = array('thumbnail' => 'http://www.huddletogether.com/projects/lightbox2/images/thumb-6.jpg', 'image' => 'http://www.huddletogether.com/projects/lightbox2/images/image-6.jpg', 'options' => array('title' => 'Press Esc to close'));
$link_options = array('title' => 'Lightbox2', 'slidename' => 'lightbox');
echo light_slideshow($images, $link_options);
?>

<br/><br/>
<h2>&nbsp;&nbsp;&raquo; For all images of the set as an html list</h2>

<ul>
<?php 
$link_options = array('title' => 'Lightbox2-list', 'slidename' => 'lightbox_list');
echo light_slideshow($images, $link_options, true);
?>
</ul>

<br/><br/>
<br/>
<h2>&nbsp;&nbsp;&raquo; On one image (of the set or not)</h2>

<?php 
$link_options = array('title' => 'Lightbox2-image', 'slidename' => 'image_link_to_lightbox_slideshow');
echo light_slide_image('http://gallery.coilblog.com/d/16-2/big_eyes_cat.jpg', $images, $link_options);
?>

<br/><br/>
<br/>
<h2>&nbsp;&nbsp;&raquo; On a text link</h2>

<?php 
$link_options = array('title' => 'Lightbox2-tewt', 'slidename' => 'text_link_to_lightbox_slideshow');
echo light_slide_text('Click me to show the slide !!', $images, $link_options);