Jump to content

Help with dates.


McChicken

Recommended Posts

Hey. I just installed a script that change my site logo on holidays, called "HLogoZ"

My problem is that i want the script to show a logo from 1.Dec - 22.Dec and another logo from 23.Dec - 24.Dec.

 

What change do I need to make here: ?

 

}

 

}

 

// Christmas Eve

else if ($today == "December 24, $year"){

if (file_exists("$logo_path/$logo_xmaseve")) {

    echo "<img src='$logo_url/$logo_xmaseve' alt='$logoalt' />";

} else {

    echo "$imagedefault";

}

}

 

// Christmas

else if ($today == "December 25, $year"){

if (file_exists("$logo_path/$logo_xmas")) {

    echo "<img src='$logo_url/$logo_xmas' alt='$logoalt' />";

} else {

    echo "$imagedefault";

}

}

Link to comment
Share on other sites

untested but try that first

 

}

 

}

 

// Christmas Eve

else if ($today >= "December 1, $year") and ($today <= "December 22, $year"){

  if (file_exists("$logo_path/$logo_xmaseve")) {

          echo "<img src='$logo_url/$logo_xmaseve' alt='$logoalt' />";

  } else {

          echo "$imagedefault";

  }

}

 

// Christmas

else if ($today >= "December 23, $year") and ($today <= "December 24, $year"){

  if (file_exists("$logo_path/$logo_xmas")) {

          echo "<img src='$logo_url/$logo_xmas' alt='$logoalt' />";

  } else {

          echo "$imagedefault";

  }

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.