Topic: auto generated xml code with version 2.3.1 not working

Hello,

I used version 2.2.0 of simpleviewer for al long time. For some time this is not working on mobile devices because flashplayer is missing.

I always used this code.

   

        var flashvars = {};
            flashvars.galleryURL = "loadpictures.php?album=<?php echo $album; ?>";
            flashvars.enableAPI = "true";
            
            var params = {};            
            params.allowfullscreen = true;
            params.allowscriptaccess = "always";
            params.bgcolor = "222222";
            
            var attributes = {};
            //name and id should match getElementById() call above
            attributes.id =  "svInstance"; 
            attributes.name = "svInstance";
            
            swfobject.embedSWF("simpleviewer.swf", "flashContent", "100%", "100%", "9.0.124", false, flashvars, params,attributes);

The loadpictures.php generates xml code (same content as a gallery.xml) on the fly. How can I embed this in the 2.3.1 code?

    simpleviewer.ready(function () {
        simpleviewer.load('sv-container', '100%', '100%', '222222', true);
    });

with a gallery.xml file in the same directory works. How do I change it so that

"loadpictures.php?album=<?php echo $album; ?>"

is executed?

Last edited by Thuurke (2014-03-06 21:32:44)

Re: auto generated xml code with version 2.3.1 not working

Try the following code:

var flashvars = {};
flashvars.galleryURL = "loadpictures.php?album=<?php echo $album; ?>";
flashvars.enableAPI = "true";

var params = {};            
params.allowfullscreen = true;
params.allowscriptaccess = "always";
params.bgcolor = "222222";

var attributes = {};
//name and id should match getElementById() call above
attributes.id =  "svInstance"; 
attributes.name = "svInstance";

simpleviewer.ready(function () {
    simpleviewer.load('flashContent', '100%', '100%', '222222', true, flashvars, params, attributes);
});

The flashvars, params and attributes variables can be added as Embed Code Parameters.
Please note that in the code above, the SimpleViewer container is named flashContent (just like in your original code). You can change this to match your own SimpleViewer container name if necessary.

Steven Speirs
SimpleViewer Support Team.

Re: auto generated xml code with version 2.3.1 not working

I edited the code and the only thing I get is the original content of the <div id="flashContent">

<div id="flashContent">SimpleViewer requires JavaScript and the Flash Player. <a href="http://get.adobe.com/flashplayer/">Get Flash</a></div>

Re: auto generated xml code with version 2.3.1 not working

Make sure that you have included the 'simpleviewer.js' file in your page using code such as the following (from the embedding code here):

<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>

If you continue to experience difficulties, please post the URL to your gallery's web page so that I can take a look and help further.

Steven Speirs
SimpleViewer Support Team.

Re: auto generated xml code with version 2.3.1 not working

Sure I forgot the simpleviewer.js..... roll but it isn't solved yet.

To view a album
http://www.heitsemedia.nl/albumviewer/a … m=wpya1UtZ

To view a generated "virtual" xml file
http://www.heitsemedia.nl/albumviewer/l … m=wpya1UtZ

When I open an album in a windows browser (Firefox , Chrome) flash is used and works fine.
When I use chrome on Android I get No Images Specified in Gallery XML.

Re: auto generated xml code with version 2.3.1 not working

Try adding the following to the PHP file which generates your XML data to tell browsers that the output is an XML file.

header('Content-type: application/xml');

Also, remove the imagePath="images/" and thumbPath="thumbs/" attributes from the opening <simpleviewergallery> tag. These options were deprecated a long time ago in v2.1.2 and should not be used in the current version (v2.3.1).

Also, as you are not using the SimpleViewer API, you can condense your embedding code to something like the following:

<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
    var flashvars = {};
    flashvars.galleryURL = "loadpictures.php?album=wpya1UtZ";
    simpleviewer.ready(function () {
        simpleviewer.load('sv-container', '100%', '100%', '222222', true, flashvars);
    });
</script>
<div id="sv-container"></div>

Hopefully this will help.

Steven Speirs
SimpleViewer Support Team.