Results 1 to 10 of 10

Thread: Ultimate Fade-in Slideshow auto images

  1. #1
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in Slideshow auto images

    1) Script Title: Ultimate Fade-in slideshow (v1.51)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem:
    Ultimate Fade-in Slideshow with automatic image retrieval desired. I love your site and over the last two weeks have learned and used a number of the scripts in creating a photography business web site. I am a newbie, and have been cutting and pasting from various sources and learning along the way. I have searched the forum using keywords of - image retrieve auto populate Ultimate Fade-in - and have come up empty.

    I would like to establish a directory that the slideshow automatically pulls images from, like the http://www.dynamicdrive.com/dynamici...photoalbum.htm PHP Photo Album Script uses the http://www.dynamicdrive.com/dynamici...etpics.php.txt getpics.php to create a gallery page. I am not even remotely capable of integrating the two if it is even possible. I have managed to get it to run 3 slideshows at the same time centered horizontally www.bbcgphoto.com/index.php .

    Is this possible ?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Actually, this (grabbing dissimilar images from a folder, using PHP) works better with the Swiss Army slide show:

    Attachment 1268

    Notes: The main script from DD demo page (swissarmy.js) as mentioned on the first above linked page is included on the attached (second linked zipped) page. Instead of the on page code shown on the DD demo page, use the on page PHP and javascript script shown in the above attached zipped file (second link). The images in this attached zipped example go in a folder named images off of the folder that the above attached page is in. With not much tinkering, multiple folders of images could be accessed.
    Last edited by jscheuer1; 09-17-2007 at 04:52 AM. Reason: clarity
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2005
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    Following from the OP and your response - would the Ultimate fade-in script work ok pulling images that are all the same size from a particular folder or would you still recommend the Swiss Army slideshow?

    If it's the latter, can I remove the controls without messing up the script as I don't want those.

    Many thanks

    Edit: I noticed a link to a tutorial on dynamically populating a javascript slideshow with PHP but I'm not sure how how to combine the two scripts e.g. how to replace this bit in UFISS:

    Code:
    fadeimages[0]=["images/mainpic1.jpg", "", ""] 
    fadeimages[1]=["images/mainpic2.jpg", "", ""] 
    fadeimages[2]=["images/mainpic3.jpg", "", ""]
    With the call from the JS kit tutorial:
    Code:
    <script src="/images/getimages.php"></script>
    Which inserts the image array gathered by getimages.php.
    Last edited by Tailslide; 09-21-2007 at 10:56 AM.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You would probably be best off using Swiss Army without the controls. Even though U-Fade can be adapted, only one of its undesirable characteristics would be eliminated by having the images all of uniform dimensions. Another is its method of preloading, which is done all at once, delaying the start of the show. When pulling many images from a folder, it is best to use incremental preloading as does Swiss Army.

    Just for your information, using PHP to get an array of images is just a matter of making sure that the array PHP creates can be utilized by the existing script.

    To do that, it must create an array in the same format as that which the script is expecting and of the same name. It must occur before the other script, and the array that it is replacing must be removed from the slide show script.
    Last edited by jscheuer1; 09-21-2007 at 10:09 PM. Reason: grammar
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2005
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that - I'll have a go with the Swiss Army slideshow.

    Just tried it and it works perfectly for the particular application - thanks!
    Last edited by Tailslide; 09-21-2007 at 04:24 PM.

  6. #6
    Join Date
    Sep 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Order of slides

    LOVE the mod of this script to pull images from folder. I can not figure out what change to make in order to have the images rotate in alpha/numeric order. Please advise! Thanks!!!

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by freedomd View Post
    LOVE the mod of this script to pull images from folder. I can not figure out what change to make in order to have the images rotate in alpha/numeric order. Please advise! Thanks!!!
    Replace:

    PHP Code:
    <?
    function returnimages($dirname="./images/") {
       
    $pattern="\.(jpg|jpeg|png|gif|bmp)$";
       
    $files = array();
       
    $curimage=0;
       if(
    $handle opendir($dirname)) {
           while(
    false !== ($file readdir($handle))){
                   if(
    eregi($pattern$file)){
                     echo 
    'slides[' $curimage .']=["' $dirname $file '", "", ""];' "\n";
                     
    $curimage++;
                   }
           }

           
    closedir($handle);
       }
       return(
    $files);
    }

    echo 
    "var slides=new Array();" "\n";
    returnimages();
    ?>
    with:

    PHP Code:
    <?php
    function returnimages($dirname './images/') {
        
    $pattern '#\.(jpg|jpeg|png|gif|bmp)$#i';
        
    $files = array();
        if(
    $handle opendir($dirname)){
            while((
    $file readdir($handle)) !== false){
                if(
    preg_match($pattern$file)){
                    
    array_push($files"\t['" $dirname $file "', '', '']");
                }
            }
            
    closedir($handle);
            
    natsort($files);
        }
        return 
    "var slides = [\n" implode(",\n"$files) . "\n];\n";
    }

    echo 
    returnimages();
    ?>
    Last edited by jscheuer1; 09-23-2010 at 02:51 AM. Reason: found better method
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Sep 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks! Another mod:

    I need the fn to look something like this...

    function returnimages($dirname = './artistlist/$artist[codename]/gallery/') {

    ...but it doesn't work. I don't think it likes the $artist[codename]? Successfully call that table in other areas of the page, but not the slideshow.

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That table? Is it a database table?

    In any case, if:

    PHP Code:
    $artist[codename
    doesn't resolve to a valid component of the path, it cannot work. Also, you are using literal quotes (') so it will never resolve. Even if it does, I've observed that PHP doesn't like resolving variables inside a construct like that. So it can be put inside the function. But then the 'table' as you call it probably is out of scope. So instead of:

    PHP Code:
    function returnimages($dirname './artistlist/$artist[codename]/gallery/') { 
    try:

    PHP Code:
    function returnimages() {
    $dirname './artistlist/' $GLOBALS['artist'][codename] . '/gallery/'
    or:

    PHP Code:
    function returnimages() {
    $dirname './artistlist/' $GLOBALS['artist']['codename'] . '/gallery/'
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Sep 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You are great! Many, many thanks ... It is a very large, complex database.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •