Skip to content

Instantly share code, notes, and snippets.

@ckunte
Created April 2, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ckunte/a688b791325f5966a940 to your computer and use it in GitHub Desktop.
Save ckunte/a688b791325f5966a940 to your computer and use it in GitHub Desktop.
Doodles, ala Google, for a php powered site (works for WordPress too).
<?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