For a while I was looking for a slideshow to display images from coppermine on my homepage. I tried a number of things and eventually developed this flash based slideshow.
It is supplied as is so please do not ask for additional features.
It has been designed so it does not interfere with any of the coppermine files. The php was written by me while the flash code was supplied to me by my good friend Mike.
There are a number of modes of operation as you can see in the demo's listed below.
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.
To install simply extract the attached zip file to your coppermine root. This will copy 5 files to your root:-
flashthumb.php, slide.php, slideshow.php, source.php and slideshow.swf
To call the script simply call slide.php . I'm using it in an iframe on my homepage http://www.windsurf.me.uk/index.htm but there are other methods to include the script in your site.
iFrame example
<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:
$slideshow[ 'slide' ][ $i ] = array ( 'url' => $url[$i+1] , 'background' => "ffffff");
and change it to this
Code:
$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.
The size of your images can be set by changing the dimensions in slide.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" , 320, 240 );
and in slideshow.php
function Insert_Slideshow( $flash_file, $php_source, $width=320, $height=240, $license=null ){
You can see the various development stages at this thread.
http://forum.coppermine-gallery.net/index.php?topic=46832.0
Known bugs
If you have the youtube mod installed and the script selects an image from that it will timeout giving an error message in the slideshow. The script selects random .jpg extensions from the entire gallery (or folders selected by flashthumbs.php) but seems to accept the youtube files as an acceptable format. I'll work on this when I get the time.
Many thanks to rhpMedia as I borrowed and modified the code for flashthumbs.php from his excellent image scroller based on iTunes mod.
http://forum.coppermine-gallery.net/index.php?topic=44042.0
Will this open links in a new window? Because i need to know how to do this, thanks.
Unfortunately not. I am however working on a java version which will have that function but don't expect it for a few weeks as I'm off on holiday.
Can anyone tell me how to make the standard cmpg Fetch open in a new window so that i can use Iframe to open a .php file?
This thread doesn't deal with cpmFetch, but another mod. There's a whole sub-board dedicated to cpmFetch. Don't clutter unrelated threads!
Wheel-World by PM:
Quote from: Wheel-World on October 30, 2007, 08:16:39 AM
Sorry about my post before but the reason i replyed to a thread is because i couldnt find the new thread button to start a new thread about my question. Sorry to be such a newb but i just cant find it? Do i have to have a certain amount of posts before i can start a new thread? I already searched the forums for other threads about my question and they dont answere it.
Thanks.
1) Don't PM supporters, but post publicly.
2) You can't start new threads on this sub-board, as this board deals with existing mods, not with mod requests. The board description clearly says so:
QuoteModifications/Add-Ons/Hacks
The Modifications/Add-Ons/Hacks board is for actual mods and hacks contributions. It is not for requests for mods and hacks. Regular users are not able to post new threads to prevent this board from being cluttered by requests. If you want to contribute and are unable to create a new thread here, please post your contribution in the support boards under the correct version. A moderator will move the thread if it is a valid contribution. Next to each thread's subject, you'll find a little icon that says what version the mods on this sub-board have been written for or tested with (if applicable). Please do not clutter the individual threads by asking if the particular mod will or will not work with another coppermine version than the one it has originally been created with/for.
The sticky thread "About this board - READ (http://forum.coppermine-gallery.net/index.php?topic=14348.0)" says the same thing.
There is a whole sub-board that deals with cpmFetch, where you are allowed to start a thread of your own: "coppermine-gallery.net > Support > cpg1.4.x Support > cpg1.4 cpmFetch by vuud (http://forum.coppermine-gallery.net/index.php?board=87.0)". I think that we can expect that you read a little about the rules on this board before msibehaving: both thread-hijacking as well as unsolicited PMs are not a bright thing. You clearly accepted to read first before blindly disrespecting board rules when you signed up on this forum.
Now do as suggested: start a thread of your own on the support board I have refered to. And btw: there are sticky threads on that very board as well that you should read before blindly posting your question there.
Nice add-on, but I do have a question.
At your site you can't click on the slideshow as link.
At my site, I can click on the slideshow, but it gives a link to http://www.maani.us/slideshow/.
Of course I want this to be a link to my gallery.
Is this possible, or is the link hidden in the flash?
The link is hidden in the flash. Mike (aka maani) supplied the flash bit for the slideshow and I just did the adaptations to get it to work with coppermine.
I'm currently working on a better slideshow using mootools. Some people do not like using flash on their websites so that is why I'm doing a javascript version. It should be more versatile if I can get cpmfetch to work with it. You'll then be able to click on each image to directly link to the full size image. It's nearly working but I'm short of time at the moment.
Quote from: phill104 on November 15, 2007, 09:02:00 AM
The link is hidden in the flash. Mike (aka maani) supplied the flash bit for the slideshow and I just did the adaptations to get it to work with coppermine.
Ahhh :) I get it.
Quote
I'm currently working on a better slideshow using mootools. Some people do not like using flash on their websites so that is why I'm doing a javascript version. It should be more versatile if I can get cpmfetch to work with it. You'll then be able to click on each image to directly link to the full size image. It's nearly working but I'm short of time at the moment.
I'm not a lover of flash myself, but love the idea of having a single image changing while being on the site.
See http://www.xarno.nl/ for the current frontpage ;)
will you be posting the integration with cpmfetch to this thread or another - really looking forward to being able to click a slideshow image and go to it
Can you help me?
I am totally new to coppermine and I like your slideshow idea and have tried to put it into our website, I dont understand PHP or MYSQL and get the error 'loading <something.jpg> timed out'. I dont know about the itunes problem you mentioned, I am hosted by Webhero.com and they did the coppermine installation. I think from Googling the problem it is something about my root installation but I am stuck. this is the url I am trying to get working "http://www.garfieldcentral.org/openhouse_fall_07.html" if that helps. it should open pictures from category "open house'' album 'fall 2007" how do I specify that in flashthum.php - I am sorry if this sounds stupid or is inapropriate but I am new to all this - thanks in advance for any help.
Terry
You need to get the intermediate images working in your gallery first.
Quote from: Nibbler on February 25, 2008, 12:40:24 AM
You need to get the intermediate images working in your gallery first.
Hi, As far as I know I have intermediate pictures enabled in coppermine config - can you help ?
Quote from: Nibbler on February 25, 2008, 12:40:24 AM
You need to get the intermediate images working in your gallery first.
Ok, I dont know how I did it but I got it working, thanks.
Will you be posting the integration with cpmfetch to this thread or another? - I'm really looking forward to being able to click a slideshow image and go to it |
Me too!
yes, this is really a great pieace of code to include on a homepage!
Just... I'm having some trouble installing it... and I am very frustrated....
I just didi what I read, I downloaded the 5 files and uploaded them in the cpg folder.
Tryed to include the i frame script...
But I got the slideshow of the surf....
Then I changed the direction to point to my file slideshow.phpo into my coppermine folder.... an still get surf photos....
If someone can give me a hint I would apreciate greatly! ::) ::)
:D :DI isolved My problem.... was a bad path to the file the cause..... :D :D
Just wanted to ask if I like this slideshow I can Buy the licence from the author and I will get customizable link instead of link to the author page?
If someone knows....
You can buy a license from the writer of the flash bit. I have also written a similar version using mootools which is free although the transitions are not as smooth with javascript as they are with flash.
http://forum.coppermine-gallery.net/index.php/topic,48439.0.html
;D ;DGreat, thanks phill for the link and the suggestion.... looks mo-tools is really a great solution.... .just have to learn alittle java.... ::) ::)
Quote from: tinorebel on April 30, 2008, 06:03:04 PM
just have to learn alittle java.... ::) ::)
JavaScript and Java are two entirely different animals. Mootools is JavaScript-driven.
HAllo, I have just purchased a licence to the developer of the flash part, to be able to show the slide on my site without redirecting clics to the site of the developer.
One question: how can I arrange so that cliccing on a picture bings me to the coppermine page with the corresponding pic?
Would this be very complicated?
I have managed to link a clic to the image source.
doing so:
I modifyed source.php code as follows:
<?php
//include slideshow.php to access the Send_Slideshow_Data function
include "slideshow.php";
include "flashthumb.php";
for ( $i=0; $i<14; $i++ ){
$slideshow[ 'slide' ][ $i ] = array ( 'url' => $url[$i+1] , 'background' => "ffffff" , 'duration' => 4);
$slideshow[ 'transition' ][ $i ] = array ( 'type' => "fade_to_white", 'duration' => 3 ); /* Where "z" can be "drop","fade_to_black" or "push_up" and y is the duration of the transition in seconds.+*/
$slideshow[ 'transition' ][ 0 ] = array ( 'type' => "drop", 'duration' => 1 );
$slideshow[ 'transition' ][ 1 ] = array ( 'type' => "fade_to_white", 'duration' => 2 );
$slideshow[ 'transition' ][ 2 ] = array ( 'type' => "push_up", 'duration' => 1 );
$slideshow[ 'link' ][ $i ] = array ( array ( 'url'=> $url[$i+1] , 'target'=>"_blank" ));
}
Send_Slideshow_Data ( $slideshow );
?>
Really just added:
$slideshow[ 'link' ][ $i ] = array ( array ( 'url'=> $url[$i+1] , 'target'=>"_blank" ));
That opens in a blank page the source image.
This works fine, but I guess could be done better :-\
If anyone can point me in the roght direction I would apreciate it ! 8)
Ok , finally I have decided to buy a licence and I am able to set links for each slide.
I have managed to link each picture to the jpg file, wich means cliccing on the slide will opena a new window with the corresponding picture.
Done this by modifing the code of file: source.php
<?php
//include slideshow.php to access the Send_Slideshow_Data function
include "slideshow.php";
include "flashthumb.php";
for ( $i=0; $i<14; $i++ ){
$slideshow[ 'slide' ][ $i ] = array ( 'url' => $url[$i+1] , 'background' => "ffffff" , 'duration' => 4);
$slideshow[ 'transition' ][ $i ] = array ( 'type' => "fade_to_white", 'duration' => 3 ); /* Where "z" can be "drop","fade_to_black" or "push_up" and y is the duration of the transition in seconds.+*/
$slideshow[ 'transition' ][ 0 ] = array ( 'type' => "drop", 'duration' => 1 );
$slideshow[ 'transition' ][ 1 ] = array ( 'type' => "fade_to_white", 'duration' => 2 );
$slideshow[ 'transition' ][ 2 ] = array ( 'type' => "push_up", 'duration' => 1 );
$slideshow[ 'link' ][ $i ] = array ( array ( 'url'=> $url[$i+1] , 'target'=>"_blank" ));
}
Send_Slideshow_Data ( $slideshow );
?>
really just added the last line:
$slideshow[ 'link' ][ $i ] = array ( array ( 'url'=> $url[$i+1] , 'target'=>"_blank" ));
I would like to link the photos, not to the jpeg image but to the coppermine page that contains the photo... ???
can someone please help me? I belive this feature would be really usefull to fully integrate this great slideshow!
I'm having a problem making the slideshow play more that 10 slides at a time. I'd like it to play around 50 or so. How can that be accomplished?
Ideally, I'd like it to flip through all images in the gallery every time, mo matter what the number is. Is that possible?
Thanks
Not really as it would take ages to load. 10-15 is about the limit.
Thanks for the response. This slideshow works great - I had no trouble installing or changing the background color, etc.
Hy I'm still trying to set each photo a link to the page wich contains the picture in coppermine.
I was thinking obout modifying flashthumb.php
If I understand correctly this file gets the picture url, so I was thinking maby it could get alsaw the picture 'pid' column in the database.
I was thinking of something like this:
flashthumb.php
<?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 = '';
$xml .= " ".get_pic_url($row, $type) ."";
$xml1 .= " ".get_pic_pid($row, $type) ."";
}
$url = explode(" ", $xml);
$pid = explode(" ", $xml1);
?>
But I'm shure i'ts not correctly written.
Since this line I guess is the one wich get's the picture url:
$xml .= " ".get_pic_url($row, $type) ."";
I'm trying to make the script get the picture pid with this line:
$xml1 .= " ".get_pic_pid($row, $type) ."";
Would it be possible to put this line some other way?
Any help will be apreciated.
;) Tell me if I'm compleatly wrong.
The pid is just $row['pid']
Thanks Nibbler for your answer
I'm really a newby in Php so, I'm not shure how I could integrate this info into the script. ???
If pid is $row['pid']
Then would it be posible to retrive the pid in flashthumb.php in some easy way?
I would like to have the pid so I could get the correct link for a picture setting a link url for each random picture like:
gal/displayimage.php?pos=-"pid"
in the source.php file
I'm not shure I'm looking in the right direction :o Tell me if I'm wrong.
OK, in flashthumb.php add in the references to $pidlist like below:
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$xml = '<image_folder></image_folder>';
$pidlist = array(); // added
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) ."";
$pidlist[] = $row['pid']; // added
}
$url = explode(" ", $xml);
?>
and in source.php add in the link param like this:
$slideshow[ 'link' ][ $i ] = array ( array ( 'url'=> 'gal/displayimage.php?pos=-' . $pidlist[$i] , 'target'=>"_blank" ));
:D :D :D ;) ;)
YESSS! It works!! Thank you very much Nibbler!!!
Just had to correct the url
$slideshow[ 'link' ][ $i ] = array ( array ( 'url'=> 'gal/displayimage.php?pos=-' . $pidlist[$i] , 'target'=>"_top" ));
and delete gal/
$slideshow[ 'link' ][ $i ] = array ( array ( 'url'=> 'displayimage.php?pos=-' . $pidlist[$i] , 'target'=>"_top" ));
all the rest works perfectly.
8) 8) :D :DI think this is the best way to have a random show on homepage!
Big thanks again Nibbler!
Just wanted to post a link to the result of the code Nibbler suggested;
if someone wants to see how it works:
http://www.tripodart.net/
This is the homepage. Clik on any picture of the slideshow and you will be linked to the picture.
Clean and smooth! ;)
Fantastic work from Nibbler and tinorebel ;D
This is something I have been meaning to do for a long time but never quite got around to it.
:D :D The fantastik work if from Nibbler,
I have just asked a question..... ::)
Finally I decided to leave in the slideshow on my homepage ( www.tripodart.net ) the first tree pictures fixed.
I did this changing in slideshow.php
for ( $i=0; $i<14; $i++ ){
to
for ( $i=2; $i<14; $i++ ){
And added after the fixed links and urls for the first 3 pictures.
The random ones start from picture number 4. Have fun! ;D