function lw_gallery($images, $gallery_name, $options = array()) { _lwAddResources(); $options = _parse_attributes($options); $html = ''; if (isset($options['hide'])) { $make_hidden = (bool) $options['hide']; unset($options['hide']); } else { $make_hidden = true; } $start_hiding = false; foreach ($images as $image) { $image_options = isset($image['options']) ? _parse_attributes($image['options']) : array(); $image_options['rel'] = $gallery_name; foreach ($options as $k => $v) { if (!isset($image_options[$k])) { $image_options[$k] = $v; } } if ($make_hidden && $start_hiding) { $image_options['class'] = 'lightwindow_hidden'; } $html .= lw_image($image['link'], $image['src'], $image_options) . "\n"; $start_hiding = true; } return $html; }
</p> <h2>Images <span>Singles or Gallery Sets!</span></h2> <p> <?php echo lw_image('<strong>Textual Link</strong> Links can be text or images...', '/sfLightWindowPlugin/gallery/image-5.jpg', array('class' => 'page-options', 'title' => 'What is this plant?', 'author' => 'Unknown', 'caption' => 'Whatever it is, it is still a pretty cool picture. Whatever it is, it is still a pretty cool picture. Whatever it is, it is still a pretty cool picture. Whatever it is, it is still a pretty cool picture.')); ?> <?php echo lw_image(image_tag('/sfLightWindowPlugin/gallery/stereo_banner_thumb.png'), '/sfLightWindowPlugin/gallery/stereo_logo.png', 'class=page-options title=Stereo Interactive & Design'); ?> <?php echo lw_image('<strong><span style="color: red;">NEW</span> External Image</strong> - An Image pulled from an External Source', 'http://farm1.static.flickr.com/180/439443686_bc797081ea.jpg', array('class' => 'page-options', 'title' => "Bob, Donna and my son Kote", 'author' => "My Wife", 'caption' => "Three of some of the most important people in my life.")); ?> <?php $images = array(); $images[] = array('link' => '<strong>Image Gallery</strong> - Everyone needs a killer gallery!', 'src' => '/sfLightWindowPlugin/gallery/0.jpg', 'options' => array('class' => 'page-options', 'title' => 'High 5 Dood!', 'caption' => 'Snow people know how to have fun...')); $images[] = array('link' => 'image #1', 'src' => '/sfLightWindowPlugin/gallery/1.jpg', 'options' => array('title' => 'Snow People Playing Football', 'caption' => "Please don't kick me!")); $images[] = array('link' => 'Header #3', 'src' => '/sfLightWindowPlugin/gallery/header3.swf?scale=noscale&tag1=Sooth Your Mind & Body&tag2=Justice Through Integrity&tag3=Helping Injured Victims&tag4=Experience You Can Trust', 'options' => array('width' => '769', 'height' => '209', 'title' => "Oh My! Flash and Images Mixed!", 'author' => false, 'caption' => false)); $gallery_options = array('hide' => true, 'title' => 'default title', 'caption' => 'default caption', 'author' => 'Unknown'); echo lw_gallery($images, 'Random[Sample Images]', $gallery_options); ?> <?php $images = array(); $images[] = array('link' => "<strong>Image Gallery w/Multiple Images</strong> - Side by Sides can be good for Before and After Gallery's or to show actions, etc.!", 'src' => '/sfLightWindowPlugin/gallery/0-evolution.jpg', 'options' => array('class' => 'page-options', 'title' => "The Evolution of Man is looking grim...", 'caption' => "Man starts out kinda hairy...", 'author' => "Unknown", 'show_images' => 2)); // add other images to the array automatically...