Dynamic Flash Gallery ASP Support Product Page

This topic was archived

Can't pass params in xml querysting

Asked 05 Nov 2008 20:57:21
1
has this question
05 Nov 2008 20:57:21 Jeff K posted:
Hi George,

I love this extension and I've found some new ways to use it. I'm currently generating the XML file used by dmxFlashGallery2.swf dynamically and need to pass a an integer value in the querystring to the XML file. The following code works fine in the PHP version:

'Gallery=gallery.xml?PhotoCategoryID=<?php echo $_GET['PhotoCategoryID'] ?>'

...and here it is in context:

<script type="text/javascript">
AC_FL_RunContent( 'codebase','download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','600','height','650','id','Gallery1','align','middle','src','dmxFlashGallery2','quality','best','flashvars','Gallery=gallery.xml?PhotoCategoryID=<?php echo $_GET['PhotoCategoryID'] ?>','scale','noscale','bgcolor','#333333','pluginspage','www.macromedia.com/go/getflashplayer','movie','dmxFlashGallery2' ); //end AC code
</script>

...but the corresponding ASP version does not work:

'Gallery=gallery.xml?PhotoCategoryID=<%= Request.QueryString("PhotoCategoryID" %>'

...and here it is in context:

<script type="text/javascript">
AC_FL_RunContent( 'codebase','download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','600','height','650','id','Gallery1','align','middle','src','dmxFlashGallery2','quality','best','flashvars','Gallery=gallery.xml?PhotoCategoryID=<%= Request.QueryString("PhotoCategoryID" %>','scale','noscale','bgcolor','#333333','pluginspage','www.macromedia.com/go/getflashplayer','movie','dmxFlashGallery2' ); //end AC code
</script>

The issue appears to be the = sign between PhotoCategoryID and <%. If I remove it, everything works great (although the XML file uses default values for the <photo> tags instead of the value specified in the QueryString), but when that = sign is there I get:

[Internal DMX FlashGallery (v2.03) Error]
Unable to load gallery data from the XML file.
Error message: [Transaction.ErrorMessage(103)] Unable to retrieve the XML data from the server. Please check your configuration.

Is the problem a syntax issue with Javascript that I'm unaware of? <BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote> <BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Replies

Replied 06 Nov 2008 08:11:27
06 Nov 2008 08:11:27 Jeff K replied:
Is anyone aware of a ASCII syntax I can use to keep the = sign from blowing up the script? (& #61 or 3D etc.)???

Edited by - on 06 Nov 2008 08:15:08

Edited by - on 06 Nov 2008 08:15:42
Replied 06 Nov 2008 12:26:25
06 Nov 2008 12:26:25 Miroslav Zografski replied:
Hi Jeff,

There are three places where you need to change the appearance of Gallery property - in AC_FL_RunContent, in param tag and in embed tag. Have you done that?

also can I have full code of the included DFG?

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 06 Nov 2008 12:46:20
06 Nov 2008 12:46:20 Miroslav Zografski replied:
HI Jeff,

the URI ecoding for "=" sign is %3D

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 06 Nov 2008 18:14:03
06 Nov 2008 18:14:03 Jeff K replied:
Thanks Miro, Here's my code:

--------------------------------------------------------------------------------
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;script src="AC_RunActiveContent.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;!-- InstanceParam name="Body_onLoad" type="text" value="" --&gt;

&lt;/head&gt;

&lt;body bgcolor="#000000"&gt;
&lt;script type="text/javascript"&gt;
AC_FL_RunContent( 'codebase','download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','600','height','650','id','Gallery1','align','middle','src','dmxFlashGallery2','quality','best','flashvars','Gallery=gallery.xml.php?PhotoCategoryID=&lt;%= Request.QueryString("PhotoCategoryID" %&gt;','scale','noscale','bgcolor','#333333','pluginspage','www.macromedia.com/go/getflashplayer','movie','dmxFlashGallery2' ); //end AC code
&lt;/script&gt;&lt;noscript&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="500" height="550" id="Gallery1" align="middle"&gt;
&lt;param name="FlashVars" value="Gallery=gallery.xml?PhotoCategoryID=&lt;%= Request.QueryString("PhotoCategoryID" %&gt;" /&gt;
&lt;param name="movie" value="dmxFlashGallery2.swf" /&gt;
&lt;param name="quality" value="best" /&gt;
&lt;param name="scale" value="noscale" /&gt;
&lt;param name="bgcolor" value="#333333" /&gt;
&lt;embed src="dmxFlashGallery2.swf" id="Gallery1" quality="best" FlashVars="Gallery=gallery.xml.php?PhotoCategoryID=&lt;%= Request.QueryString("PhotoCategoryID" %&gt;" scale="noscale" bgcolor="#333333" type="application/x-shockwave-flash" width="500" height="550" pluginspage="www.macromedia.com/go/getflashplayer" /&gt;
&lt;/object&gt;&lt;/noscript&gt;
&lt;/body&gt;
&lt;/html&gt;

--------------------------------------------------------------------------------
Here's the XML:

&lt;flashgallery version="1"&gt;
&lt;gallery id="Gallery1"&gt;
&lt;title&gt;&lt;/title&gt;
&lt;meta&gt;
&lt;entry name="backgroundColor"&gt;0x333333&lt;/entry&gt;
&lt;entry name="foregroundColor"&gt;0xFFFFFF&lt;/entry&gt;
&lt;entry name="layout"&gt;2&lt;/entry&gt;

&lt;entry name="photoScale"&gt;0.7&lt;/entry&gt;
&lt;entry name="thumbnailRows"&gt;2&lt;/entry&gt;
&lt;entry name="thumbnailColumns"&gt;5&lt;/entry&gt;
&lt;entry name="thumbnailPadding"&gt;8&lt;/entry&gt;
&lt;entry name="frameColor"&gt;0xFFFFFF&lt;/entry&gt;
&lt;entry name="activeFrameColor"&gt;0xFFFFFF&lt;/entry&gt;

&lt;entry name="frameWidth"&gt;5&lt;/entry&gt;
&lt;entry name="activeFrameWidth"&gt;5&lt;/entry&gt;
&lt;entry name="transition"&gt;mxfade?duration=1000&lt;/entry&gt;
&lt;entry name="noShadow"&gt;true&lt;/entry&gt;
&lt;/meta&gt;
&lt;photo filename="images/photos/katrina5-sept05.jpg" thumbnail="images/photos/thumb_katrina5-sept05.jpg"&gt;&lt;title&gt;katrina5-sept05.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/katrina6-sept05.jpg" thumbnail="images/photos/thumb_katrina6-sept05.jpg"&gt;&lt;title&gt;katrina6-sept05.jpg&lt;/title&gt;&lt;/photo&gt;

&lt;photo filename="images/photos/isabel2-sept03.jpg" thumbnail="images/photos/thumb_isabel2-sept03.jpg"&gt;&lt;title&gt;isabel2-sept03.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/katrina1-sept05.jpg" thumbnail="images/photos/thumb_katrina1-sept05.jpg"&gt;&lt;title&gt;katrina1-sept05.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/katrina2-sept05.jpg" thumbnail="images/photos/thumb_katrina2-sept05.jpg"&gt;&lt;title&gt;katrina2-sept05.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/katrina8-sept05.jpg" thumbnail="images/photos/thumb_katrina8-sept05.jpg"&gt;&lt;title&gt;katrina8-sept05.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/katrina9-sept05.jpg" thumbnail="images/photos/thumb_katrina9-sept05.jpg"&gt;&lt;title&gt;katrina9-sept05.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/st-marteen-france6.jpg" thumbnail="images/photos/thumb_st-marteen-france6.jpg"&gt;&lt;title&gt;st-marteen-france6.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/concordslastflight1.jpg" thumbnail="images/photos/thumb_concordslastflight1.jpg"&gt;&lt;title&gt;concordslastflight1.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/concordslastflight4.jpg" thumbnail="images/photos/thumb_concordslastflight4.jpg"&gt;&lt;title&gt;concordslastflight4.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/concordslastflight5.jpg" thumbnail="images/photos/thumb_concordslastflight5.jpg"&gt;&lt;title&gt;concordslastflight5.jpg&lt;/title&gt;&lt;/photo&gt;

&lt;photo filename="images/photos/DSC03677.JPG" thumbnail="images/photos/thumb_DSC03677.JPG"&gt;&lt;title&gt;DSC03677.JPG&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/DSC03723.JPG" thumbnail="images/photos/thumb_DSC03723.JPG"&gt;&lt;title&gt;DSC03723.JPG&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/DSC03787.JPG" thumbnail="images/photos/thumb_DSC03787.JPG"&gt;&lt;title&gt;DSC03787.JPG&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/st-marteen-france2.jpg" thumbnail="images/photos/thumb_st-marteen-france2.jpg"&gt;&lt;title&gt;st-marteen-france2.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;photo filename="images/photos/st-marteen-france5.jpg" thumbnail="images/photos/thumb_st-marteen-france5.jpg"&gt;&lt;title&gt;st-marteen-france5.jpg&lt;/title&gt;&lt;/photo&gt;
&lt;/gallery&gt;
&lt;/flashgallery&gt;

--------------------------------------------------------------------------------

What's killing me is that the EXACT same code in PHP works (using &lt;?php echo $_GET['PhotoCategoryID'] ?&gt; instead of &lt;%=Request...)

Thanks!
Replied 07 Nov 2008 15:47:17
07 Nov 2008 15:47:17 Miroslav Zografski replied:
Hi Jeff,

Make one xml file with asp extension and try again.
Also change the FlashVars info for gallery xml file in embed tag and in param tag to match.
And... where do you need that variable to go in xml file - "PhotoCategoryID"

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 07 Nov 2008 17:18:57
07 Nov 2008 17:18:57 Jeff K replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Make one xml file with asp extension and try again.
Also change the FlashVars info for gallery xml file in embed tag and in param tag to match.
And... where do you need that variable to go in xml file - "PhotoCategoryID"
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Thanks Miro, I tried that--but it didn't work for some reason (that's how I'm doing it in PHP and it works fine). I'm not sure why it didn't work, but I tried every possible variation.

The final solution to the problem was adding ASP code to the DFG page which (re)creates a new xml file on the server (based on the variable found in the QueryString) every time the DFG page is loaded. This seemed to work fine so that's the solution I'm using. Hope this helps other people as well.
Replied 07 Nov 2008 17:51:45
07 Nov 2008 17:51:45 Miroslav Zografski replied:
Hi Jeff,

So you have a database with predefined properties for the gallery as well as different list of images. And you are trying to have DFG xml file generated dynamically depending on the QueryString in URLParameeter. ...

I'll try to create such gallery as well, so I can help you better.

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------
Replied 08 Nov 2008 08:29:34
08 Nov 2008 08:29:34 Jeff K replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hi Jeff,

So you have a database with predefined properties for the gallery as well as different list of images. And you are trying to have DFG xml file generated dynamically depending on the QueryString in URLParameeter. ...

-----------------------------------
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

That's correct. It works perfectly in PHP, but I needed to do things a little differently in ASP for some reason. I got it working using the method described above which involves a few extra moving parts--but it seems to work great now. Thanks for replying Miro. I'm good-to-go now, so we can consider this one resolved. Hopefully these notes will help other developers who may go down that path.
Replied 10 Nov 2008 08:19:14
10 Nov 2008 08:19:14 Miroslav Zografski replied:
Hi Jeff,

Glad to help.

Regards,

M.Zografski

-----------------------------------
DMXZone.com Support Team
-----------------------------------

Reply to this topic