diff options
author | Chad Little <clittle@users.sourceforge.net> | 2003-09-14 21:01:34 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2003-09-14 21:01:34 +0000 |
commit | 557fe532a369df55a598040b1f1f07fc87bcc1dc (patch) | |
tree | de7cc5f311e38013d9e5f767222189e2bac75365 | |
parent | 62cca1dd882d27f0891e1b4ea0fec218f749ab44 (diff) | |
download | phpicalendar-557fe532a369df55a598040b1f1f07fc87bcc1dc.tar.gz phpicalendar-557fe532a369df55a598040b1f1f07fc87bcc1dc.tar.bz2 phpicalendar-557fe532a369df55a598040b1f1f07fc87bcc1dc.zip |
Removed many many tables from month view, switched to DIVS. Fixed openevent, added link class.
-rw-r--r-- | config.inc.php | 2 | ||||
-rw-r--r-- | day.php | 6 | ||||
-rw-r--r-- | functions/date_functions.php | 8 | ||||
-rw-r--r-- | month.php | 100 | ||||
-rw-r--r-- | week.php | 6 |
5 files changed, 46 insertions, 76 deletions
diff --git a/config.inc.php b/config.inc.php index 37b9c4f..a3e9409 100644 --- a/config.inc.php +++ b/config.inc.php @@ -10,7 +10,7 @@ $default_view = 'day'; // Default view for calendars = 'day', 'week', 'mont $minical_view = 'current'; // Where do the mini-calendars go when clicked? = 'day', 'week', 'month', 'current' $default_cal = 'all_calenders_combined971'; // Exact filename of calendar without .ics. Or set to 'all_calenders_combined971' to open all calenders combined into one. $language = 'English'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish', 'Swedish', 'Portuguese', 'Catalan', 'Traditional_Chinese', 'Esperanto' -$week_start_day = 'Saturday'; // Day of the week your week starts on +$week_start_day = 'Sunday'; // Day of the week your week starts on $day_start = '0800'; // Start time for day grid $gridLength = '15'; // Grid distance in minutes for day view, multiples of 15 preferred $num_years = '3'; // Number of years to display in 'Jump to' @@ -118,7 +118,8 @@ if (isset($master_array[($getdate)])) { 0, "", '<font color="#ffffff"><i>', - "</i></font>"); + "</i></font>", + "psf"); echo "</td>\n</tr>\n"; } echo '</table>'."\n"; @@ -271,7 +272,8 @@ if (isset($master_array[($getdate)])) { "", 0, "<font class=\"eventfont\">", - "</font>"); + "</font>", + "psf"); echo '</td></tr>'."\n"; echo '</table>'."\n"; echo '</td>'."\n"; diff --git a/functions/date_functions.php b/functions/date_functions.php index cc13518..a15ddcb 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -160,7 +160,7 @@ function chooseOffset($time) { return $offset; } -function openevent($cal, $st, $end, $arr, $lines, $wrap, $clic, $fclic) { +function openevent($cal, $st, $end, $arr, $lines, $wrap, $clic, $fclic, $class) { $event_text = stripslashes(urldecode($arr["event_text"])); # for iCal pseudo tag <http> comptability if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>",$event_text,$reg)) { @@ -192,8 +192,8 @@ function openevent($cal, $st, $end, $arr, $lines, $wrap, $clic, $fclic) { } if ($event_text != "") { if ($lines) $event_text = word_wrap($event_text, $wrap, $lines); - $dsc =urlencode(addslashes($arr["description"])); - echo "<a class=\"psf\" href=\""; + $dsc = urlencode(addslashes($arr["description"])); + echo '<a class="'.$class.'" href="'; if ((!(ereg("([[:alpha:]]+://[^<>[:space:]]+)", $ev, $res))) || ($dsc)) { echo "javascript:w=window.open('"; echo "includes/event.php?event="; @@ -207,7 +207,7 @@ function openevent($cal, $st, $end, $arr, $lines, $wrap, $clic, $fclic) { } else { echo $res[1]; } - echo "\">$clic$event_text</a>"; + echo '">'.$clic.$event_text.'</a>'.$fclic; } } @@ -92,10 +92,7 @@ $num_of_events = 0; </tr> <tr> <td align="center" valign="top"> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> - <tr> - <td colspan="7" width="735"><img src="images/spacer.gif" width="735" height="1" alt=" "></td> - </tr> + <table width="100%" border="0" cellspacing="1" cellpadding="2" class="monthback"> <tr> <?php // loops through 7 times, starts with $week_start_day @@ -103,107 +100,75 @@ $num_of_events = 0; for ($i=0; $i<7; $i++) { $day_num = date("w", $start_day); $day = $daysofweek_lang[$day_num]; - print "<td valign=\"top\" width=\"105\" height=\"12\" class=\"dateback\"><center><font class=\"V9BOLD\">$day</font></center></td>"; + echo '<td valign="top" width="105" height="12" class="dateback"><center class="V9BOLD">'.$day.'</center></td>'; $start_day = strtotime("+1 day", $start_day); } ?> </tr> - <tr> - <td width="105"><img src="images/spacer.gif" width="105" height="1" alt=" "></td> - <td width="105"><img src="images/spacer.gif" width="105" height="1" alt=" "></td> - <td width="105"><img src="images/spacer.gif" width="105" height="1" alt=" "></td> - <td width="105"><img src="images/spacer.gif" width="105" height="1" alt=" "></td> - <td width="105"><img src="images/spacer.gif" width="105" height="1" alt=" "></td> - <td width="105"><img src="images/spacer.gif" width="105" height="1" alt=" "></td> - <td width="105"><img src="images/spacer.gif" width="105" height="1" alt=" "></td> - </tr> - </table> - </td> - </tr> - <tr> - <td align="center" valign="top"> - <table width="100%" border="0" cellspacing="1" cellpadding="0" class="monthback"> <tr> <?php - $sunday = strtotime("$start_month_day"); - $i = 0; - $whole_month = TRUE; - $num_of_events = 0; + $sunday = strtotime("$start_month_day"); + $i = 0; + $whole_month = TRUE; + $num_of_events = 0; do { - $day = date ("j", $sunday); - $daylink = date ("Ymd", $sunday); - $check_month = date ("m", $sunday); + $day = date ("j", $sunday); + $daylink = date ("Ymd", $sunday); + $check_month = date ("m", $sunday); if ($check_month != $this_month) { - $day= "<font class=\"G10G\">$day</font>"; - $bgclass="class=\"monthoff\""; + $day = '<font class="G10G">'.$day.'</font>'; + $bgclass = 'class="monthoff"'; } else { if ($today_today == $daylink) { - $bgclass="class=\"monthon\""; + $bgclass = 'class="monthon"'; } else { - $bgclass="class=\"monthreg\""; + $bgclass = 'class="monthreg"'; } } - if ($i == 0) echo "<tr height=\"105\">\n"; - if (isset($master_array[("$daylink")]) && ($check_month == $this_month)) { - echo "<td align=\"center\" valign=\"top\" $bgclass width=\"105\" height=\"105\">\n"; - echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"; - echo "<tr>\n"; - echo "<td align=\"right\" valign=\"top\" class=\"G10B\">\n"; - echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$daylink\">$day</a>\n"; - echo "</td>\n"; - echo "</tr>\n"; + if ($i == 0) echo '<tr height="105">'; + echo '<td valign="top" align="left" '.$bgclass.' width="105" height="105">'; + if (isset($master_array[("$daylink")])) { + echo '<div align="right"><font class="G10"><a class="psf" href="day.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a></font></div>'; + echo '<div align="left">'; if ($master_array[("$daylink")]) { foreach ($master_array[("$daylink")] as $event_times) { foreach ($event_times as $val) { $num_of_events++; - echo "<tr><td>\n"; - echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">"; - echo "<tr>\n"; if (!isset($val["event_start"])) { - echo '<td align="center">'; openevent("$calendar_name", "", "", $val, $month_event_lines, 12, - "<font class=\"V10\"><i>", - "</i></font>"); + "<div align=\"center\" class=\"V10\"><i>", + "</i></div>", + "psf"); } else { $event_start = @$val["event_start"]; $event_end = @$val["event_end"]; $event_start = date($timeFormat, @strtotime ("$event_start")); - $start2 = date($timeFormat_small,@strtotime("$event_start")); + $start2 = date($timeFormat_small,@strtotime("$event_start")); $event_end = date($timeFormat, @strtotime ("$event_end")); - echo "<td align=\"left\" valign=\"top\">"; @openevent("$calendar_name", "$event_start", "$event_end", $val, $month_event_lines, 12, - "<font class=\"V9\"> $start2 ", - "</font>"); + "<div align=\"left\" class=\"V9\"> $start2 ", + "</div>", + "ps3"); } - echo "</td></tr>\n"; - echo "</table>\n"; - echo "</td></tr>\n"; } } } - echo "</table>\n"; - echo "</td>\n"; + echo '</td>'; } else { - echo "<td align=\"center\" valign=\"top\" $bgclass width=\"105\" height=\"105\">\n"; - echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"; - echo "<tr>\n"; - echo "<td align=\"right\" valign=\"top\" class=\"G10B\">\n"; - echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$daylink\">$day</a>\n"; - echo "</td>\n"; - echo "</tr>\n"; - echo "</table>\n"; - echo "</td>\n"; + echo '<td align="center" valign="top" '.$bgclass.' width="105" height="105">'; + echo '<a class="psf" href="day.php?cal='.$cal.'&getdate='.$daylink.'">'.$day.'</a>'; + echo '</td>'; } $sunday = strtotime("+1 day", $sunday); $i++; if ($i == 7) { - echo "</tr>\n"; + echo '</tr>'; $i = 0; $checkagain = date ("m", $sunday); if ($checkagain != $this_month) $whole_month = FALSE; @@ -215,7 +180,7 @@ $num_of_events = 0; </tr> </table> <?php include (BASE.'includes/calendar_nav.php'); ?> -<?php if (($num_of_events != 0) && ($this_months_events == "yes")) { ?> +<?php if ($this_months_events == "yes") { ?> <br> <table border="0" cellspacing="0" cellpadding="0" width="737" bgcolor="#FFFFFF" class="calborder"> <tr> @@ -273,7 +238,8 @@ $num_of_events = 0; 0, 65, "<font class=\"G10B\"> ", - "</font>"); + "</font>", + "psf"); //echo " <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start2', '$event_end', '$description', '$status')\"><font class=\"G10B\">$event_text</font></a>\n"; echo "</td>\n"; echo "</tr>\n"; @@ -189,7 +189,8 @@ for ($i=0;$i<7;$i++) { $allday_week_lines, 12, '<font color="#ffffff">', - "</font>"); + "</font>", + "psf"); echo "</td></tr>\n"; } echo "</table>\n"; @@ -323,7 +324,8 @@ for ($i=0;$i<7;$i++) { $week_events_lines, 25, "<font class=\"V10W\">", - "</font>"); + "</font>", + "psf"); echo "</td></tr>\n"; echo "</table>\n"; echo "</td>\n"; |