Advanced search  

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]

Pages: [1]   Go Down

Author Topic: My flash slideshow  (Read 9533 times)

0 Members and 1 Guest are viewing this topic.

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
My flash slideshow
« 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

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.

Code: [Select]
<!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.

Code: [Select]
<?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 );


?>
« Last Edit: September 13, 2007, 02:53:09 pm by GauGau »
Logged
It is a mistake to think you can solve any major problems just with potatoes.

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: My flash slideshow
« Reply #1 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/



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

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: My flash slideshow
« Reply #2 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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: My flash slideshow
« Reply #3 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?

Code: [Select]
<?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)

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

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: My flash slideshow
« Reply #4 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" );

Code: [Select]
<?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);


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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: My flash slideshow
« Reply #5 on: September 13, 2007, 02:52:54 pm »

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.
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: My flash slideshow
« Reply #6 on: September 13, 2007, 03:08:13 pm »

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

Page created in 0.024 seconds with 19 queries.