Active Slideshow Pro Support Product Page

This topic was archived

Dynamic Image loading with PHP

Asked 02 Apr 2009 03:37:09
1
has this question
02 Apr 2009 03:37:09 J. Peter Horne posted:
I've read that it's possible to dynamically assign images to Slideshow Pro from a database. I, on the other hand, have been unable in my initial attempts to make this happen.

Here's what I've got:

Active SlideShow Pro 1.5.6
Dreamweaver CS3 v9 b3481
Apache 2.2
PHP 5.x
Filemaker Server v9.0.3

Here's the code I've generated:
 <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0','width','450','height','300','id','slideshow','align','middle','src','slideshowpro','wmode','window','quality','best','flashvars','xmlFile=slideshow.php&preloaderBackColor=0x0099FF&preloaderBorderColor=0xCCCCCC','scale','noscale','bgcolor','#FFFFFF','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','slideshowpro' ); //end AC code
</script>

<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="450" height="300" id="slideshow" align="middle">
              <param name="FlashVars" value="xmlFile=slideshow.php&preloaderBackColor=0x0099FF&preloaderBorderColor=0xCCCCCC" />
              <param name="movie" value="slideshowpro.swf" />
              <param name="quality" value="best" />
              <param name="scale" value="noscale" />
              <param name="wmode" value="window" />
              <param name="bgcolor" value="#FFFFFF" />
              <embed src="slideshowpro.swf" id="slideshow" wmode="window" quality="best" flashvars="xmlFile=slideshow.php&preloaderBackColor=0x0099FF&preloaderBorderColor=0xCCCCCC" scale="noscale" bgcolor="#FFFFFF" type="application/x-shockwave-flash" width="450" height="300" pluginspage="http://www.macromedia.com/go/getflashplayer" />            
</object>
</noscript>

and
<?php require_once('Connections/gallery_connection.php'); ?>
<?php
$slideShow-Set_find = $gallery_connection->newFindCommand('transfer');
$slideShow-Set_findCriterions = array('Record_Number'=>'=='.fmsEscape($_REQUEST['Record_Number']),);
foreach($slideShow-Set_findCriterions as $key=>$value) {
    $slideShow-Set_find->AddFindCriterion($key,$value);
}

fmsSetPage($slideShow-Set_find,'slideShow-Set',10); 

$slideShow-Set_result = $slideShow-Set_find->execute(); 

if(FileMaker::isError($slideShow-Set_result)) fmsTrapError($slideShow-Set_result,"error.php"); 

fmsSetLastPage($slideShow-Set_result,'slideShow-Set',10); 

$slideShow-Set_row = current($slideShow-Set_result->getRecords());

 
?>
<?php foreach($slideShow-Set_result->getRecords() as $slideShow-Set_row){ ?>
  <slideshow loop="true" stream="true" random="false" bgColor="0xFFFFFF" flash8="false" showMute="true" margin="5" mutecolor="0xFFFFFF">
  <slide url="<?php echo $slideShow-Set_row->getField('Link_Web'); ?>" duration="3" fill="squeeze" background="0x000000">
    <transition effect="fade" position="0" easing="Linear" duration="2" />
    <kenburns panstart="9" panend="9" zoomstart="1.3" zoomend="1.3" />
  </slide>
  
  <?php } ?>
</slideshow>

When I load the page it causes the browser (pick your type or OS) to hang.

Am I missing something in the code? Is this an issue with how Filemaker, PHP, and Slideshow want to work together - or don't want to work together?

Thanks in advance for any advise

Replies

Replied 02 Apr 2009 12:31:21
02 Apr 2009 12:31:21 Miroslav Zografski replied:
Hi J.Peter,

I cannot tell if the issue is caused by the Filemaker or not. I can give you a way to debug your code. Just place some echoes in key places to see how the data is provided from database and compare the output with one non-dynamical xml file.
But I guess that it is very likely to come out that Filemaker is the wrong component for what you want to achieve.

Regards,
Replied 08 Apr 2009 20:23:59
08 Apr 2009 20:23:59 J. Peter Horne replied:
Thanks for the response.

I apologize for not getting back sooner. Been busy.

Firstly, .php files would not parse. XML files where the only working solution.

Then I came up with a convoluted work around where I generate the <script>, and <noscript>, code inside of filemaker. Using a calculation field that replaces the "generic file name.xml" with the "actual file name.xml". At least covers this part of the process. Still need to generate the .xml file individually.

Haven't posted solution on company website, however, I have with my personal website www.thehornes.org.

As time permits (all this web stuff is more of a hobby for me) I'll try your suggestion and see if I can find where the issue is.

Thanks
Replied 13 Apr 2009 11:33:55
13 Apr 2009 11:33:55 George Petrov replied:
HI J. Peter,

We have a video tutorial about this and how it can be done much easier in DW.

Check it out: www.dmxzone.com/go?11468

Greetings,
George

Reply to this topic