Re: [chris] CMS & Slideshow Pro (LR2)
Okay after a short hiatus working on a few other sites with CMSB [;)] We're back.
Chris has instructed me to use a multi section editor and that seems to be the right path.
Here's what I/we did:
Created a multi section editor called "multi_photo_gallery"
with fields for: title, description, thumbnail and photos.
note: that is exactly what the field names are called in the table
For the XML.php file I created one that looks like this:
<?php header('Content-type: application/xml; charset=utf-8'); ?>
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<?php
require_once "/home/YOUR/PATH/TO/html/WEBSITE/cmsAdmin/lib/viewer_functions.php";
list($multi_photo_galleryRecords, $multi_photo_galleryMetaData) = getRecords(array(
'tableName' => 'multi_photo_gallery',
'where' => whereRecordNumberInUrl(1),
));
// show error message if no matching record is found
if (!$multi_photo_galleryRecords) {
print "Record not found!";
exit;
}
?>
<gallery>
<?php foreach ($multi_photo_galleryRecords as $record): ?>
<album title="<?php echo $record['title'] ?>" description="<?php echo $record['description'] ?>"
tnpath="/images/uploads/photos/multi_gallery/thumb/" tn="<?php echo @$record['photos'][0]['thumbUrlPath'] ?>"
lgpath="/images/uploads/photos/multi_gallery/">
<?php foreach ($record['photos'] as $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" caption="<?php echo $upload['info1'] ?>" />
<?php endforeach ?>
</album>
<?php endforeach ?>
</gallery>
A few notes about the code above: I replaced my pathway to the public HTML folder (just for the example) and the TN path and the LG path are hard coded.
Good news: It works, I view the XML in the browser and it loads the two records I have perfectly and pulls the first thumbnail from the folder.
Chris gave me this to use for that function:
<?php echo @$record['photos'][0]['thumbUrlPath'] ?>
Now bad news is I think, or am pretty sure, I have to keep all the uploads for the different albums in the same TN and LG folder locations.
One more Bad news I can not figure out how to just write the pathway to each, thus they are hard coded. So a little more help there would be great.[;)]
Now one more thing I need help with. The actual php file that holds the SSP player has an error in the code that keeps it from rendering:
(Here is a portion of the html source code with the error - note I changed the pathway for this example)
flashvars="xmlfile=http://WEBSITE.com/xml/multi_photos.xml.php?
Notice: Undefined variable: multi_photo_galleryRecord in /home/YOUR/PATH/TO/html/WEBSITE/multi_photos.php on line 68
This is the portion of the source code that I have on the PHP page that causes that error. I have tried both of these and no luck.
flashvars="xmlfile=http://WEBSITE.com/xml/multi_photos.xml.php?<?php echo $multi_photo_galleryRecord['num'] ?>
and
flashvars="xmlfile=http://WEBSITE.com/xml/multi_photos.xml.php?<?php foreach ($multi_photo_galleryRecords as $record): ?>
<?php echo $multi_photo_galleryRecord['num'] ?>
<?php endforeach ?>"
Once I get this error solved We'll have a perfect example to automate albums in a Gallery with SlideShowPro.