Php question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • teh ghey
    • Jun 2026

    #1

    Php question

    I have this If statement
    <!-- IF active_module == "homepage" -->
    show image here
    <!-- ENDIF -->
    I only want to use this IF statement on monday - thursday.

    on friday-sunday I do not want to use the IF statement, so it just shows the image on every page, not just the homepage.

    How can I make it so that the IF statement only runs monday through thursday, and on friday-sunday it doesnt use the IF?
  • sarettah
    see you later, I'm gone
    • Oct 2002
    • 14293

    #2
    Originally posted by teh ghey
    I have this If statement
    <!-- IF active_module == "homepage" -->
    show image here
    <!-- ENDIF -->
    I only want to use this IF statement on monday - thursday.

    on friday-sunday I do not want to use the IF statement, so it just shows the image on every page, not just the homepage.

    How can I make it so that the IF statement only runs monday through thursday, and on friday-sunday it doesnt use the IF?
    if date('w',time())>=1 && date('w',time())<=4 && .................

    That will check if the day of the week is between Monday (1) and Thursday (4)
    Last edited by sarettah; 03-02-2010, 05:32 PM.
    All cookies cleared!

    Comment

    • teh ghey

      #3
      thank you!
      I know zero about php, do I have to put a <?php> in front of it?
      im fixing a template i bought

      Comment

      • sarettah
        see you later, I'm gone
        • Oct 2002
        • 14293

        #4
        <?php if(date('w',time())>=1 && date('w',time())<=4) {?>

        Your template code here

        <?php } ?>

        should work.

        Let me know how it goes
        All cookies cleared!

        Comment

        • teh ghey

          #5
          It worked!!!!
          you rock, thank you so much!!!
          Last edited by Guest; 03-02-2010, 05:50 PM.

          Comment

          • sarettah
            see you later, I'm gone
            • Oct 2002
            • 14293

            #6
            Originally posted by teh ghey
            It worked!!!!
            you rock, thank you so much!!!
            np.......
            All cookies cleared!

            Comment

            • quantum-x
              Confirmed User
              • Feb 2002
              • 6863

              #7
              Originally posted by sarettah
              <?php if(date('w',time())>=1 && date('w',time())<=4) {?>

              Your template code here

              <?php } ?>

              should work.

              Let me know how it goes
              Why not just

              <? if(date('w')>=1 && date('w')<=4) {?>

              time() is redundant
              PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

              Comment

              • sarettah
                see you later, I'm gone
                • Oct 2002
                • 14293

                #8
                Originally posted by quantum-x
                Why not just

                <? if(date('w')>=1 && date('w')<=4) {?>

                time() is redundant
                Because I am redundant I guess. I usually use the date() function with something other than the current time so I forget that it defaults to using the current time if you leave the param out.

                Dangers of answering off the top of my head while I am breaking from code.
                All cookies cleared!

                Comment

                Working...