aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-10-06 19:51:02 +0000
committerChad Little <clittle@users.sourceforge.net>2002-10-06 19:51:02 +0000
commit89d24274b2c0810d5e595b499983cb7664c70b88 (patch)
tree901e883facd7c472985a8e1d6366b2aa2428a56c
parentb2612dce88e25a1381f4b48a1157a731bdd4fa32 (diff)
downloadphpicalendar-89d24274b2c0810d5e595b499983cb7664c70b88.tar.gz
phpicalendar-89d24274b2c0810d5e595b499983cb7664c70b88.tar.bz2
phpicalendar-89d24274b2c0810d5e595b499983cb7664c70b88.zip
Month tweeks, added multiple line support (again) to parser. Broke the error stuff.
-rw-r--r--config.inc.php3
-rw-r--r--functions/error.php4
-rw-r--r--functions/ical_parser.php25
-rw-r--r--month_bottom.php43
4 files changed, 32 insertions, 43 deletions
diff --git a/config.inc.php b/config.inc.php
index b596086..a7e2545 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -9,7 +9,7 @@ $style_sheet = 'silver'; // Themes support
$calendar_path = './calendars'; // Path to directory with calendars
$default_view = 'day'; // Default view for calendars = 'day', 'week', 'month'
$default_cal = 'Home'; // Exact filename of calendar without .ics
-$language = 'japanese'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish'
+$language = 'english'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish'
$week_start_day = 'sunday'; // Day of the week your week starts on
$day_start = '0700'; // Start time for day grid
$gridLength = '15'; // Grid distance in minutes for day view, multiples of 15 preferred
@@ -22,6 +22,7 @@ $use_sessions = 'yes'; // This has not yet been implemented.
$display_custom_goto = 'no'; // In the 'Jump To' box, display the custom 'go to day' box.
$display_ical_list = 'yes'; // In the 'Jump To' box, display the pop-up menu with the list of all calendars in the $calendar_path directory.
$allow_webcals = 'no'; // Allow http:// and webcal:// prefixed URLs to be used as the $cal for remote viewing of "subscribe-able" calendars. This does not have to be enabled to allow specific ones below.
+$this_months_events = 'yes'; // Display "This month's events" at the bottom off the month page.
$blacklisted_cals[] = ''; // Fill in between the quotes the name of the calendars
$blacklisted_cals[] = ''; // you wish to 'blacklist' or that you don't want to show up in your calendar
diff --git a/functions/error.php b/functions/error.php
index 310d3c7..8a59e86 100644
--- a/functions/error.php
+++ b/functions/error.php
@@ -40,7 +40,6 @@ function error($error_msg='There was an error processing the request.', $file='N
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B">
<tr>
- <td height="300"><img height="300" width="1" src="images/spacer.gif"></td>
<td align="center" valign="top">
<br>
<?php echo $error_msg; ?>
@@ -50,8 +49,9 @@ function error($error_msg='There was an error processing the request.', $file='N
<br>
<br>
<?php echo $error_back_lang; ?>
+ <br>
+ <br>
</td>
- <td height="300"><img height="300" width="1" src="images/spacer.gif"></td>
</tr>
</table>
</td>
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 929392e..8ac7d9b 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -55,16 +55,18 @@ if ($is_webcal == false && $save_parsed_cals == 'yes') {
}
}
-// Start the session
-//session_start();
-//if (($aYear != $this_year) || ($use_sessions != 'yes') || (!is_array($aArray))) {
-//echo 'not using sessions';
if ($parse_file) {
// open the iCal file, read it into a string
+// Then turn it into an array after we pull every wrapped line up a level.
+// Error thingy doens't seem to work now though.
$contents = @file($filename);
-if ($contents[0] != 'BEGIN:VCALENDAR'."\n") exit(error($error_invalidcal_lang, $filename));
+$contents = implode("", $contents);
+$contents = ereg_replace("\n ", "", $contents);
+$contents = split ("\n", $contents);
+// if ($contents[0] != 'BEGIN:VCALENDAR'."\n") exit(error($error_invalidcal_lang, $filename));
+// echo "$contents[0]";
// Set a value so we can check to make sure $master_array contains valid data
$master_array['-1'] = 'valid cal file';
@@ -676,19 +678,6 @@ if (isset($master_array) && is_array($master_array) && $save_parsed_cals == 'yes
// this bracket is the end of the if ($parse_file) statment
}
-// Store information in the session
-/*if ($use_sessions == 'yes') {
- session_start();
- session_register( 'aArray', 'aYear', 'aLanguage', 'aCalendar' );
- $aArray = $master_array;
- $aYear = $this_year;
- $aLanguage = $language;
- $aCalendar = $cal;
-}*/
-
-
-// End the session
-//}
//If you want to see the values in the arrays, uncomment below.
//print '<pre>';
diff --git a/month_bottom.php b/month_bottom.php
index 406b534..8e1d18a 100644
--- a/month_bottom.php
+++ b/month_bottom.php
@@ -6,23 +6,25 @@
$cal_displayname2 = $cal_displayname2 . "...";
}
+ $next_day = date("Ymd", strtotime("+1 day", $unix_time));
+ $prev_day = date("Ymd", strtotime("-1 day", $unix_time));
?>
<br>
<table border="0" width="737" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder">
<tr>
- <td align="left" valign="top" width="1%" class="sideback"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$prev_month\"><img src=\"styles/$style_sheet/left_arrows.gif\" alt=\"right\" border=\"0\" align=\"left\"></a>"; ?></td>
+ <td align="left" valign="top" width="1%" class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$prev_day\"><img src=\"styles/$style_sheet/left_arrows.gif\" alt=\"right\" border=\"0\" align=\"left\"></a>"; ?></td>
<td align="center" class="sideback"><font class="G10B"><b><?php print (localizeDate ($dateFormat_day, strtotime($getdate))); ?></b></font></td>
- <td align="right" valign="top" width="1%" class="sideback"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$next_month\"><img src=\"styles/$style_sheet/right_arrows.gif\" alt=\"right\" border=\"0\" align=\"right\"></a>"; ?></td>
+ <td align="right" valign="top" width="1%" class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$next_day\"><img src=\"styles/$style_sheet/right_arrows.gif\" alt=\"right\" border=\"0\" align=\"right\"></a>"; ?></td>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" width="1" height="5"></td>
</tr>
<tr>
<td width="1%" valign="top" align="right">
- <table cellpadding="0" cellspacing="0" border="0" width="175">
+ <table cellpadding="0" cellspacing="0" border="0" width="160">
<tr>
<td valign="center" align="center">
- <table width="175" border="0" cellpadding="0" cellspacing="0">
+ <table width="160" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" width="1"><img src="images/spacer.gif" width="1" height="20"></td>
<td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("-1 month", strtotime($getdate)))); ?></font></td>
@@ -101,11 +103,11 @@
<td width="98%" valign="top" align="center">
<table border="0" width="330" cellspacing="0" cellpadding="0">
<tr>
- <td width="175" valign="top">
- <table cellpadding="0" cellspacing="0" border="0" width="175">
+ <td width="160" valign="top">
+ <table cellpadding="0" cellspacing="0" border="0" width="160">
<tr>
<td valign="center" align="center">
- <table width="175" border="0" cellpadding="0" cellspacing="0">
+ <table width="160" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" bgcolor="#FFFFFF" align="left">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%">
@@ -162,11 +164,11 @@
</table>
</td>
<td><img src="images/spacer.gif" width="10" height="1"></td>
- <td width="175" valign="top">
- <table cellpadding="0" cellspacing="0" border="0" width="175">
+ <td width="160" valign="top">
+ <table cellpadding="0" cellspacing="0" border="0" width="160">
<tr>
<td valign="center" align="left" valign="top">
- <table width="175" border="0" cellpadding="0" cellspacing="0">
+ <table width="160" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" bgcolor="#FFFFFF" align="left" valign="top">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%">
@@ -225,10 +227,10 @@
</table>
</td>
<td width="1%" valign="top" align="left">
- <table cellpadding="0" cellspacing="0" border="0" width="175">
+ <table cellpadding="0" cellspacing="0" border="0" width="160">
<tr>
<td valign="center" align="center">
- <table width="175" border="0" cellpadding="0" cellspacing="0">
+ <table width="160" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" width="1"><img src="images/spacer.gif" width="1" height="20"></td>
<td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("+1 month", strtotime($getdate)))); ?></font></td>
@@ -307,7 +309,7 @@
</td>
</tr>
-<?php if ($num_of_events != 0) { ?>
+<?php if (($num_of_events != 0) && ($this_months_events == "yes")) { ?>
<tr>
<td colspan="3">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
@@ -315,9 +317,9 @@
<td align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
- <td align="left" valign="top" width="150" class="montheventtop"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"16\" height=\"20\" border=\"0\" align=\"left\"></a>"; ?></td>
- <td align="center" class="montheventtop" width="437" nowrap><font class="G10BOLD"><?php echo "$this_months_lang"; ?></font></td>
- <td align="right" valign="top" width="150" class="montheventtop"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"16\" height=\"20\" border=\"0\" align=\"right\"></a>"; ?></td>
+ <td align="left" valign="top" width="160" class="montheventtop"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"16\" height=\"20\" border=\"0\" align=\"left\"></a>"; ?></td>
+ <td align="center" class="montheventtop" width="417" nowrap><font class="G10BOLD"><?php echo "$this_months_lang"; ?></font></td>
+ <td align="right" valign="top" width="160" class="montheventtop"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"16\" height=\"20\" border=\"0\" align=\"right\"></a>"; ?></td>
</tr>
<tr>
<td colspan="3" height="1"></td>
@@ -358,14 +360,11 @@
$event_text = substr("$event_text", 0, 65);
$event_text = $event_text . "...";
}
+ if (!$new_val2["event_start"]) $event_start = "$all_day_lang";
echo "<tr>\n";
- echo "<td class=\"montheventline\"><font $fontclass>&nbsp;<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$key\">$dayofmonth</a></font> <font class=\"V9G\">($event_start)</font></td>\n";
+ echo "<td width =\"160\" class=\"montheventline\" nowrap><font $fontclass>&nbsp;<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$key\">$dayofmonth</a></font> <font class=\"V9G\">($event_start)</font></td>\n";
echo "<td colspan=\"2\">\n";
- if (!$new_val2["event_start"]) {
- echo "&nbsp;<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"G10B\">$event_text</font></a> <font class=\"V9G\">($all_day_lang)</font>\n";
- } else {
- echo "&nbsp;<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"G10B\">$event_text</font></a>\n";
- }
+ echo "&nbsp;<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"G10B\">$event_text</font></a>\n";
echo "</td>\n";
echo "</tr>\n";
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy