Current location: Hot Scripts Forums » General Community » Script Requests » PHP image slideshow

PHP image slideshow

Reply
  #1 (permalink)  
Old
Newbie Coder
 
Join Date: Nov 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
PHP image slideshow

Hi all,

I'm looking for a PHP script which acts as an image slideshow.

I would like it to be automatic, so the user doesn't have to click on an arrow or whatever, the images just automatically rotate. Also, I'd like it to have a sort of transition effect, so as it's switching images, it pixelates or something. The transition effect is not mandatory, but would be an added bonus.

I'm hoping someone will know where I can download a script which can do this for me?

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old
digioz's Avatar
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,178
Thanks: 3
Thanked 59 Times in 11 Posts
It sounds like you really need a Java applet, not PHP. There are already Java applets out there that you can download for free that would do exactly that. Why not use them.

Let me know if that will help you out and I will post a link for you.


Quote:
Originally Posted by hockeykid
Hi all,

I'm looking for a PHP script which acts as an image slideshow.

I would like it to be automatic, so the user doesn't have to click on an arrow or whatever, the images just automatically rotate. Also, I'd like it to have a sort of transition effect, so as it's switching images, it pixelates or something. The transition effect is not mandatory, but would be an added bonus.

I'm hoping someone will know where I can download a script which can do this for me?

Thanks in advance.
__________________
Reply With Quote
  #3 (permalink)  
Old
mdhall's Avatar
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
I've also seen javascript that does a type of slide show like this. Not scrolling, but the pics stay in one spot, and fade into the next pic.
Reply With Quote
  #4 (permalink)  
Old
Newbie Coder
 
Join Date: Nov 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript is actually what I was originally planning on using.

I was just hoping that maybe there was a way to do this with PHP so I wouldn't need to use javascript. I don't like using javascript for a couple reasons. But, in this case, I guess I'm stuck with it.

Thanks anyway for your help!
Reply With Quote
  #5 (permalink)  
Old
New Member
 
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
You can make it work with PHP.

Just get a random Image Script like this one:

Code:
<html>
<head>
<meta http-equiv="refresh" content="5">
<head>
<body>

<?php

function getRandomImage($dir,$type='random')
{ 
global $errors,$seed; 

  if (is_dir($dir)) {  

  $fd = opendir($dir);  
  $images = array(); 

      while (($part = @readdir($fd)) == true) {  

          if ( eregi("(gif|jpg|png|jpeg)$",$part) ) {
              $images[] = $part; 
          } 
      } 

    // adding this in case you want to return the image array
    if ($type == 'all') return $images;

    if ($seed !== true) {
      mt_srand ((double) microtime() * 1000000);
      $seed = true;
    }
      
      $key = mt_rand (0,sizeof($images)-1); 

    return $dir . $images[$key]; 

  } else { 
      $errors[] = $dir.' is not a directory'; 
      return false; 
  } 
} 

$image = getRandomImage('yourimagedir/');

echo "<img src='$image' alt='Random Image' border=\"0\">";

?>

</body>
</html>
The above will load a random image from the "yourimagedir" directory and will refresh the page every 5 seconds.

Just change the variables accordingly and there you have a PHP/HTML Slideshow.

Hope it helps.

jugoェ내
http://www.s3squad.com

Last edited by jugoェ내; 06-13-04 at 08:11 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 03:22 AM
Need help on a image slide show using php! xelanoimis PHP 2 10-16-03 07:51 PM
image slideshow muso Script Requests 3 08-20-03 11:51 AM
Rotate an image (CW, CCW) in php? borgo PHP 4 08-16-03 04:47 AM
PHP Live Support image change Jakenorton Script Requests 2 07-28-03 05:28 AM


All times are GMT -5. The time now is 09:00 PM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.