Topic: Problem with php-dynamically generated xml

Hi!
I post every time I update simpleviewer pro, being a customer since more than 4 years!  big_smile


Upgrading to 2.1.3, I cannot make it work.
The XML file being generated seems not to be working: cannot parse gallery xml, although the xml looks fine.
Here is my test page:
http://www.forbidden-places.net/explo76.htm      -> cannot parse gallery xml sad (click 'gallery of photos'

The link to the xml:
http://www.forbidden-places.net/explos/ … =en--/--76


And the embed code:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="explos/sv/js/simpleviewer.js"></script>
<script type="text/javascript">
//<![CDATA[
var flashvars = {};
flashvars.galleryURL = "/explos/imageData3.php?hack=en--/--76";
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "952", "775", "222222", true, null, null, null, false);
});
    //]]>
</script>
<div id="sv-container" align="center"></div>
<!-- END SIMPLEVIEWER EMBED --></div>

I tried to encode the gallery URL as mentioned in another post, but no success sad

Any idea?

Thanks in advance!


Best,
Slyv

--
http://www.forbidden-places.net -> built with Simpleviewer :-)

Re: Problem with php-dynamically generated xml

The 'Cannot Parse Gallery XML' messgae can be caused by a duplicate config option (as suggested by this FAQ: http://simpleviewer.net/simpleviewer/su … trouble_9) but I do not see one in your XML file.
Try changing <SimpleviewerGallery> to <simpleviewergallery> (all lowercase) and likewise for the corresponding closing tag.
However, I think the solution may be to somehow escape (rather than just encode) the slash in the query string.

Steven Speirs
SimpleViewer Support Team.

Re: Problem with php-dynamically generated xml

hi steven,
thanks for your reply.
I tried to lower-case the simpleviewergallery tag, but no change.


What do you mean by "somehow escape (rather than just encode) the slash in the query string."    ?


I'm getting nervous  smile

--
http://www.forbidden-places.net -> built with Simpleviewer :-)

Re: Problem with php-dynamically generated xml

I think that when SimpleViewer is resolving the galleryURL, the slash in the query string ('?hack=en--/--76') is being interpreted as a path separator rather than simply a character in the string.
Are you able to substitute this character for something else (other than a URL reserved character) to test this theory?

Steven Speirs
SimpleViewer Support Team.

Re: Problem with php-dynamically generated xml

Steven Speirs wrote:

I think that when SimpleViewer is resolving the galleryURL, the slash in the query string ('?hack=en--/--76') is being interpreted as a path separator rather than simply a character in the string.

Thanks, but I tested your theory (slash replaced by '_'): not working...
The links remain the same as above:

Test page: http://www.forbidden-places.net/explo76.htm
XML: http://www.forbidden-places.net/explos/ … =en--_--76

Any more idea?

--
http://www.forbidden-places.net -> built with Simpleviewer :-)

Re: Problem with php-dynamically generated xml

Try using the dynamically generated PHP code as a static XML file in your gallery, ie. copy the code that a browser sees here http://www.forbidden-places.net/explos/ … =en--_--76 into a file named 'gallery.xml' and adjust your 'galleryURL' accordingly to use this file.
Do you still get the 'Cannot Parse Gallery XML' message?
If not, then the problem most likely lies with the galleryURL line rather than with the PHP code which generates the XML file.
I realise you have said that you have tried this but flashvar parameters must be URL encoded. Try URL encoding the galleryURL string (making sure it does not contain reserved characters) using this tool: http://meyerweb.com/eric/tools/dencoder/

Steven Speirs
SimpleViewer Support Team.

Re: Problem with php-dynamically generated xml

Steven Speirs wrote:

Do you still get the 'Cannot Parse Gallery XML' message?


Unfortunately, yes  sad
I converted the php file to a plain xml file, and still the same result.

XML is here: http://www.forbidden-places.net/explos/77/gallery.xml
Test page is still the same
And the embed code is now:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="explos/sv/js/simpleviewer.js"></script>
<script type="text/javascript">
//<![CDATA[
var flashvars = {};
flashvars.galleryURL = "explos/77/gallery.xml";
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "952", "775", "222222", true, null, null, null, false);
});
    //]]>
</script>
<div id="sv-container" align="center"></div>
<!-- END SIMPLEVIEWER EMBED -->

--
http://www.forbidden-places.net -> built with Simpleviewer :-)

Re: Problem with php-dynamically generated xml

I have just noticed that in the code you posted, your embedding code does not include the flashvars and, therefore, the galleryURL will not be used.
You should use the following code:

simpleviewer.load("sv-container", "952", "775", "222222", true, flashvars, null, null, false);

Please see here for details: http://simpleviewer.net/simpleviewer/su … tml#params

Steven Speirs
SimpleViewer Support Team.

Re: Problem with php-dynamically generated xml

Steven Speirs wrote:

I have just noticed that in the code you posted, your embedding code does not include the flashvars and, therefore, the galleryURL will not be used.


Working, thanks!

I struggled a bit more to have multiple galleries on one html page. I found the answer on the forum, but I think that the documentation should be more explicit about naming the div containers and especially the flashvars differently for each gallery.

Cheers!
S.

--
http://www.forbidden-places.net -> built with Simpleviewer :-)