Topic: Automated web gallery

Hi all,
Does anyone knows if  there is an automated web server php gallery builder like "pcv_buildgallery"
for SimpleViewerProV2, that can use the exact same setting I originaly used to build a gallery.
Ex:
The original pcv_buildgallery.php was generating this:

<?xml version="1.0" encoding="UTF-8" ?><GALLERY_DATA cellDimension="700" columns="6" zoomOutPerc="15" zoomInPerc="100" frameWidth="20" frameColor="0xFFFFFF" captionColor="0xFFFFFF" enableRightClickOpen="true">
<image>
  <url>images/1Km_030.jpg</url>
  <caption></caption>
</image>
</gallery>


But I would like it to generate this instead and always keep the same setting:

<?xml version="1.0" encoding="UTF-8"?>

<simpleviewerGallery

    stagePadding="40"
    navPadding="40"
    thumbnailColumns="7"
    thumbnailRows="2"
    navPosition="top"
    vAlign="center"
    hAlign="center"
    title="title"
    enableRightClickOpen="false"
    backgroundImagePath=""
    imagePath=""
    thumbPath=""
    embedWidth="600"
    embedHeight="600"
    embedColor="FFFFFF"
    thumbPosition="TOP"
    thumbColumns="10"
    thumbRows="2"
    thumbFrameWidth="0"
    thumbHoverFrameWidth="4"
    captionPosition="OVERLAY_BOTTOM"
    imageFrameStyle="ROUNDED"
    titlePosition="TOP"
    buttonBarPosition="OVERLAY"
    stageHPadding="10"
    stageVPadding="10"
    imageDropShadow="true"
    frameWidth="0"
    frameColor="FFFFFF"
    maxImageWidth="1200"
    maxImageHeight="800"
    imageScaleMode="SCALE_UP"
    buttonBarPadding="5"
    thumbNavStyle="NUMERIC"
    captionPadding="10"
    captionBackOpacity="0.5"
    stageBorder="10"
    lockBottomStack="true"
    useFixedLayout="false"
    thumbWidth="50"
    thumbHeight="50"
    thumbHAlign="LEFT"
    autoPlayOnLoad="false"
    enableLooping="false"
    randomizeAutoPlay="false"
    showDownloadButton="true"
    showNavButtons="false"
    showAutoPlayButton="true"
    showAudioButton="false"
    showBackButton="false"
    autoPlayThumbs="true"
    showAutoPlayStatus="false"
    lockTopStack="true"
    showOpenButton="true"
    buttonBarVAlign="TOP"
    buttonBarHAlign="RIGHT"
    thumbNavPosition="BOTTOM"
    thumbNavPadding="5"
    thumbNavBackOpacity=".5"
    thumbLoadBarHeight="5"
    buttonBarHoverColor="33CCFF"
    buttonBarScale="1"
    floatButtonBar="false"
    captionDropShadow="false"
    titleFontColor="003399"
    stageHAlign="LEFT"
    stageVAlign="TOP"
    imageCornerRadius="15"
    languageCode="FR"

>
  <image>
    <filename>DSC_1531.jpg</filename>
    <caption>DSC_1531.jpg</caption>
  </image>
</simpleviewerGallery>

Thanks

Re: Automated web gallery

Ok, I partially answer my own question. So my modified pcv_buildgallery.php works fine and it creates the desired gallery.xml. But when it is time to view the generated gallery I get a "Cannot parse XML Gallery"

Any clues???

Here are the links:
http://www.unpasverslespoir.ca/galerie2 … allery.php
http://www.unpasverslespoir.ca/galerie2 … /index.php

and  the code:

<?
// -----------------------
// pcv_buildgallery
// -----------------------
// This script automatically generates the XML document for PostCardviewer
// www.airtightinteractive.com/projects/postcardviewer/
// Instructions to use are at:
// http://www.airtightinteractive.com/proj … truct.html

// SET GALLERY OPTIONS HERE
// -----------------------
$options .= '<simpleviewerGallery

    stagePadding="40"
    navPadding="40"
    thumbnailColumns="7"
    thumbnailRows="2"
    navPosition="top"
    vAlign="center"
    hAlign="center"
    title="title"
    enableRightClickOpen="false"
    backgroundImagePath=""
    imagePath="images/"
    thumbPath=""
    embedWidth="600"
    embedHeight="600"
    embedColor="FFFFFF"
    thumbPosition="TOP"
    thumbColumns="10"
    thumbRows="2"
    thumbFrameWidth="0"
    thumbHoverFrameWidth="4"
    captionPosition="OVERLAY_BOTTOM"
    imageFrameStyle="ROUNDED"
    titlePosition="TOP"
    buttonBarPosition="OVERLAY"
    stageHPadding="10"
    stageVPadding="10"
    imageDropShadow="true"
    frameWidth="0"
    frameColor="FFFFFF"
    maxImageWidth="1200"
    maxImageHeight="800"
    imageScaleMode="SCALE_UP"
    buttonBarPadding="5"
    thumbNavStyle="NUMERIC"
    captionPadding="10"
    captionBackOpacity="0.5"
    stageBorder="10"
    lockBottomStack="true"
    useFixedLayout="false"
    thumbWidth="50"
    thumbHeight="50"
    thumbHAlign="LEFT"
    autoPlayOnLoad="false"
    enableLooping="false"
    randomizeAutoPlay="false"
    showDownloadButton="true"
    showNavButtons="false"
    showAutoPlayButton="true"
    showAudioButton="false"
    showBackButton="false"
    autoPlayThumbs="true"
    showAutoPlayStatus="false"
    lockTopStack="true"
    showOpenButton="true"
    buttonBarVAlign="TOP"
    buttonBarHAlign="RIGHT"
    thumbNavPosition="BOTTOM"
    thumbNavPadding="5"
    thumbNavBackOpacity=".5"
    thumbLoadBarHeight="5"
    buttonBarHoverColor="33CCFF"
    buttonBarScale="1"
    floatButtonBar="false"
    captionDropShadow="false"
    titleFontColor="003399"
    stageHAlign="LEFT"
    stageVAlign="TOP"
    imageCornerRadius="15"
    languageCode="FR"

>';

// Set sortImagesByDate to true to sort by date. Otherwise files are sorted by filename.
$sortImagesByDate = true;

// Set sortInReverseOrder to true to sort images in reverse order.
$sortInReverseOrder = false;

// END OF OPTIONS
// -----------------------

print "Creating XML for POSTCARDVIEWER.<br>";
print "-------------------------------------------------<br><br>";

if ($sortImagesByDate){
    print "Sorting images by date.<br>";
}else{
    print "Sorting images by filename.<br>";       
}

if ($sortInReverseOrder){
    print "Sorting images in reverse order.<br><br>";
}else{
    print "Sorting images in forward order.<br><br>";       
}

//loop thru images
$xml = '<?xml version="1.0" encoding="UTF-8" ?>'.$options;
$folder = opendir("images");
while($file = readdir($folder)) {
    if ($file[0] != "." && $file[0] != ".." ) {
        if ($sortImagesByDate){
            $files[$file] = filemtime("images/$file");
        }else{
            $files[$file] = $file;
        }
    }       
}   

// now sort by date modified
if ($sortInReverseOrder){
    arsort($files);
}else{
    asort($files);
}

foreach($files as $key => $value) {

    $xml .= "\n<image>\n";
    $xml .= "  <url>images/".$key."</url>\n";
    $xml .= "  <caption>".$key."</caption>\n";
    $xml .= "</image>\n";
   
        print "- Created Image Entry for: $key<br/>"; 
}

closedir($folder);

$xml .= '</gallery>';
//next line can cause erroneous warnings
//chmod( 'gallery.xml', 0777 );
$file = "gallery.xml";   
if (!$file_handle = fopen($file,"w")) {
    print "<br>Cannot open XML document: $file<br>";
}  elseif (!fwrite($file_handle, $xml)) {
    print "<br>Cannot write to XML document: $file<br>";   
}else{
    print "<br>Successfully created XML document: $file<br>";   
}
fclose($file_handle);       

?>

Re: Automated web gallery

Does anyone knows if  there is an automated web server php gallery builder like "pcv_buildgallery"
for SimpleViewerProV2

Yes: http://www.simpleviewer.net/simpleviewe … llery.html

Felix Turner
SimpleViewer Support Team.