Flash Image Rotator
10 posts by 3 authors in: Forums > CMS Builder
Last Post: March 9, 2010 (RSS)
By drewh01 - January 4, 2010
http://vps.fp2marketing.com/~chamberm/index.php
<embed
src="imagerotator.swf"
width="607"
height="282"
allowscriptaccess="always"
allowfullscreen="false"
flashvars="file=flash.xml.php&transition=fade&showicons=false&shownavigation=false&screencolor=0x6b330a&overstretch=true"
/>
The xml file appears to load properly and I even was able to get the images to display once - but then all of a sudden they stopped working when I reloaded the page.
http://vps.fp2marketing.com/~chamberm/flash.xml.php
Also, I can get the static image flash player to work just fine. The only difference is that it uses the flash.xml (without the .php)
http://vps.fp2marketing.com/~chamberm/index2.php
Ideas?
Re: [drewh01] Flash Image Rotator
By drewh01 - January 5, 2010 - edited: January 5, 2010
I removed this line from my top load header and it worked!
'where' => whereRecordNumberInUrl(1),
Re: [drewh01] Flash Image Rotator
By Chris - January 5, 2010
Glad to hear you've figured this out. Looks good! :D
Chris
Re: [chris] Flash Image Rotator
By sublmnl - March 8, 2010
Since I couldn't find a how-to, I treated this just like the RSS feed , replacing things as necessary.
(as usual get the XML working outside of the CMS first! to eliminate buggy issues)
Here is the top portion of the code for the original XML file that we are going to replace with the top portion of our images section editor:
<?xml version="1.0" encoding="utf-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
replace with this:
change your pathways to match your locations! :
<?php header('Content-type: application/xml; charset=utf-8'); ?><?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<?php
require_once "/home/content/html/public/cmsAdmin/lib/viewer_functions.php";
list($homepage_imagesRecords, $homepage_imagesMetaData) = getRecords(array(
'tableName' => 'homepage_images',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$homepage_imagesRecord = @$homepage_imagesRecords[0]; // get first record
// show error message if no matching record is found
if (!$homepage_imagesRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}
?>
What I don't understand is why removing this from the above code, actually gets it to work?!
'where' => whereRecordNumberInUrl(1),
if anyone knows that answer, great.
But below is the rest of the code, and I'm only using the <location> tag but you could use all of them and pop in whatever variables you have from your editor, for example using link would be good for each image if they linked to a product etc etc....
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<?php foreach ($homepage_imagesRecord['images'] as $upload): ?>
<track>
<location><?php echo $upload['urlPath'] ?></location>
</track>
<?php endforeach ?>
</trackList>
</playlist>
Re: [sublmnl] Flash Image Rotator
By Chris - March 9, 2010
What I don't understand is why removing this from the above code, actually gets it to work?!
What URL are you using to access your XML page? With no where clause, getRecords() will simply return the first record in your section. Is your section Multi Record or Single Record?
Chris
Re: [chris] Flash Image Rotator
By sublmnl - March 9, 2010 - edited: March 9, 2010
It does work, just need to figure out why taking that line out works - or perhaps, is there a better way to write that xml.php file?
Re: [sublmnl] Flash Image Rotator
By Chris - March 9, 2010
For a Single Record section, you'll never need a where clause. Taking out that line is the right thing to do. :)
I hope this helps! Please let me know if you have any questions.
Chris
Re: [chris] Flash Image Rotator
By sublmnl - March 9, 2010
can I poke you into helping with the limit wysiwyg post we've been running for about a year now?
[cool]