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: list of images for slide  (Read 8249 times)

0 Members and 1 Guest are viewing this topic.

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
list of images for slide
« 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.

I'm working on a flash slideshow to display on my homepage and the flash side is working. using the code below I can generate a random list of imaged from my coppermine gallery. This will select 15 images at random and create a list. (code pinched & modified from one of rhpmedia's projects)

Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
$xml '<image_folder></image_folder>';
if (
$FORBIDDEN_SET != ""$FORBIDDEN_SET "AND $FORBIDDEN_SET";
$result mysql_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename LIKE '%.jpg' $FORBIDDEN_SET ORDER BY RAND() LIMIT 15");
while (
$row mysql_fetch_array($result)) 
{
$type 'normal';
$xml .= "".get_pic_url($row$type) ."";
}
echo 
$xml;



?>

Now I need to put it into the slideshow.

This is the code I would use to select from a list of images named sailor (1-15).jpeg but how would I take the above list and feed it into the code below.

Code: [Select]
<?php

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

//add 15 slides
for ( $i=0$i<15$i++ ){
$slideshow'slide' ][ $i ] = array ( 'url' => "images/sailor$i.jpg" );
}

//send the slideshow data
Send_Slideshow_Data $slideshow );

?>


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: list of images for slide
« Reply #1 on: September 13, 2007, 02:54:12 pm »

I was going to do this with cpmfetch but after 1 week of struggling I've decided to try a different tack.
Closed corresponding thread.
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: list of images for slide
« Reply #2 on: September 13, 2007, 03:07:08 pm »

I have finally got the slideshow working as you can see in the demo here.

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

To get this working requires 5 files added to your coppermin source directory as attached. To run the program you simply call slide.php. From my site above I'm doing this in an iframe.

Code: [Select]
<iframe src="http://www.windsurf.me.uk/cpg133/slide.php" frameborder="0" scrolling="Auto" width="340" height="270" title="Map">
News </iframe>

You can select the number of slides in the show by modifying flashthumbs.php and source.php

you can also modify source.php to select the duration of each slide or different transition modes.

simply find this line

Code: [Select]
$slideshow[ 'slide' ][ $i ] = array ( 'url' => $url[$i+1]  , 'background' => "ffffff");
and change it to this

Code: [Select]
$slideshow[ 'slide' ][ $i ] = array ( 'url' => $url[$i+1]  , 'background' => "ffffff" , 'duration' => x);
where x is your duration in seconds.

To change transition type simply add below the above line

$slideshow[ 'transition' ][ $i ] = array ( 'type' => "z", 'duration' => y );

Where "z" can be "drop","fade_to_black" or "push_up" and y is the duration of the transition in seconds.

Flash code kindly supplied by my good friend Mike
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: list of images for slide
« Reply #3 on: September 14, 2007, 11:47:54 am »

To demonstrate the 4 different transision types I've created the following demo's

http://www.windsurf.me.uk/cpg133/slide.php  is a simple fade to the next image.

http://www.windsurf.me.uk/cpg133/slide1.php  each image drops into view.

http://www.windsurf.me.uk/cpg133/slide2.php  each image gets pushed up by the next.

http://www.windsurf.me.uk/cpg133/slide3.php  fades to the next image via black.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: list of images for slide
« Reply #4 on: September 16, 2007, 11:34:02 am »

After a couple of days testing I have encountered a little problem. If Nibblers youtube mode is installed the slideshow crashes when it picks a youtube file. It ignores all non .jpg file type apart from these.

Anyone got any idea how to get round this and stop flashthumbs.php from picking those images. At the moment it is rare as there are only 12 youtube links out of 1699 files but as they increase I can see this becoming more common.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Micheal B

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: list of images for slide
« Reply #5 on: October 01, 2007, 05:28:25 pm »

Thanks Phil104 for a great bit of work.

I've been looking for something like this for ages. It would be nice though to be able to limit to individual categories instead of the whole gallery.

Also, maybe you should rename the thread to "standalone slideshow for coppermine" or something like that as I only came accross it by chance and make the first post the all the info on the mod instead of a request for help.

Thanks for listening.
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4822
    • Windsurf.me
Re: list of images for slide
« Reply #6 on: October 01, 2007, 08:27:54 pm »

Thanks for your feedback Micheal.

I would edit the thread but I do not have permissions to. I believe the coppermine team had problems in the past making it nessessary to put the restriction in place.
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: list of images for slide
« Reply #7 on: October 02, 2007, 08:14:09 am »

I would edit the thread but I do not have permissions to. I believe the coppermine team had problems in the past making it nessessary to put the restriction in place.
That's correct - some users abused the edit feature in the past to render entire threads useless by editing out their postings. That's why we disabled this option for regular users. If you want a clean thread that announces your mod and if you think that your mod is mature enough, please start a new thread with "clean" instructions (what your mod does and how to apply it) and add a link to that new thread that points to this thread (as a reference to how this mod was designed for users interessted in the development stage of the mod). A moderator will then move your new thread to the mod-contributions board. Thanks in advance.

Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.