list of images for slide list of images for slide
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

list of images for slide

Started by phill104, September 13, 2007, 12:39:57 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

phill104

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)

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

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

?>


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.
Closed corresponding thread.

phill104

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.

<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

$slideshow[ 'slide' ][ $i ] = array ( 'url' => $url[$i+1]  , 'background' => "ffffff");

and change it to this

$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
It is a mistake to think you can solve any major problems just with potatoes.

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

Micheal B

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.

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

Joachim Müller

Quote from: phill104 on October 01, 2007, 08:27:54 PM
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