The blog's left hand column…
… now includes the latest images that I've uploaded to the site.
While one thinks of SlideShowPro as a Flash component, their SlideShowPro Director manages your web site's content and serves up different sizes of images to both Flash and regular HTML pages. Here I'm using a few features in conjunction:
- The Lightroom-Director export plug-in makes it easy to upload 2000-pixel JPEGs directly from Lightroom
- I've a smart album in Director which automatically displays new pictures in the New Photos page's Flash movie
- My Flash site also shows the pictures at the size it needs, so it'll be easy to maintain both Flash and more Google-friendly HTML content
- Here on the blog page I'm using the Director API to show images at 150 pixels wide (follow the more link for my commented code) - Director generates all these different sizes as required
While the long-fabled Flash site is moving forward again, its continually being almost-ready has had a pretty-constipating effect on the old-style photo galleries. So I've now begun replacing them with Director-driven galleries which means a load of newer images are now in the American Civil War, the Napoleonic era, the 20th century, and some such as this one of Hastings 1066 in the Medieval gallery. Time travel beckons….
This is PHP5:
include('../flash/flash_ssp_director_api/classes/DirectorPHP.php');
$director = new Director('key', 'director url');
$format = array(
'name' => 'thumb',
'width' => '150',
'height' => '150',
'crop' => 0,
'quality' => 75,
'sharpening' => 1
);
$director->format->add($format);
$album = $director->album->get(29);
$contents = $album->contents[0];
$i = 0;
//create an array to hold the latest images
$ssp_latest_imgs = array();
foreach($contents as $content) {
if ($i <=
{
$caption = "Recently uploaded : " . str_replace ("+", " ", $content->iptc->caption);
$caption = str_replace ("%2C", ",", $caption);
$imgcode = '
';
//add the current image and HTML to the array
$ssp_latest_imgs[$i] = $imgcode ;
}
$i = $i + 1 ;
}
//now display an image - in this case the first one
echo $ssp_latest_imgs[0];
//now display an image - in this case the sixth one
echo $ssp_latest_imgs[5];
Comments
Leave a comment