Revision [16711]

This is an old revision of GmBowenCalendar made by GmoF3z on 2007-05-31 10:39:10.

 

Calendar action

I thought that some of you might find this calendar a useful little action. I can't claim to have written it, just modified an open source calendar script I found so it works in Wikka. -- Mike

NEW: Users of this page should now note that the code shown on this page is NOT the code generating the calendar visible here. The action which generates the calendar visible on this page is almost a complete code re-write (with substantially different structure, etc.) by JavaWoman and is available at JwCalendar. The code shown on this page will work as a calendar, but it's copyright is considerably more hazy (see the discussion in the comments below which probably accurately identifies the original designer as Marcus Kazmierczak and the site the code originated from, probably several authors back now, is probably Blazonry whose copyright statement does allow for modification).... but I'm leaving the code here as it might be useful for other purposes....such as comparative ones. -- Mike

Example

The calendar action described on this page was added to Wikka version 1.1.5.4 (GMB note: never released, superceded by 1.1.6.0....see WikkaReleaseNotes). Here's how it looks:
April 2024
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
<< = >>


You can control the appearance of the calendar by modifying the stylesheet and adding a calendar style. For example:
.calendar
{
	background-color: teal;
	color: white;
}
.calendar .currentday {color: yellow;}


Code:

The code has been modified some by JsnX, but it still has room for improvement.

%%(php)
<?php
$month = (!isset($_GET['month'])) ? date("n",mktime()) : $_GET['month'];
$year = (!isset($_GET['year'])) ? date("Y",mktime()) : $_GET['year'];
?>

<table class="calendar">
<tr>
<td valign="top">
<?php
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$firstwday= $tmpd["wday"];
$lastday = mk_getLastDayofMonth($month,$year);
?>
<table cellpadding="2" cellspacing="0" border="1">
<tr>
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="20"><a href="<?php echo $this->href(, , "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki