Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2009
    Posts
    59
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Question [Need Help] Rotating Image Question...

    I curently have one image echoing every hour. How would I be able to echo not just one, but two or maybe even three images at the same time?

    PHP Code:
    <?PHP
    function currentImage(){
        
    $imagePath "img/";
        if (
    date(H) < 09 || date(H) > 21) {
            return 
    $imagePath."".date(D)."/".date(H).".png";
        } else {

            return 
    $imagePath."".date(D)."/".date(H).".png";
        }
    }
    ?>
    My goal is to echo the first image at a certain time, like maybe 8am, then echo the 9am image underneath it and then the 10am image underneath the 9am image and so on.... Can anyone help?

    Thank you in advance,
    Matafy

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    What is the point of that code? The "if" statement does the same thing on both sides of the condition.

  • #3
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    That code is also chock full of "undefined constant" notices just waiting to be released.

  • #4
    New Coder
    Join Date
    Apr 2009
    Posts
    59
    Thanks
    13
    Thanked 0 Times in 0 Posts

    I see...

    What I am looking for is to show multible images at one time at a certain time. For example;

    image 1 (Mon 8am show time) = to be shown on Mon 8am
    image 2 (Mon 9am show time) = to be shown on Mon 8am
    image 3 (Mon 10am show time) = to be shown on Mon 8am

    and when 9am rolls around. Have the images rotate for that day;

    image 2 (Mon 9am show time) = to be shown on Mon 9am
    image 3 (Mon 10am show time) = to be shown on Mon 9am
    image 4 (Mon 11am show time) = to be shown on Mon 9am

    Thank,
    Matay
    Last edited by matafy; 10-22-2009 at 09:53 PM.


  •  

    Posting Permissions

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