Location: PHPKode > scripts > Silentum Event Calendar > event_calendar.php
<?PHP
	/*
	Silentum Event Calendar v1.1
	Modified July 8, 2012
	event_calendar.php copyright 2006-2012 HyperSilence
	*/

	$date = time();

	$day = date("d", $date);
	$month = date("m", $date);
	$year = date("Y", $date);

	// These are the events displayed underneath the calendar
	// Events will be changed each day according to the list below
	// If you don't want events enabled, change the following variable to false

	$enable_events = true;

	$event_01 = "First day of the month events go here.";
	$event_02 = "Second day of the month events go here.";
	$event_03 = "Third day of the month events go here.";
	$event_04 = "Fourth day of the month events go here.";
	$event_05 = "Fifth day of the month events go here.";
	$event_06 = "Sixth day of the month events go here.";
	$event_07 = "Seventh day of the month events go here.";
	$event_08 = "Eighth day of the month events go here.";
	$event_09 = "Ninth day of the month events go here.";
	$event_10 = "Tenth day of the month events go here.";
	$event_11 = "Eleventh day of the month events go here.";
	$event_12 = "Twelfth day of the month events go here.";
	$event_13 = "Thirteenth day of the month events go here.";
	$event_14 = "Fourteenth day of the month events go here.";
	$event_15 = "Fifteenth day of the month events go here.";
	$event_16 = "Sixteenth day of the month events go here.";
	$event_17 = "Seventeenth day of the month events go here.";
	$event_18 = "Eighteenth day of the month events go here.";
	$event_19 = "Nineteenth day of the month events go here.";
	$event_20 = "Twentieth day of the month events go here.";
	$event_21 = "Twenty first day of the month events go here.";
	$event_22 = "Twenty second day of the month events go here.";
	$event_23 = "Twenty third day of the month events go here.";
	$event_24 = "Twenty fourth day of the month events go here.";
	$event_25 = "Twenty fifth day of the month events go here.";
	$event_26 = "Twenty sixth day of the month events go here.";
	$event_27 = "Twenty seventh day of the month events go here.";
	$event_28 = "Twenty eighth day of the month events go here.";
	$event_29 = "Twenty ninth day of the month events go here.";
	$event_30 = "Thirtieth day of the month events go here.";
	$event_31 = "Thirty first day of the month events go here.";

	//
	// Nothing is REQUIRED to be changed after this
	//

	if(${event_.$day} == "") {
	$event_display = "There are no events for today.";
	}
	else {
	$event_display = ${event_.$day};
	}

	$first_day = mktime(0,0,0,$month, 1, $year);
	$title = date("F", $first_day);
	$day_of_week = date("D", $first_day);

	switch($day_of_week) {
	case "Sun": $blank = 0; break;
	case "Mon": $blank = 1; break;
	case "Tue": $blank = 2; break;
	case "Wed": $blank = 3; break;
	case "Thu": $blank = 4; break;
	case "Fri": $blank = 5; break;
	case "Sat": $blank = 6; break;
	}

	$days_in_month = cal_days_in_month(0, $month, $year);
?>
<h2>Silentum Event Calendar v1.0.0</h2>
<?
	echo "<table border=\"3\" cellpadding=\"2\" cellspacing=\"4\" style=\"background: #aaa; color: #000; text-align: center\" width=\"420\">
	<tr>
		<td colspan=\"7\" style=\"background: #ddd; color: #00d;\"><b>$title, $year</b></td>
	</tr>
	<tr>
		<td style=\"background: #eee; color: #000\" width=\"60\"><b>Sun.</b></td>
		<td style=\"background: #eee; color: #000\" width=\"60\"><b>Mon.</b></td>
		<td style=\"background: #eee; color: #000\" width=\"60\"><b>Tue.</b></td>
		<td style=\"background: #eee; color: #000\" width=\"60\"><b>Wed.</b></td>
		<td style=\"background: #eee; color: #000\" width=\"60\"><b>Thu.</b></td>
		<td style=\"background: #eee; color: #000\" width=\"60\"><b>Fri.</b></td>
		<td style=\"background: #eee; color: #000\" width=\"60\"><b>Sat.</b></td>
	</tr>
	<tr>
	";

	$day_count = 1;
	$day_number = 1;

	while($blank > 0) {
	echo "	<td></td>
	";
	$blank = $blank-1;
	$day_count++;
	}

	while($day_number <= $days_in_month) {
	if($day_number < $day) {
	echo "	<td style=\"background: #bbb; border: 2px solid #ccc; color: #000\"><s><i>$day_number</i></s></td>
	";
	}
	elseif($day_number == $day) {
	echo "	<td style=\"background: #fff; border: 2px solid #555; color: #000\"><b>$day_number</b></td>
	";
	}
	else {
	echo "	<td style=\"background: #ccc; border: 2px solid #ddd; color: #000\">$day_number</td>
	";
	}
	$day_number++;
	$day_count++;

	if($day_count > 7) {
	echo "</tr>
	<tr>
	";
	$day_count = 1;
	}
	}

	while($day_count > 1 && $day_count <= 7) {
	echo "	<td></td>
	"; 
	$day_count++;
	}

	echo "</tr>
</table>

<br><hr>
	
";

	if($enable_events == true) {
	echo "<br><b>Events for ".$title." ".$day.", ".$year."</b><br><br>";
	echo $event_display."<br>";
	}
?>

<p>Powered by: <a href="http://hypersilence.com/silentum" title="Silentum Event Calendar v1.1">Silentum Event Calendar v1.1</a></p>
Return current item: Silentum Event Calendar