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
https://forums.phpfreaks.com/topic/131896-help-with-dates/
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
https://forums.phpfreaks.com/topic/131896-help-with-dates/#findComment-685419
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.