Flash Album Generator 2 Support Product Page

This topic was archived

Making flash gallery dynamic

Asked 11 Jul 2007 12:38:56
1
has this question
11 Jul 2007 12:38:56 barbara windner posted:
I am trying to make the flashgallery dynamic with the data from an mysql database. I changed the .xml file to .php file and everything works, but at the moment I insert a recordset, the xml file is corrupted and I get the error message:
[Internal DMX FlashGallery (v2.01) Error]
Unable to load gallery data from the XML file.
Error message: [Transaction.ErrorMessage(102)] XML Parsing error
undefined
Do I have to put a special header or some kind of php echo that it works??
I was looking for the problem in the forum and tried it several times, but did not find a solution!
Many Thanks if anybody can help me
and greating from Salzburg!!
Barbara

Replies

Replied 11 Jul 2007 14:47:16
11 Jul 2007 14:47:16 Georgi Kralev replied:
Hi Barbara,

You can check the following Flash tutorial for Active Slideshow Pro.
www.dmxzone.com/ShowDetail.asp?NewsId=11468

It shows how to be build dynamic xml.

Then if you still experience some difficulties post a link to your page and I will try to examine what is the problem.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 11 Jul 2007 15:08:02
11 Jul 2007 15:08:02 barbara windner replied:
Thank you very much for answering!
I tried because I saw the Flash Tutorial - and it seems realy easy!
Here you can find my test-page www.weblinedesign.at/flasshow/

If you find time, please take a look on my page, it seems that the xml, which I changed to php is corrupted:
here the source:
<?php require_once('Connections/flash.php'); ?>
<?php
if (!function_exists("GetSQLValueString") {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string" ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "" ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "" ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_flash, $flash);
$query_test = "SELECT * FROM flasshow";
$test = mysql_query($query_test, $flash) or die(mysql_error());
$row_test = mysql_fetch_assoc($test);
$totalRows_test = mysql_num_rows($test);
?>
<?xml version="1.0" encoding="UTF-8"?><flashgallery version="1">
<gallery id="test">
<title>test</title>
<meta>
<entry name="backgroundColor">0x999999
</entry>
<entry name="foregroundColor">0x000000</entry>
<entry name="layout">2</entry>
<entry name="photoScale">0.7</entry>
<entry name="thumbnailRows">2</entry>
<entry name="thumbnailColumns">5</entry>
<entry name="thumbnailPadding">10</entry>
<entry name="frameColor">0xFFFFFF</entry>
<entry name="activeFrameColor">0xFFFFFF</entry>
<entry name="frameWidth">1</entry>
<entry name="activeFrameWidth">6</entry>
<entry name="transition">mxfade?duration=1000</entry>
</meta>
<photo id="SCHAUP83_jpg" filename="images/sauna/SCHAUP83.jpg" thumbnail="images/sauna/thumbs/SCHAUP83.jpg">
<title>SCHAUP83.jpg</title>
</photo>
</gallery>
</flashgallery>
<?php
mysql_free_result($test);
?>

Thank you very much for helping me!

Edited by - findl on 11 Jul 2007 15:24:12
Replied 11 Jul 2007 18:33:00
11 Jul 2007 18:33:00 Georgi Kralev replied:
Hi Barbara,

There is a problem with your PHP syntax. The php file that return the xml (test_xml.php) gives the following error:

<b>Parse error: parse error, unexpected T_STRING in /homepages/30/d15623441/htdocs/flasshow/test_xml.php on line 38 </b>

I could not find any error into the code that you have posted.

Therefore, I believe that the problem is into your Connections/flash.php file.
Check it carefully for any syntax errors.

Regards,




Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 11 Jul 2007 20:14:30
11 Jul 2007 20:14:30 barbara windner replied:
I can not believe, because it is the simple connection of Dreamweaver:
&lt;?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_flash = "hereisthehostname";
$database_flash = "hereisthedb";
$username_flash = "hereistheusername";
$password_flash = "hereisthepassword";
$flash = mysql_pconnect($hostname_flash, $username_flash, $password_flash) or trigger_error(mysql_error(),E_USER_ERROR);?&gt;

I think the problem is, that the .php file does not interpret the xml content in the right way.
Maybe somebody has already realised the flashgallery with php and mysql and can show me the source of the connection, the xml.php
That would be great - thank's in advantage for any help I am realy desperate
Replied 12 Jul 2007 10:05:02
12 Jul 2007 10:05:02 Georgi Kralev replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> I can not believe, because it is the simple connection of Dreamweaver<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Yes, your connection file is also Ok.

But, if you try to load the following page, you will see the error.
www.weblinedesign.at/flasshow/test_xml.php

Before, using test_xml.php in Flash Album Generator 2 you have to clear all the errors in it.

Previously, I have forget to check the line of the error (which is 38) and wrongfully presumed that the problem is into the connection file.
If you check the line it is &lt;?xml version="1.0" encoding="UTF-8"?&gt;

This means that in your php.ini it is turned on the following variable short_open_tag.
Due to this your PHP interpret xml &lt;? and ?&gt; tag as of PHP and give syntax error.

To fix this you have two solution:
* Replace line &lt;?xml version="1.0" encoding="UTF-8"?&gt; with &lt;?php echo '&lt;?xml version="1.0" encoding="UTF-8"?&gt;' ?&gt;

OR

* Set short_open_tag = Off into your php.ini.

<b>Note:</b> Changing php.ini will affect all PHP application of your server and some of them could raise errors. Therefore, it is not recommended (I have include it only for completeness).

I have also noticed that you do not use the following function: GetSQLValueString.
Therefore, it can be safely removed from you code.

Also, it appear that some of the tags of Flash Album Generator 2 are missing from your file. Make sure that all the tags from the original xml are available.

I hope this will help you to clear out all the issues with the dynamic Flash Album.

Regards,


Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 12 Jul 2007 12:02:59
12 Jul 2007 12:02:59 barbara windner replied:
Thank you very much - now it works! This was realy a great help and I am sure useful for many user!!
Thanks again!

Best wishes Barbara

Reply to this topic