My flash slideshow My flash slideshow
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

My flash slideshow

Started by phill104, September 08, 2007, 09:23:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

phill104

I'm working on a little flash slideshow for my site as can be seen here

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 );


?>
It is a mistake to think you can solve any major problems just with potatoes.

phill104

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/



It is a mistake to think you can solve any major problems just with potatoes.

phill104

p.s. I forgot ::)  to mention that the above slideshow code was supplied to me by my good friend Mike  ;D.
It is a mistake to think you can solve any major problems just with potatoes.

phill104

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)

?>
It is a mistake to think you can solve any major problems just with potatoes.

phill104

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);


?>

It is a mistake to think you can solve any major problems just with potatoes.

Joachim Müller

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.

phill104

Sorry, was too busy struggling with the code :-[
It is a mistake to think you can solve any major problems just with potatoes.