Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with flashgallery

0 views
Skip to first unread message

Netman

unread,
Jan 2, 2010, 5:38:24 PM1/2/10
to
Hello!

I try to use http://developer.asymbio.net/category/flash-gallery with xml
created by php file (called pokazgalerie.php)

I have got such code:

<div id="gallery">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0"
width="800" height="690" id="gallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie"
value="gallery.swf?xmlpics=http://www.webpage.com/pokazgalerie.php?idgal=<?=$_GET["id_galerii"];
?>" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="bgcolor" value="#000000" />
<embed
src="gallery.swf?xmlpics=http://www.webpage.com/pokazgalerie.php?idgal=<?=$_GET["id_galerii"];
?>" quality="high" allowFullScreen="true" scale="noscale" bgcolor="#000000"
width="800" height="690" name="gallery" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>


When I use static xml everything works, but I cannot force gallery.swf file
to get photos from php file which is xml file

pokazgalerie.php looks like this:

$sql="SELECT f.zdjecie_duze, f.zdjecie_male, f.opis_zdjecia
FROM ".$appconf["table_prefix"]."fotografie f
WHERE f.nazwa_galerii = (SELECT distinct(f1.nazwa_galerii) naz_gal FROM
".$appconf["table_prefix"]."fotografie f1 WHERE
f1.id=".addslashes($_GET["idgal"]).") AND
f.id_kategorii=".addslashes($_GET["idkat"])."
ORDER BY f.data_wgrania DESC";

ob_start();

echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'.chr(10);
echo '<images>';

$resultw=mysql_query($sql);
while ($wiersz = mysql_fetch_array($resultw, MYSQL_ASSOC))
{

echo ' <pic>'.chr(10);
//echo '
<image><![CDATA['."zdjecia/".$wiersz["zdjecie_duze"].']]></image>'.chr(10);
echo '
<image><![CDATA['."zdjecia/".$wiersz["zdjecie_male"].']]></image>'.chr(10);
echo '
<thumbnail><![CDATA['."zdjecia/".$wiersz["zdjecie_male"].']]></thumbnail>'.chr(10);
echo '
<caption><![CDATA['.$wiersz["opis_zdjecia"].']]></caption>'.chr(10);
echo ' </pic>'.chr(10);
}

echo '</images>'.chr(10);

header('Content-type: text/xml');
ob_flush();

This file above returns me proper xml file. When I save it into xml file and
use it in the script of flash gallery everything works, but I want to create
it dynamicaly.

Can you help me?
I will really apprieciate your help
netman


Jerry Stuckle

unread,
Jan 3, 2010, 2:44:41 PM1/3/10
to

No idea why this may be failing, because I have no idea what
flashgallery requires. But I also suspect this isn't the entire code in
pokazgalerie.php.

A couple of things. First of all, you need to validate the parameters
passed to both scripts as GET or POST parameters. Also, if you code
your script correctly, you don't need to buffer the output. Output
buffering like this is a sure indicator of poor code design.

I suggest there is a difference between the file which you are
outputting here and what's written to a file. Alternatively the headers
may be different between the two methods - use the Firefox Live HTTP
Headers extension to see what the headers look like between the two.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

0 new messages