Get ready for BLACK FRIDAY shopping starting in

Forums

PHP

This topic is locked

Dynamic Flash Album Generator?

Posted 11 May 2007 18:12:25
1
has voted
11 May 2007 18:12:25 Bobby Edgar posted:
Is it possible to turn the flash album generated image viewer into a dynamic one using PHP? Like with Active Slideshow? Converting the xml file into a php file and then being able to replace the static images with dynamic ones from a recordset?

Any help would be greatly appreciated.

Replies

Replied 22 Aug 2007 15:55:27
22 Aug 2007 15:55:27 Bobby Edgar replied:
Hello? Does anyone know how to do this?

The tutorial for Active Slideshow states that it can be done for this extension, but I don't see how.
Replied 22 Aug 2007 18:04:50
22 Aug 2007 18:04:50 Georgi Kralev replied:
Hi Bobby,

Check the following FAQ:
www.dmxzone.com/ShowDetail.asp?NewsId=13948

I hope that you will find it useful.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 22 Aug 2007 19:12:31
22 Aug 2007 19:12:31 Bobby Edgar replied:
I've gotten to work a little bit. I converted the xml file to php and added a recordset. I can now name the Gallery and the images dynamically. However, when i try to load an image dynamically it doesn't work.

Here's the sample of one with Dynamic naming of the Gallery title and image names, but with static images. stagepros.com/theatre/dyn_gallery.php and the xml file is located at stagepros.com/theatre/slideshow/gallery_dyn_xml.php

Here's a copy of the same file but with adding dynamic images. As you can see...neither the thumb or image are displayed for photo 1 which is the dynamic one. The link for it still works to switch between the two images though. stagepros.com/theatre/dyn_gallery_no_good.php and the xml file is located at stagepros.com/theatre/slideshow/gallery_dyn_xml_no_good.php

The dynamic image it's attemting to display is stagepros.com/get/bobbyedgar/photos/339563786_1.jpg and it's thumb is located at stagepros.com/get/bobbyedgar/photos/thumbs/thumb_339563786_1.jpg

It doesn't seem to be able to pull any photos from outside of the webspace?

If i'm able to display some dynamic info then why won't it display the photos too?

I'm so close to getting this to work...I can almost taste it. Your help is so greatly appreciated. Please HELP.
Replied 23 Aug 2007 10:19:49
23 Aug 2007 10:19:49 Georgi Kralev replied:
Hi Bobby,

Flash Album Generator cannot use such path:
stagepros.com/get/bobbyedgar/photos/339563786_1.jpg

The path should be relative. For example, it should look something like this:
../../get/bobbyedgar/photos/339563786_1.jpg

If you store the full URL of your images into the database, you will have to modify it to present the relative path.

The best way to test if your dynamically generated path is correct is to copy it and place it into the xml file of your static gallery.
If the static gallery also does not work then this is not the correct path.

I hope this will help you.

Regards,




Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 23 Aug 2007 18:25:20
23 Aug 2007 18:25:20 Bobby Edgar replied:
Ok. I got the photos to pull just fine kinda. I've created 2 examples of my problem.

For the first one, I created a recordset using an "Entered Value" that is my UniqueID. No problem. It displays the photos just fine.

stagepros.com/theatre/static_gallery.php

I also created a recordset to get the UniqueID by passing it via a URL.

stagepros.com/theatre/test_dynamic_gallery.php will pass the UniqueID to Dynamic_Gallery.php This is one that fails.

Basically when it loads the UniqueID that I manually input it works fine. When it passes the UniqueID vie URL to the gallery it doesn't work.

The examples explain in detail where the problem is.

You're awesome for all of your help George!
Replied 28 Aug 2007 16:11:15
28 Aug 2007 16:11:15 Georgi Kralev replied:
Hi Bobby,

Sorry for the late response. I was busy and I couldn't write you sooner.

I have checked your links.
The generated xml files looks fine but I have noticed the following issue.

When the <b>static_gallery.php</b> request the images the GET Requests looks like this:
GET /get/BobbyEdgar/Photos/Thumbs/thumb_339563786_1.jpg HTTP/1.1

But when it is executed <b>Dynamic_Gallery.php?UniqueID=1264316765_1</b> there are only two requests:
GET /get//Photos/Thumbs/thumb_ HTTP/1.1
GET /get//Photos/ HTTP/1.1

In the request is missing both part of the path (ScottHali) and the image name.

But the path into the generated xml looks like this:
../../get/ScottHali/Photos/1264316765_1.jpg

It is not clear for me why this issue appear. To narrow the issue make Dynamic_Gallery_xml.php?UniqueID=1264316765_1
to generate the exact xml as those of Static_Gallery_xml.php (also to return the same images and the path to be the same).

And check if the issue will appear again.

Regards,



Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 28 Aug 2007 17:33:57
28 Aug 2007 17:33:57 Bobby Edgar replied:
I still don't get it. It's not passing the details. All looks the same, but it doesn't work dynamically. It passes the ID to the xml file and the xml file looks like it's passing the ID back to the gallery. If it's passing the correct info...why doesn't it display the gallery correctly?

I've printed out both source codes. One being the Static one which pulls my info using my ID that's entered, and the Dynamic one that pulled my info using my ID using the URL passing. Both are absolutley identical. No differences at all. Could it be that the Gallery just can't work while passing URL info?

Edited by - edgarb on 28 Aug 2007 17:43:12
Replied 28 Aug 2007 18:24:19
28 Aug 2007 18:24:19 Georgi Kralev replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Could it be that the Gallery just can't work while passing URL info<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
The gallery work fine with with parameter in the URL on my computer.
This is the example that I have use for the FAQ:
www.dmxzone.com/ShowDetail.asp?NewsId=13948

But, if you want to test the issue you could try the following.
Set the ID of your dynamic gallery to 339563786_1 in the php file that generate the xml (Dynamic_Gallery_xml.php)
Instead of passing it as parameter.

If the problem is with the Parameter passing, then the gallery should start to work.
If not the result will be the same.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 28 Aug 2007 18:39:47
28 Aug 2007 18:39:47 Bobby Edgar replied:
Nope. Nothing. It just does not work! The Gallery is coded as such:

<pre id=code><font face=courier size=2 id=code> &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="600" height="600" id="New_Gallery" align="middle"&gt;
&lt;param name="FlashVars" value="Gallery=show/Dynamic_Gallery_xml.php?UniqueID=&lt;?php echo $row_rsPhotos['UniqueID']; ?&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="#FFFFFF" /&gt;
&lt;embed src="dmxFlashGallery2.swf" id="New_Gallery" quality="best" FlashVars="Gallery=show/Dynamic_Gallery_xml.php?UniqueID=&lt;?php echo $row_rsPhotos['UniqueID']; ?&gt;" scale="noscale" bgcolor="#FFFFFF" type="application/x-shockwave-flash" width="600" height="600" pluginspage="www.macromedia.com/go/getflashplayer" /&gt;
&lt;/object&gt;</font id=code></pre id=code>

The XML file is coded as such:

<pre id=code><font face=courier size=2 id=code>&lt;?php
$maxRows_rsPhotos = 18;
$pageNum_rsPhotos = 0;
if (isset($_GET['pageNum_rsPhotos'])) {
$pageNum_rsPhotos = $_GET['pageNum_rsPhotos'];
}
$startRow_rsPhotos = $pageNum_rsPhotos * $maxRows_rsPhotos;

$colname_rsPhotos = "-1";
if (isset($_GET['UniqueID'])) {
$colname_rsPhotos = (get_magic_quotes_gpc()) ? $_GET['UniqueID'] : addslashes($_GET['UniqueID']);
}
mysql_select_db($database_StageJobs, $StageJobs);
$query_rsPhotos = sprintf("SELECT * FROM Photos WHERE UniqueID = '%s'", $colname_rsPhotos);
$query_limit_rsPhotos = sprintf("%s LIMIT %d, %d", $query_rsPhotos, $startRow_rsPhotos, $maxRows_rsPhotos);
$rsPhotos = mysql_query($query_limit_rsPhotos, $StageJobs) or die(mysql_error());
$row_rsPhotos = mysql_fetch_assoc($rsPhotos);

if (isset($_GET['totalRows_rsPhotos'])) {
$totalRows_rsPhotos = $_GET['totalRows_rsPhotos'];
} else {
$all_rsPhotos = mysql_query($query_rsPhotos);
$totalRows_rsPhotos = mysql_num_rows($all_rsPhotos);
}
$totalPages_rsPhotos = ceil($totalRows_rsPhotos/$maxRows_rsPhotos)-1;?&gt;
&lt;?PHP '&lt;?xml version="1.0" encoding="UTF-8"?&gt;' ?&gt;
&lt;flashgallery version="1"&gt;
&lt;gallery id="New_Gallery"&gt;
&lt;title&gt;&lt;?php echo $row_rsPhotos['SP_FirstName']; ?&gt;'s Gallery&lt;/title&gt;
&lt;meta&gt;
&lt;entry name="backgroundColor"&gt;0xFFFFFF&lt;/entry&gt;
&lt;entry name="foregroundColor"&gt;0x000000&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;3&lt;/entry&gt;
&lt;entry name="thumbnailColumns"&gt;6&lt;/entry&gt;
&lt;entry name="thumbnailPadding"&gt;10&lt;/entry&gt;
&lt;entry name="frameColor"&gt;0x666666&lt;/entry&gt;
&lt;entry name="activeFrameColor"&gt;0x000000&lt;/entry&gt;
&lt;entry name="frameWidth"&gt;1&lt;/entry&gt;
&lt;entry name="activeFrameWidth"&gt;2&lt;/entry&gt;
&lt;entry name="transition"&gt;mxphoto?duration=2000&lt;/entry&gt;
&lt;/meta&gt;
&lt;?php do { ?&gt;
&lt;photo id="&lt;?php echo $row_rsPhotos['Photo_List']; ?&gt;" filename="../../get/&lt;?php echo $row_rsPhotos['SP_FirstName']; ?&gt;&lt;?php echo $row_rsPhotos['SP_LastName']; ?&gt;/Photos/&lt;?php echo $row_rsPhotos['Photo']; ?&gt;" thumbnail="../../get/&lt;?php echo $row_rsPhotos['SP_FirstName']; ?&gt;&lt;?php echo $row_rsPhotos['SP_LastName']; ?&gt;/Photos/Thumbs/thumb_&lt;?php echo $row_rsPhotos['Photo']; ?&gt;"&gt;
&lt;/photo&gt;
&lt;?php } while ($row_rsPhotos = mysql_fetch_assoc($rsPhotos)); ?&gt;
&lt;/gallery&gt;
&lt;/flashgallery&gt;
&lt;?php
mysql_free_result($rsPhotos);
?&gt;
</font id=code></pre id=code>

Using stagepros.com/theatre/Test_Dynamic_Gallery.php you can pass the ID using URL to the gallery. The gallery than takes that info and passes it to the xml file which then return it to the gallery, right?
Replied 28 Aug 2007 18:42:40
28 Aug 2007 18:42:40 Bobby Edgar replied:
Now in contrast...the Static Version of the gallery:

Gallery:

<pre id=code><font face=courier size=2 id=code>&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="600" height="600" id="New_Gallery" align="middle"&gt;
&lt;param name="FlashVars" value="Gallery=Show/Static_Gallery_xml.php" /&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="#FFFFFF" /&gt;
&lt;embed src="dmxFlashGallery2.swf" id="New_Gallery" quality="best" FlashVars="Gallery=Show/Static_Gallery_xml.php" scale="noscale" bgcolor="#FFFFFF" type="application/x-shockwave-flash" width="600" height="600" pluginspage="www.macromedia.com/go/getflashplayer" /&gt;
&lt;/object&gt; </font id=code></pre id=code>

The XML File:

<pre id=code><font face=courier size=2 id=code>&lt;?php
$maxRows_rsPhotos = 18;
$pageNum_rsPhotos = 0;
if (isset($_GET['pageNum_rsPhotos'])) {
$pageNum_rsPhotos = $_GET['pageNum_rsPhotos'];
}
$startRow_rsPhotos = $pageNum_rsPhotos * $maxRows_rsPhotos;

mysql_select_db($database_StageJobs, $StageJobs);
$query_rsPhotos = "SELECT * FROM Photos WHERE UniqueID = '339563786_1'";
$query_limit_rsPhotos = sprintf("%s LIMIT %d, %d", $query_rsPhotos, $startRow_rsPhotos, $maxRows_rsPhotos);
$rsPhotos = mysql_query($query_limit_rsPhotos, $StageJobs) or die(mysql_error());
$row_rsPhotos = mysql_fetch_assoc($rsPhotos);

if (isset($_GET['totalRows_rsPhotos'])) {
$totalRows_rsPhotos = $_GET['totalRows_rsPhotos'];
} else {
$all_rsPhotos = mysql_query($query_rsPhotos);
$totalRows_rsPhotos = mysql_num_rows($all_rsPhotos);
}
$totalPages_rsPhotos = ceil($totalRows_rsPhotos/$maxRows_rsPhotos)-1;?&gt;
&lt;?PHP '&lt;?xml version="1.0" encoding="UTF-8"?&gt;' ?&gt;
&lt;flashgallery version="1"&gt;
&lt;gallery id="New_Gallery"&gt;
&lt;title&gt;&lt;?php echo $row_rsPhotos['SP_FirstName']; ?&gt;'s Gallery&lt;/title&gt;
&lt;meta&gt;
&lt;entry name="backgroundColor"&gt;0xFFFFFF&lt;/entry&gt;
&lt;entry name="foregroundColor"&gt;0x000000&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;3&lt;/entry&gt;
&lt;entry name="thumbnailColumns"&gt;6&lt;/entry&gt;
&lt;entry name="thumbnailPadding"&gt;10&lt;/entry&gt;
&lt;entry name="frameColor"&gt;0x666666&lt;/entry&gt;
&lt;entry name="activeFrameColor"&gt;0x000000&lt;/entry&gt;
&lt;entry name="frameWidth"&gt;1&lt;/entry&gt;
&lt;entry name="activeFrameWidth"&gt;2&lt;/entry&gt;
&lt;entry name="transition"&gt;mxphoto?duration=2000&lt;/entry&gt;
&lt;/meta&gt;
&lt;?php do { ?&gt;
&lt;photo id="&lt;?php echo $row_rsPhotos['Photo_List']; ?&gt;" filename="../../get/&lt;?php echo $row_rsPhotos['SP_FirstName']; ?&gt;&lt;?php echo $row_rsPhotos['SP_LastName']; ?&gt;/Photos/&lt;?php echo $row_rsPhotos['Photo']; ?&gt;" thumbnail="../../get/&lt;?php echo $row_rsPhotos['SP_FirstName']; ?&gt;&lt;?php echo $row_rsPhotos['SP_LastName']; ?&gt;/Photos/Thumbs/thumb_&lt;?php echo $row_rsPhotos['Photo']; ?&gt;"&gt;
&lt;/photo&gt;
&lt;?php } while ($row_rsPhotos = mysql_fetch_assoc($rsPhotos)); ?&gt;
&lt;/gallery&gt;
&lt;/flashgallery&gt;
&lt;?php
mysql_free_result($rsPhotos);
?&gt;
</font id=code></pre id=code>
Replied 01 Sep 2007 16:25:45
01 Sep 2007 16:25:45 Bobby Edgar replied:
It seems that your example doesn't work. ie: www.dmxzone.com/ShowDetail.asp?NewsId=13948

I have set it up exactly as you explained and yet nothing.

stagepros.com/Test_Dynamic_Gallery.php allows you to pass the ID
via URL to the page containing the gallery.

stagepros.com/Dynamic_Gallery.php receives the ID passed.

It then sends the ID to stagepros.com/Dynamic_Gallery_xml.php via URL

The ID passes to the pages and yet nothing!

The gallery CAN NOT work with Variable passed via URL. Only entered values.

There is absolutley no reason why my coding shouldn't work.

I can't figure it out and neither can you. Seems it's a dead issue. It's a shame because
it's almost a good extension. If it can't display dynamically...it's not as good using the
the Web Photo Album that Dreamweaver has.

Goto stagepros.com/theatre_Profile_Details.php?UniqueID=339563786_1

Click The "Click Here To View His Photos Within A Gallery" Link. This is the Web Photo Album.
It works perfectly, but doesn't have the slick look. None-The-Less...IT WORKS!

I can't use the extension. Refund.
Replied 03 Sep 2007 09:40:29
03 Sep 2007 09:40:29 Georgi Kralev replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>The gallery CAN NOT work with Variable passed via URL. Only entered values.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Hi Bobby,

I could not find what was the problem with your Gallery but as I mentioned before,
the gallery worked perfectly with variable send through the URL on my computer.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>The gallery work fine with with parameter in the URL on my computer.
This is the example that I have use for the FAQ:
www.dmxzone.com/ShowDetail.asp?NewsId=13948<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

The example was run on Windows XP Pro with web server IIS 5.0 and PHP Version 5.2.0
It worked without any problems.

But if you have problems with the URL parameters for your Gallery you could try to use different approach.
For example try storing the ID into Session variable:

$_SESSION['UniqueID']

I hope this will help you.

Regards,


Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 03 Sep 2007 13:57:42
03 Sep 2007 13:57:42 Bobby Edgar replied:
That doesn't help at all.. A session variable would be fine if I only wanted my users to see their own gallery. That defeats the purpose. The gallery is useless then.

Reply to this topic