coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: phill104 on September 08, 2007, 09:23:01 PM

Title: My flash slideshow
Post by: phill104 on September 08, 2007, 09:23:01 PM
I'm working on a little flash slideshow for my site as can be seen here

http://www.windsurf.me.uk/slide.php (http://www.windsurf.me.uk/slide.php)

It currently uses 4 files:- slideshow.php, slideshow.swf, slide.php and source.php

Slide.php is the final webpage and is simply this code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<BODY bgcolor="#FFFFFF">
<?php

//include slideshow.php in your script
include "slideshow.php";



//insert the slideshow.swf flash file into the web page
//tell slideshow.swf to get the slideshow's data from sample.php created in the first step
//set the slideshow's width to 320 pixels and the height to 240
echo Insert_Slideshow "slideshow.swf""source.php" 320240 );

?>





</body>
</html>


The bit I'm having trouble with is source.php. I would like it to randomly select 15 images from the coppermine gallery on my site and input these into the slideshow but I'm just not sure how to do it. I'm guessing cpmfetch will do the trick.

Here is the source.php code that selects the images at present. It currently just selects 3 fixed images and is self explanatry.

<?php

//include slideshow.php to access the Send_Slideshow_Data function
include "slideshow.php";

//add 3 slides
$slideshow'slide' ][ ] = array ( 'url' => "../Images/normal_loop.jpg" );
$slideshow'slide' ][ ] = array ( 'url' => "../Images/normal_IMG_0051AR.jpg" );
$slideshow'slide' ][ ] = array ( 'url' => "../Images/Andy Leeks.jpg" );

//send the slideshow data
Send_Slideshow_Data $slideshow );


?>
Title: Re: My flash slideshow
Post by: phill104 on September 10, 2007, 10:29:45 AM
I still haven't managed to work out how to get cpmfetch to inject random jpegs but have got the the final code working if anyone else would like it (attached to this post)

The working slideshow (with images selected from a fixed list until I suss out how to do it) can be seen here half way down the page on the right.

http://www.windsurf.me.uk/ (http://www.windsurf.me.uk/)



Title: Re: My flash slideshow
Post by: phill104 on September 10, 2007, 10:32:28 AM
p.s. I forgot ::)  to mention that the above slideshow code was supplied to me by my good friend Mike  ;D.
Title: Re: My flash slideshow
Post by: phill104 on September 12, 2007, 11:52:28 AM
I've been trying to get cpmfetch to output a random url as a variable to inject into the above script using the following code but all it returns is "Array", any idead as to what I am doing wrong?

<?php

//include cpmfetch.php to get the data
include "cpg133/cpmfetch/cpmfetch.php";


$objCpm = new cpm("cpg133/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_setReturnType("resultset");
$data $objCpm->cpm_viewRandomMediaFrom 11$options);


echo (
$data)

?>
Title: Re: My flash slideshow
Post by: phill104 on September 12, 2007, 10:11:22 PM
This is begining to drive me nuts. I soo wish my programming skills were better.

This code at the bottom displays the url but how do I turn that into a variable to use in this?

$slideshow[ 'slide' ][ 0 ] = array ( 'url' => "insert urlvariable here" );

<?php

//include cpmfetch.php to get the data
include "cpg133/cpmfetch/cpmfetch.php";

$objCpm = new cpm("cpg133/cpmfetch/cpmfetch_config.php");

$options = array("subtitle" => "{{fullPathToNormal}}");
$data $objCpm->cpm_viewRandomMediaFrom("cat=1",11$options);


?>

Title: Re: My flash slideshow
Post by: Joachim Müller on September 13, 2007, 02:52:54 PM
Quote from: phill104 on September 13, 2007, 12:39:57 AM
I was going to do this with cpmfetch but after 1 week of struggling I've decided to try a different tack.
This means to me that this thread can be closed. Marking thread accordingly. In the future, please resolve your threads.
Title: Re: My flash slideshow
Post by: phill104 on September 13, 2007, 03:08:13 PM
Sorry, was too busy struggling with the code :-[