'#CACACA', 'shadow_color' => '#777777', 'weekdays_color' => '#000000', 'weekdays_bgcolor' => '#EAEAEA', 'weekend_bgcolor' => '#F6F6F6', 'weekend_textcolor' => '#000000', 'month_color' => '#000000', 'month_bgcolor' => '#FFFFFF', 'day_color' => '#FFFFFF', 'day_textcolor' => '#000000', 'today_color' => '#D0D0D0', 'today_textcolor' => '#000000', 'event_bgcolor' => '#F0F0F0', 'event_textcolor' => '#000000', 'event_bgcolor2' => '#FFFFFF', 'event_textcolor2' => '#000000', 'event_border' => '#000000', 'start_day' => '1', ); // presets // lightblue $calendar_preset[lightblue] = array( 'bgcolor' => '#d6e6ff', 'shadow_color' => '#777777', 'weekdays_color' => '#333333', 'weekdays_bgcolor' => '#b5d2ff', 'weekend_bgcolor' => '#e9f2ff', 'weekend_textcolor' => '#333333', 'month_color' => '#333333', 'month_bgcolor' => '#FFFFFF', 'day_color' => '#FFFFFF', 'day_textcolor' => '#333333', 'today_color' => '#99BBFF', 'today_textcolor' => '#333333', 'event_bgcolor' => '#f1f6fe', 'event_textcolor' => '#000000', 'event_bgcolor2' => '#FFFFFF', 'event_textcolor2' => '#333333', 'event_border' => '#005581', 'start_day' => '1', ); // red $calendar_preset[red] = array( 'bgcolor' => '#FFFFFF', 'shadow_color' => '#a82727', 'weekdays_color' => '#ffffff', 'weekdays_bgcolor' => '#a82727', 'weekend_bgcolor' => '#eaa2a2', 'weekend_textcolor' => '#ffffff', 'month_color' => '#333333', 'month_bgcolor' => '#fff2f2', 'day_color' => '#ffe7e7', 'day_textcolor' => '#333333', 'today_color' => '#b93b3b', 'today_textcolor' => '#FFFFFF', 'event_bgcolor' => '#f9d3d3', 'event_textcolor' => '#000000', 'event_bgcolor2' => '#fff2f2', 'event_textcolor2' => '#333333', 'event_border' => '#a82727', 'start_day' => '1', ); // light green $calendar_preset[green] = array ( 'bgcolor' => '#FFFFFF', 'shadow_color' => '#4c7f30', 'weekdays_color' => '#000000', 'weekdays_bgcolor' => '#aded8a', 'weekend_bgcolor' => '#c9eeb1', 'weekend_textcolor' => '#333333', 'month_color' => '#333333', 'month_bgcolor' => '#ffffff', 'day_color' => '#f4fcef', 'day_textcolor' => '#333333', 'today_color' => '#a8e283', 'today_textcolor' => '#000000', 'event_bgcolor' => '#d6f3c3', 'event_textcolor' => '#000000', 'event_bgcolor2' => '#f4fcef', 'event_textcolor2' => '#333333', 'event_border' => '#c9eeb1', 'start_day' => '1', ); // gold $calendar_preset[gold] = array ( 'bgcolor' => '#FFFFFF', 'shadow_color' => '#cbc55b', 'weekdays_color' => '#000000', 'weekdays_bgcolor' => '#fff65e', 'weekend_bgcolor' => '#fff99d', 'weekend_textcolor' => '#333333', 'month_color' => '#333333', 'month_bgcolor' => '#ffffff', 'day_color' => '#fffdde', 'day_textcolor' => '#333333', 'today_color' => '#ffee00', 'today_textcolor' => '#000000', 'event_bgcolor' => '#fffbb3', 'event_textcolor' => '#000000', 'event_bgcolor2' => '#fffeea', 'event_textcolor2' => '#333333', 'event_border' => '#c8bd00', 'start_day' => '1', ); // multi-color $calendar_preset[multi] = array ( 'bgcolor' => '#FFFFFF', 'shadow_color' => '#666666', 'weekdays_color' => '#ffffff', 'weekdays_bgcolor' => '#2b589d', 'weekend_bgcolor' => '#f6f6f6', 'weekend_textcolor' => '#ff0000', 'month_color' => '#333333', 'month_bgcolor' => '#ffffff', 'day_color' => '#f6f6f6', 'day_textcolor' => '#333333', 'today_color' => '#f6f6f6', 'today_textcolor' => '#0060ff', 'event_bgcolor' => '#f6f6f6', 'event_textcolor' => '#328400', 'event_bgcolor2' => '#ffffff', 'event_textcolor2' => '#333333', 'event_border' => '#000000', 'start_day' => '1', ); // end of presets if (!get_settings('calendar_options')) { update_option('calendar_options',$calendar_defaults); } $calendar_options = get_settings('calendar_options'); //$calendar_options[start_day]=1; calendar_check_table(); // internal function for multilang support function _ee($locale, $default) { if (__($locale) != $locale) { echo __($locale); } else echo $default; } function build_calendar() { global $calendar_options; $month=date("n")+1+$_GET[month]; $year=date("Y"); $today=date("j"); // total days of the current month $days=date("j", mktime(0,0,0,$month,0,$year)); // month starts on: $starts=(date("w", mktime(0,0,0,($month-1),1,$year))+7); if (!$calendar_options[start_day]) { $starts=$starts+1; } $month_text=date("F", mktime(0,0,0,($month-1),1,$year)); echo "
"; echo ""; echo ""; if ($calendar_options[start_day]) { echo "\n"; } else { echo "\n"; } if ($starts > 7) { $starts=$starts-7; } $calendar_edays="".str_repeat("", ($starts-1)); while ($day_count<$days) { $starts++; $day_events=count_events(mktime(0,0,0,($month-1),($day_count+1),$year)); if ($starts == 2) { echo ""; } if ($day_count < 1) { echo $calendar_edays; } if (($day_count+1 == $today) && !$_GET[month]) { if ($day_events) { echo ""; get_events(mktime(0,0,0,($month-1),($day_count+1),$year)); if ($starts > 7) { echo "\n"; $starts=1; } $day_count++; } if ($starts < 7 && $starts > 1) { echo ""; } // close table echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; _e($month_text); if ($_GET[month] <= (date("n")*(-1))) { echo " ".date("Y", mktime(0,0,0,($month-1),1,$year)); } echo "
"; echo "
"; _ee('M_Monday_initial','M'); echo ""; _ee('T_Tuesday_initial','T'); echo ""; _ee('W_Wednesday_initial','W'); echo " "; _ee('T_Thursday_initial','T'); echo ""; _ee('F_Friday_initial','F'); echo ""; _ee('S_Saturday_initial','S'); echo ""; _ee('S_Sunday_initial','S'); echo "
"; _ee('S_Sunday_initial','S'); echo ""; _ee('M_Monday_initial','M'); echo ""; _ee('T_Tuesday_initial','T'); echo ""; _ee('W_Wednesday_initial','W'); echo " "; _ee('T_Thursday_initial','T'); echo ""; _ee('F_Friday_initial','F'); echo ""; _ee('S_Saturday_initial','S'); echo "
 
6) { if ($day_events) { echo " 7 || $starts == 2)) { if ($day_events) { echo "".($day_count+1)."
"; } function write_javascript() { ?> = $timestamp AND timestamp < ($timestamp + 86400)"); $events=mysql_num_rows($query); return $events; } function get_events($timestamp) { global $calendar_options, $calendar_table; $query=mysql_query("SELECT * FROM $calendar_table WHERE timestamp >= $timestamp AND timestamp < ($timestamp + 86400)"); $events=mysql_num_rows($query); if ($events > 0) { echo "
"; echo "Events for: ".date("jS F Y",$timestamp).""; echo "
"; while ($day_events=mysql_fetch_array($query)) { echo $day_events[text]."
"; } echo "
"; } } function do_calendar() { write_javascript(); build_calendar(); } function calendar_check_table() { global $calendar_table; $query=mysql_query("SHOW TABLES"); while ($fetch=mysql_fetch_array($query)) { if ($fetch[0] == $calendar_table) { return; } } // table does not exists. creating. mysql_query(" CREATE TABLE `$calendar_table` ( `timestamp` int(11) NOT NULL default '0', `type` varchar(255) NOT NULL default '', `text` text NOT NULL, PRIMARY KEY (`timestamp`), UNIQUE KEY `timestamp` (`timestamp`) ) TYPE=MyISAM COMMENT='wordpress Calendar plugin by Vanguard' "); } // administration panel function calendar_admin() { if (function_exists('add_options_page')) { add_options_page('Calendar Options', 'Calendar', 8, basename(__FILE__), 'calendar_admin_page'); } } function calendar_admin_page() { global $calendar_options, $calendar_defaults, $calendar_table, $calendar_preset; if (isset($_POST['theme_update'])) { switch ($_POST[theme]) { case '1': $update_options=$calendar_defaults; break; case '2': $update_options=$calendar_preset[lightblue]; break; case '3': $update_options=$calendar_preset[red]; break; case '4': $update_options=$calendar_preset[green]; break; case '5': $update_options=$calendar_preset[gold]; break; case '6': $update_options=$calendar_preset[multi]; break; default: $update_options=$calendar_defaults; } update_option('calendar_options',$update_options); $calendar_options = get_settings('calendar_options'); ?>

"; } if (isset($_POST['info_update'])) { ?>

$_POST['bgcolor'], 'shadow_color' => $_POST['shadow_color'], 'weekdays_color' => $_POST['weekdays_color'], 'weekdays_bgcolor' => $_POST['weekdays_bgcolor'], 'weekend_bgcolor' => $_POST['weekend_bgcolor'], 'weekend_textcolor' => $_POST['weekend_textcolor'], 'month_color' => $_POST['month_color'], 'month_bgcolor' => $_POST['month_bgcolor'], 'day_color' => $_POST['day_color'], 'day_textcolor' => $_POST['day_textcolor'], 'today_color' => $_POST['today_color'], 'today_textcolor' => $_POST['today_textcolor'], 'event_bgcolor' => $_POST['event_bgcolor'], 'event_textcolor' => $_POST['event_textcolor'], 'event_bgcolor2' => $_POST['event_bgcolor2'], 'event_textcolor2' => $_POST['event_textcolor2'], 'event_border' => $_POST['event_border'], 'start_day' => $_POST['start_day'], ); update_option('calendar_options',$updated_options); $calendar_options = get_settings('calendar_options'); ?>

0) { mysql_query("UPDATE $calendar_table SET text = '$event_text' WHERE timestamp = '$timestamp'"); _e('Calendar event successfully updated!',''); } else { mysql_query("INSERT INTO $calendar_table VALUES('$timestamp','note','$event_text')"); _e('Calendar event successfully added!',''); } } else { mysql_query("INSERT INTO $calendar_table VALUES('$timestamp','note','$event_text')"); _e('Calendar event successfully added!',''); } echo "

"; } if (isset($_POST[remove_event])) { $i=0; $events_array=$_POST[events]; while(list($key,$val) = each($events_array)) { mysql_query("DELETE FROM $calendar_table WHERE timestamp = $val"); //echo "deleting: $key - $val
"; $i++; } echo "

"; _e('Calendar event(s) deleted!',''); echo "

"; } ?>

Calendar Options

The options listed below ARE presets. If you want to customize one of these presets first you have to 'apply' it and then change its values on the Display Settings.

grey (default) light blue red
light green gold multi color

Here you can customize the visual of this plugin. All colors are in hexadecimal format.
Any questions please report to this plugin website.

background: week days text color:
week days background: weekend background:
weekend text color: month text color:
month background: day background:
day text color: today background:
today text color: event day background:
event day text color: event layer background:
event layer text color: event layer border color:
shadow color:
week starts on monday >

Here you can manage all of your events. Add, Edit and Remove.

Remove

Add/Edit

0) { while ($fetch=mysql_fetch_array($query)) { if (!$current) { $current=date("jS F", $fetch[timestamp]); echo "".date("jS F",$fetch[timestamp])."
    "; } if ($current != date("jS F", $fetch[timestamp])) { echo "
\n".date("jS F",$fetch[timestamp])."
    "; $current=date("jS F", $fetch[timestamp]); } echo "\"edit $fetch[text]
    "; } } ?>
Timestamp:
" size="2"> " size="2"> " size="4"> at " style="width: 40px">

Event: