CMS Multiple Images

44 posts by 3 authors in: Forums > CMS Builder
Last Post: July 14, 2008   (RSS)

By edandrea - June 27, 2008

Hi Dave,

I know I am almost there. When I check out the xml.php page the actual images show http://www.smoaklandco.com/images.xml.php?3, http://www.smoaklandco.com/images.xml.php?32, http://www.smoaklandco.com/images.xml.php?1 .

There has to be something in this code. I am wondering if it has to do with the header since I am getting this before the images "Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/m/o/smoaklandco/html/images.xml.php:3) in /home/content/s/m/o/smoaklandco/html/images.xml.php on line 3" . with line 3 being the header? I checked out the documentation with SlideShowPro and it says that the cms is to generate the .xml.



The header that SlideShowPro shows is: <?xml version="1.0" encoding="UTF-8"?>



<?php header('Content-type: application/xml; charset=utf-8'); ?>

<?php

require_once "/home/content/s/m/o/smoaklandco/html/cmsAdmin/lib/viewer_functions.php";


list($customRecords, $customDetails) = getRecords(array(
'tableName' => 'custom',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$customRecord = $customRecords[0]; // get first record


?>



<?php foreach ($customRecord['lg_photo'] as $upload): ?>
<gallery>
<album title="House" description="Images of a property" lgpath="<?php echo $upload['urlPath'] ?>" tnpath="<?php echo $upload['thumbUrlPath'] ?>">
<img src="<?php echo $upload['urlPath'] ?>"/>
</album>
</gallery>

<?php endforeach ?>

<?php if ([url "mailto:!@$customRecord['lg_photo'"]!@$customRecord['lg_photo'[/url]]): ?>
No Images Found
<?php endif; ?>



Please I hope you can help with this as you said that you got it working elsewhere...:)



Regards

Emil Dandrea

Re: [edandrea] CMS Multiple Images

By Dave - June 27, 2008

Hi Email,

Just remove any spaces or enters before that first <?php header and the error will go away.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [edandrea] CMS Multiple Images

By Dave - June 27, 2008

What XML file are you using and where is it being specified? Are you able to specify the XML file in the page source in the embed tag?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] CMS Multiple Images

By edandrea - June 27, 2008

Hi Dave,

Thanks for asking.

1. Here is the .xmp.php file http://www.smoaklandco.com/images.xml.php :

<?php header('Content-type: application/xml; charset=utf-8'); ?>

<?php

require_once "/home/content/s/m/o/smoaklandco/html/cmsAdmin/lib/viewer_functions.php";


list($customRecords, $customDetails) = getRecords(array(
'tableName' => 'custom',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$customRecord = $customRecords[0]; // get first record


?>



<?php foreach ($customRecord['lg_photo'] as $upload): ?>
<gallery>
<album title="House" description="Images of a property" lgpath="<?php echo $upload['urlPath'] ?>" tnpath="<?php echo $upload['thumbUrlPath'] ?>">
<img src="<?php echo $upload['urlPath'] ?>"/>
</album>
</gallery>

<?php endforeach ?>

<?php if ([url "mailto:!@$customRecord['lg_photo'"]!@$customRecord['lg_photo'[/url]]): ?>
No Images Found
<?php endif; ?>


2. Embed? you mean here:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="728" height="400" id="ds_gallery2" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="ds_gallery2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#3399cc" /><embed src="ds_gallery2.swf" quality="high" bgcolor="#3399cc" width="728" height="400" name="ds_gallery2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>



3. When I created the movie in SlideShowPro I was able to specify the images.xml.php file within the characteristics.



I hope I have answered the question.



Regards Emil

Re: [edandrea] CMS Multiple Images

By Jake - June 28, 2008

Hi Emil,

The trick here is going to be working out a way to specify a different XML file link for your slideshow automatically, otherwise you would need to manually create the slideshow for each listing. I'd suggest checking out the SlideShowPro documentation to find out if there's a way to dynamically change this setting, since you can't seem to change it in the embed code the way it's set up now. You might want to drop them an email if you don't see anything about this.

I hope this helps!
-----------------------------------------------------------
Cheers,
Jake Marvin - Product Specialist
support@interactivetools.com

Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.

By Jake - June 29, 2008 - edited: June 29, 2008

Hi Emil,

I took another look at this for you over the weekend, and I have some more concrete steps I can share with you to get this up and running. The main changes you'll need to make are going to be in your embed code. This is what you're currently using:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="728" height="400" id="ds_gallery2" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="ds_gallery2.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#3399cc" />
<embed src="ds_gallery2.swf" quality="high" bgcolor="#3399cc" width="728" height="400" name="ds_gallery2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>


You'll want to change that to this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="728" height="400" id="ds_gallery2" align="middle">
<param name="FlashVars" value="xmlfile=http://www.smoaklandco.com/images.xml.php?<?php echo $customRecord['num'] ?>" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="ds_gallery2.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#3399cc" />
<embed src="ds_gallery2.swf" quality="high" FlashVars="xmlfile=http://www.smoaklandco.com/images.xml.php?<?php echo $customRecord['num'] ?>" bgcolor="#3399cc" width="728" height="400" name="ds_gallery2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>


What's different there is that I added a new "param" tag, and added a FlashVars attribute to the "embed" tag. These contain the values for dynamically loading the XML file.

There is also another step you'll need to take, which I'll take directly from the SlideShowPro documentation:


Edit FLA

Open the FLA containing SlideShowPro for Flash. Open the Properties panel (Windows > Properties) and give the component instance a unique variable name. For this tutorial, I’ll name it my_ssp.

Now we need to write some ActionScript to assign our XML file to SlideShowPro's xmlFileType property. Create a new layer in your movie timeline, and click its first frame so it’s highlighted. Open the Actions panel and enter this:

my_ssp.xmlFilePath=xmlfile;


If you're curious, this is the page on the SlideShowPro site where I got this information from:

http://wiki.slideshowpro.net/SSPfl/C-DynamicallyAssignXML

Note that I wasn't able to test this out completely on my end as I don't have a copy of Flash, so there might still be a couple of kinks to work out here, but those steps should cover most of the work required to get this running.

Let us know how this works out!
-----------------------------------------------------------
Cheers,
Jake Marvin - Product Specialist
support@interactivetools.com

Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.

By edandrea - June 30, 2008

Hi Jake,

Wow...Thanks for the input, thought you all were off on the weekend? I spent most of the weekend studying the user manual myself, trial and error and without success.



I had allready emailed the program author and he showed me where the documentation was you suggested. So I had allready had attempted what you had suggested except adding in the .php in the flash code. I also made the adjustments to the .fla (my_ssp.xmlFilePath=xmlfile;) as well as naming the instance.



You know if we get this working this would make a great tutorial for CMS since I was unable to find history.



I even studied most of your forum and tried some other adjustments. Its all working just for some reason not pulling up the pics. I can pull up the idividual .xml files and it lists the pics. Its got to be the way it is coded on the .xml.php



My .xml.php code:

<?php header('Content-type: application/xml; charset=utf-8'); ?>

<?php

require_once "/home/content/s/m/o/smoaklandco/html/cmsAdmin/lib/viewer_functions.php";


list($customRecords, $customDetails) = getRecords(array(
'tableName' => 'custom',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$customRecord = $customRecords[0]; // get first record


?>



<?php foreach ($customRecord['lg_photo'] as $upload): ?>
<gallery>
<album title="House" description="Images of a property" lgpath="<?php echo $upload['urlPath'] ?>" tnpath="<?php echo $upload['thumbUrlPath'] ?>">
<img src="<?php echo $upload['urlPath'] ?>"/>
</album>
</gallery>

<?php endforeach ?>

<?php if ([url "mailto:!@$customRecord['lg_photo'"]!@$customRecord['lg_photo'[/url]]): ?>
No Images Found
<?php endif; ?>



When I view the source of the xml:

<gallery>
<album title="House" description="Images of a property" lgpath="/cmsAdmin/uploads/sc_21.jpg" tnpath="/cmsAdmin/uploads/thumb/sc_21.jpg">
<img src="/cmsAdmin/uploads/sc_21.jpg"/>
</album>
</gallery>

<gallery>
<album title="House" description="Images of a property" lgpath="/cmsAdmin/uploads/sc_22.jpg" tnpath="/cmsAdmin/uploads/thumb/sc_22.jpg">
<img src="/cmsAdmin/uploads/sc_22.jpg"/>
</album>
</gallery>



Strange Eh? I hope we can work this out......:)

By edandrea - June 30, 2008

Something else interesting. When I view source the code in the flash does change - FlashVars" value="xmlfile=http://smoaklandco.com/images.xml.php?1". If you remember we or you added the php code.

Re: [edandrea] CMS Multiple Images

By Jake - June 30, 2008

Hi edandrea,

Would it be possible to email me FTP information for your server to jake@interactivetools.com? There are a couple quick tests I'd like to run here which may help us get to the bottom of this.

I'll post my findings up in this thread. [:)]
-----------------------------------------------------------
Cheers,
Jake Marvin - Product Specialist
support@interactivetools.com

Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.