slideshow pro - photos not looping

18 posts by 2 authors in: Forums > CMS Builder
Last Post: December 18, 2008   (RSS)

By petejdg - November 21, 2008 - edited: November 21, 2008

Having trouble with the slideshow pro and cms builder setup. I have gone throug all the documentation on the setup to pull in my content from cms builder. It looks like it is connecting through the xml file to my photo_gallery table but only one image shows in the flash viewer. If I look at the images.xml.php through my browser, it is only showing one image in there and I have three in it. Shouldn't it be looping through my images? Anyone have any ideas on this.
http://www.cywakeman.com/slideshow/
http://www.cywakeman.com/slideshow/images.xml.php

Here is my images.xml.php code:

<?php header('Content-type: application/xml; charset=utf-8'); ?><?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<?php

require_once "/home/content/j/d/g/jdgordon/html/cmsAdmin/lib/viewer_functions.php";

list($photo_galleryRecords, $photo_galleryMetaData) = getRecords(array(
'tableName' => 'photo_gallery',
));
$photo_galleryRecord = @$photo_galleryRecords[0]; // get first record
?>
<gallery>
<album title="Slide Show" description="Slide Show" lgpath="/cmsAdmin/uploads/" tnpath="/cmsAdmin/uploads/thumb/">
<?php foreach ($photo_galleryRecord['image'] as $upload): ?>
<img src="<?php echo $upload['filename'] ?>" />
<?php endforeach ?>
</album>
</gallery>

Re: [petejdg] slideshow pro - photos not looping

By Dave - November 21, 2008

Hi petejdg, welcome to the CMS Builder forum! :)

It looks like this code right now will load the very first record from the photo_gallery. Is that what you want it to do? You can display the record number it is loading like this:

num: <?php echo $photo_galleryRecord['num'] ?>

Let me know which record number it's loading and if you have more than one record in that section or how it's setup and I'll help you get it working.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] slideshow pro - photos not looping

Hi Dave,
If you hit the page the slideshow is on, it only shows 1 photo, but I want all my photos to show up on the viewer. Right now I have photo_gallery with "image" upload field and three records for testing right now. I want it to loop and pull all my photos in - not just the one. So, not sure how to accomplish that. Thought it was looping in the image.xml.php code but guess it is not. Let me know what else you need from me.
thanks for your help,
pete

Re: [petejdg] slideshow pro - photos not looping

By Dave - November 21, 2008

Hi pete,

The way it works by default is it would show photos for a specified record. So you'd list the record and then click on one to see the photo slideshow for that record.

Is it possible to have all the photos in one record?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] slideshow pro - photos not looping

Oh, okay. Is there the 25 photo limit then on a record when uploading... i think that was what it was maybe???? I guess I just want an updatable photo gallery and just thought that each image would be its own record - but maybe I am thinking all wrong. I could try this weekend to reset it up the way you are talking. I was just under the impression that it would just loop through all....

Re: [petejdg] slideshow pro - photos not looping

By Dave - November 21, 2008

There's a few ways you could do it. If you're not going to have too many I think having all the uploads in one record is simplest. You can remove or change the 25 file limit in the field editor.

Try this with what you have now. I just thought of a simple way to make it loop over each upload from each record:

<?php header('Content-type: application/xml; charset=utf-8'); ?><?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<?php

require_once "/home/content/j/d/g/jdgordon/html/cmsAdmin/lib/viewer_functions.php";

list($photo_galleryRecords, $photo_galleryMetaData) = getRecords(array(
'tableName' => 'photo_gallery',
));
$photo_galleryRecord = @$photo_galleryRecords[0]; // get first record
?>
<gallery>
<album title="Slide Show" description="Slide Show" lgpath="/cmsAdmin/uploads/" tnpath="/cmsAdmin/uploads/thumb/">

<?php foreach ($photo_galleryRecords as $record): ?>
<?php foreach ($record['image'] as $upload): ?>
<img src="<?php echo $upload['filename'] ?>" />
<?php endforeach ?>
<?php endforeach ?>

</album>
</gallery>


Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [petejdg] slideshow pro - photos not looping

Sorry.... found that my photo had an & in it and that was throwing it off. I can hit the images.xml.php file and see that it is looping and pulling in the three images, but they are not showing up in the flash viewer - still only just the one.

Re: [petejdg] slideshow pro - photos not looping

In the output of the images.xml.php file I see:
<img src="CyGloria2006_012_001_001.jpg"/>
There isn't a space between "/> Could that cause anything?

Re: [petejdg] slideshow pro - photos not looping

By Dave - November 24, 2008

Hi Pete,

You can have it automatically encode & symbols in urls like this:

<img src="<?php echo urlencode($upload['filename']) ?>" />

Is there anything else still preventing it from working?
Dave Edis - Senior Developer
interactivetools.com