Created
April 2, 2015 00:49
-
-
Save ckunte/a688b791325f5966a940 to your computer and use it in GitHub Desktop.
Doodles, ala Google, for a php powered site (works for WordPress too).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// | |
// Autogenerate doodles (ala Google) for specific dates. | |
// Following is an example. Repeat from line 10 to line 18 | |
// in the code below for other events, and update event | |
// details, and image for the event. | |
// 2008 ckunte | |
// | |
$today = getdate(); | |
/* Christmas -- Example of a picture message */ | |
if($today['mon'] == 12 && $today['mday'] == 25) { | |
echo '<img title="Merry Christmas to you." alt="Ho. Ho. Ho" | |
src="http://yoursite.com/pictures/xmas.jpg" />'; | |
} | |
/* New Year -- Example of a text message */ | |
if($today['mon'] == 1 && $today['mday'] == 1) { | |
echo '<p>Happy New Year!</p>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment