Topic: pass set name from php page (FlickR fed) to SimpleViewer as a variable

I am converting a client website from Slideshow Pro and Director to a combination of FlickR and SimpleViewer. So I need "albums" feature, corresponding to sets in Flickr. I have already created a PHP page with listing of all the sets.

Now I have to pass the set ID to SimpleViewer page "viewer.html".  The simplest way to go would be of course to dynamically re-write XML file (gallery.xml) and replace the set ID in it, but I know that xml file will be cached on the visitor's side and will display the same album every time, no matter what set ID is passed, unless the page "viewer.html" is refreshed.

So... We need to create XML files on the fly, such as "gallery_set_id_758843.xml" etc. How do we pass that info to "viewer.html"? 

Any other ideas?

Re: pass set name from php page (FlickR fed) to SimpleViewer as a variable

You could pass the flickrSetId option as a flashvar rather than in the gallery's XML file.
Your embedding code would look something like this:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars={};
flashvars.flickrSetId="0123456789";
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

You could also generate an XML file on the fly using PHP.
See this post for details: http://www.simpleviewer.net/forum/viewt … 293#p36293
Just change the line:

echo '<simpleviewergallery title="SimpleViewer Gallery">';

... to include the flickrSetId (and any other options you require to be set).

In order to avoid the gallery's XML file being cached, you could try defining your gallery's XML file with a unique identifier (eg. the current time which will be different each time a user loads the page) using the galleryURL option:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars={};
flashvars.galleryURL="gallery.xml?nocache="+new Date().getTime();
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "222222", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->
Steven Speirs
SimpleViewer Support Team.