Results 1 to 8 of 8

Thread: Show slides in order by date/time

  1. #1
    Join Date
    Dec 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Show slides in order by date/time

    1) Script Title: Swiss Army

    2) Script URL (on DD): http://www.dynamicdrive.com/forums/a...8&d=1190000634

    3) Describe problem: The swiss army script found in this zip file from your site automatically retrieves images from a directory and runs them as a slideshow in random order. Is there a tweak to this script that will run the images in order by date/time? This zip file script seems to be different than the entire script on the swiss army page. Thanks.
    Last edited by jscheuer1; 12-24-2008 at 01:45 PM. Reason: fix broken link

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,000
    Thanks
    44
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    That actually shows the slides in the order in which the server finds them within the folder. Which generally is already by file date. Remember though, that when you upload a file to the server, it gets the date stamp of that event, it doesn't carry its original date stamp with it from the local computer.

    If you were to name the image files in a way that reflected the date that you wanted them to have:

    20080101.jpg

    for 2008 01 (January) 01 (the 1st), for example, you could sort the array:

    Code:
     . . .  closedir($handle);
       }
       return($files);
    }
    
    echo "var slides=new Array();" . "\n";
    returnimages();
    ?>
    
    slides.sort();
    
    var preload_ctrl_images=false;
    
    slides.no_controls=1; // will set a slide show with no controls
    slides.no_descriptions=1; //use f . . .
    You may also want to look here for more info on sorting as regards this thread:

    http://www.dynamicdrive.com/forums/s...ad.php?t=40009
    Last edited by jscheuer1; 12-24-2008 at 02:49 PM. Reason: add info/link
    - John
    ________________________

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

  3. #3
    Join Date
    Dec 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That's very helpful. How would I code it to sort descending?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,000
    Thanks
    44
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    After:

    Code:
    slides.sort();
    do:

    Code:
    slides.reverse();
    - John
    ________________________

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

  5. #5
    Join Date
    Dec 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You're the best! Merry Christmas.

  6. #6
    Join Date
    Dec 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face

    Hi John,

    I owe you an apology. In a post about php photo album I asked how to have the images open left aligned in a frame. That question should have gone here. My slideshow opens centered in the window. I am using the code found at this link:
    http://www.dynamicdrive.com/forums/a...8&d=1190000634

    My web page can be found here:
    http://www.marcellusny.com/cam_2_archives/

    You can see that if your resolution is set above 800x600 the images open left aligned in the frame but the slideshow opens centered. I like this format for viewing the images as pop-up windows can be annoying. I've tried a few mods to the 'center' codes in the script but to no avail. Thanks.

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,000
    Thanks
    44
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    No need to apologise, except perhaps for the fact that your link to "I am using the code found at this link" is broken. But we are usually pretty easy going around here if we can at least understand what the question is.

    As to which, if I've understood the question, on your slideshow.php page, add the highlighted:

    Code:
    <body>
    <div style="width: 352px;">
    <script type="text/javascript">
    new inter_slide(slides, 352, 288)
    </script>
    </div>
    </body>
    - John
    ________________________

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

  8. #8
    Join Date
    Dec 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Awesome, you're the best. I put a link to your site under my slideshows. Thanks.

    --Bill

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
  •