Topic: php dynamic?

Is it possible to make the PostcardViewer dynamic?

If an image is added to the image folder can it automatically be added to the gallery using php?

Is it possible? Has anyone done this?

Re: php dynamic?

Hi JMX Id also be interested in seeing if this is possible.

I would be willing to do away with the tags/ text if the script could search a folder
and generate image thumbnails automatically...

Re: php dynamic?

Yes, it is possible to use php to dynamically create a PostcardViewer album.
Put the following code in a file named 'gallery.php':

function GetDirArray($folder)
    while ($file=readdir($handle))
        if ($file!="." && $file!="..")
    return $ret;
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<gallery cellDimension="800" columns="5" zoomOutPerc="15" zoomInPerc="100" frameWidth="20" frameColor="0xFFFFFF" captionColor="0xFFFFFF" enableRightClickOpen="true">';
for ($i=0; $i<sizeof($gallery); $i++)
    echo '<image><name>images/'.$gallery[$i].'</name><caption></caption></image>';
echo '</gallery>';

... and use the following line in your embedding code:

fo.addVariable("xmlURL", "gallery.php");    

You may wish to change the gallery settings to suit your needs and the above code assumes that your images are in a folder named 'images' .

Here it is in action:

Steven Speirs
SimpleViewer Support Team.