aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwangen <jwangen>2002-10-27 23:55:57 +0000
committerjwangen <jwangen>2002-10-27 23:55:57 +0000
commit05c3bde0c29128d803d98b69b337ccfebe4c1732 (patch)
tree367cc8dc817556900f1fa2dd3200fc4b80e4bb6d
parent8f7bbd8ea0aa7ec0ae35dbfe66c3772651501aca (diff)
downloadphpicalendar-05c3bde0c29128d803d98b69b337ccfebe4c1732.tar.gz
phpicalendar-05c3bde0c29128d803d98b69b337ccfebe4c1732.tar.bz2
phpicalendar-05c3bde0c29128d803d98b69b337ccfebe4c1732.zip
Search furthur implimented
-rw-r--r--functions/ical_parser.php53
-rw-r--r--languages/german.inc.php30
-rw-r--r--languages/portuguese.inc.php25
-rw-r--r--languages/spanish.inc.php28
-rw-r--r--print.php5
-rw-r--r--search.php331
6 files changed, 292 insertions, 180 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 47a0a36..4a9eeb7 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -73,6 +73,14 @@ if ($parse_file) {
// .ics file, we need to have some unique place in the array
$uid_counter = 0;
+ // for custom search ranges of recurring events
+ $search_range = false;
+ if (isset($HTTP_GET_VARS['start']) && isset($HTTP_GET_VARS['end']) && $HTTP_GET_VARS['start'] != '' && $HTTP_GET_VARS['end'] != '') {
+ $search_range_start = strtotime($HTTP_GET_VARS['start']);
+ $search_range_end = strtotime($HTTP_GET_VARS['end']);
+ $search_range = true;
+ }
+
// read file in line by line
// XXX end line is skipped because of the 1-line readahead
while (!feof($ifile)) {
@@ -209,6 +217,24 @@ if ($parse_file) {
$rrule_array['END_TIME'] = $end_time;
$rrule_array['END'] = 'end';
}
+
+ $start_date_time = strtotime($start_date);
+ $this_month_start_time = strtotime($this_year.$this_month.'01');
+ if ($save_parsed_cals == 'yes' && !$is_webcal) {
+ $start_range_time = strtotime($this_year.'-01-01 -1 month -2 days');
+ $end_range_time = strtotime($this_year.'-12-31 +1 month +2 days');
+ if ($search_range) {
+ if ($start_range_time > $search_range_start) $start_range_time = $search_range_start;
+ if ($end_range_time < $search_range_end) $end_range_time = $search_range_end;
+ }
+ } elseif ($search_range) {
+ $start_range_time = $search_range_start;
+ $end_range_time = $search_range_end;
+ } else {
+ $start_range_time = strtotime('-1 month -2 day', $this_month_start_time);
+ $end_range_time = strtotime('+2 month +2 day', $this_month_start_time);
+ }
+
//print_r($rrule_array);
foreach ($rrule_array as $key => $val) {
switch($key) {
@@ -292,39 +318,28 @@ if ($parse_file) {
break;
case 'END':
- // again, $parse_to_year is set to January 10 of the upcoming year
- $parse_to_year_time = mktime(0,0,0,1,10,($this_year + 1));
- $start_date_time = strtotime($start_date);
- $this_month_start_time = strtotime($this_year.$this_month.'01');
-
- if ($save_parsed_cals == 'yes' && !$is_webcal) {
- $start_range_time = strtotime($this_year.'-01-01 -1 month -2 days');
- $end_range_time = strtotime($this_year.'-12-31 +1 month +2 days');
- } else {
- $start_range_time = strtotime('-1 month -2 day', $this_month_start_time);
- $end_range_time = strtotime('+2 month +2 day', $this_month_start_time);
- }
-
// if $until isn't set yet, we set it to the end of our range we're looking at
if (!isset($until)) $until = $end_range_time;
$end_date_time = $until;
+ $start_range_time_tmp = $start_range_time;
+ $end_range_time_tmp = $end_range_time;
// If the $end_range_time is less than the $start_date_time, or $start_range_time is greater
// than $end_date_time, we may as well forget the whole thing
// It doesn't do us any good to spend time adding data we aren't even looking at
// this will prevent the year view from taking way longer than it needs to
- if ($end_range_time >= $start_date_time && $start_range_time <= $end_date_time) {
+ if ($end_range_time_tmp >= $start_date_time && $start_range_time_tmp <= $end_date_time) {
// if the beginning of our range is less than the start of the item, we may as well set it equal to it
- if ($start_range_time < $start_date_time) $start_range_time = $start_date_time;
- if ($end_range_time > $end_date_time) $end_range_time = $end_date_time;
+ if ($start_range_time_tmp < $start_date_time) $start_range_time_tmp = $start_date_time;
+ if ($end_range_time_tmp > $end_date_time) $end_range_time_tmp = $end_date_time;
// initialze the time we will increment
- $next_range_time = $start_range_time;
+ $next_range_time = $start_range_time_tmp;
$count_to = 0;
// start at the $start_range and go until we hit the end of our range.
- while (($next_range_time >= $start_range_time) && ($next_range_time <= $end_range_time) && ($count_to != $count)) {
+ while (($next_range_time >= $start_range_time_tmp) && ($next_range_time <= $end_range_time_tmp) && ($count_to != $count)) {
$func = $freq_type.'Compare';
$diff = $func(date('Ymd',$next_range_time), $start_date);
if ($diff < $count) {
@@ -395,7 +410,7 @@ if ($parse_file) {
break;
default:
// anything else we need to end the loop
- $next_range_time = $end_range_time + 100;
+ $next_range_time = $end_range_time_tmp + 100;
$count_to = $count;
}
} else {
diff --git a/languages/german.inc.php b/languages/german.inc.php
index 4c64dfb..d45fb95 100644
--- a/languages/german.inc.php
+++ b/languages/german.inc.php
@@ -45,24 +45,24 @@ $gomonth_lang = 'Gehe zum aktuellen Monat';
$goyear_lang = 'Gehe zum aktuellen Jahr';
// new in 0.8 -------------
-$search_lang = 'Search'; // the verb
-$results_lang = 'Search Results';
-$query_lang = 'Query: '; // will be followed by the search query
-$no_results_lang = 'No events found';
+$search_lang = 'Suchen'; // the verb
+$results_lang = 'Suchresultate';
+$query_lang = 'Suche: '; // will be followed by the search query
+$no_results_lang = 'Keine Einträge gefunden';
-$goprint_lang = 'Printer Friendly';
-$time_lang = 'Time';
-$summary_lang = 'Summary';
-$description_lang = 'Description';
+$goprint_lang = 'Druckversion';
+$time_lang = 'Zeit';
+$summary_lang = 'Zusammenfassung';
+$description_lang = 'Beschreibung';
// RSS text for 0.8
-$this_site_is_lang = 'This site is';
-$no_events_day_lang = 'No events today.';
-$no_events_week_lang = 'No events this week.';
-$no_events_month_lang = 'No events this month.';
-$rss_day_date = 'g:i A'; // Lists just the time
-$rss_week_date = '%b %e'; // Lists just the day
-$rss_month_date = '%b %e'; // Lists just the day
+$this_site_is_lang = 'Diese Site ist';
+$no_events_day_lang = 'Keine Einträge für heute.';
+$no_events_week_lang = 'Keine Einträge in dieser Woche.';
+$no_events_month_lang = 'Keine Einträge in diesem Monat.';
+$rss_day_date = 'H:i'; // Lists just the time
+$rss_week_date = '%e. %b'; // Lists just the day
+$rss_month_date = '%e. %b'; // Lists just the day
// -------------------------
$daysofweek_lang = array ('Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag');
diff --git a/languages/portuguese.inc.php b/languages/portuguese.inc.php
index b9c0295..b98044c 100644
--- a/languages/portuguese.inc.php
+++ b/languages/portuguese.inc.php
@@ -1,7 +1,7 @@
<?php
-// English language include
-// For version 0.7 PHP iCalendar
+// Portuguese language include
+// For version 0.8 PHP iCalendar
//
// Translation by Rui Costa (ruicosta@ubi.pt)
//
@@ -45,6 +45,27 @@ $goweek_lang = 'Ir para este semana';
$gomonth_lang = 'Ir para este mes';
$goyear_lang = 'Ir para este ano';
+// new in 0.8 -------------
+$search_lang = 'Search'; // the verb
+$results_lang = 'Search Results';
+$query_lang = 'Query: '; // will be followed by the search query
+$no_results_lang = 'No events found';
+
+$goprint_lang = 'Printer Friendly';
+$time_lang = 'Time';
+$summary_lang = 'Summary';
+$description_lang = 'Description';
+
+// RSS text for 0.8
+$this_site_is_lang = 'This site is';
+$no_events_day_lang = 'No events today.';
+$no_events_week_lang = 'No events this week.';
+$no_events_month_lang = 'No events this month.';
+$rss_day_date = 'g:i A'; // Lists just the time
+$rss_week_date = '%b %e'; // Lists just the day
+$rss_month_date = '%b %e'; // Lists just the day
+// -------------------------
+
$daysofweek_lang = array ('Domingo','Segunda','Terca','Quarta','Quinta','Sexta','Sabado');
$daysofweekshort_lang = array ('Dom','Seg','Ter','Qua','Qui','Sex','Sab');
$daysofweekreallyshort_lang = array ('D','S','T','Q','Q','S','S');
diff --git a/languages/spanish.inc.php b/languages/spanish.inc.php
index c1f6c6e..bdae1f3 100644
--- a/languages/spanish.inc.php
+++ b/languages/spanish.inc.php
@@ -43,24 +43,24 @@ $gomonth_lang = 'Ir a Este Mes';
$goyear_lang = 'Ir a Este A&ntilde;o';
// new in 0.8 -------------
-$search_lang = 'Search'; // the verb
-$results_lang = 'Search Results';
-$query_lang = 'Query: '; // will be followed by the search query
-$no_results_lang = 'No events found';
+$search_lang = 'Buscar'; // the verb
+$results_lang = 'Resultados de b&uacute;squeda';
+$query_lang = 'Consulta: '; // will be followed by the search query
+$no_results_lang = 'Ning&uacute;n evento encontrado';
-$goprint_lang = 'Printer Friendly';
-$time_lang = 'Time';
-$summary_lang = 'Summary';
-$description_lang = 'Description';
+$goprint_lang = 'Formato de impresi&oacute;n';
+$time_lang = 'Hora';
+$summary_lang = 'Resumen';
+$description_lang = 'Descripci&oacute;n';
// RSS text for 0.8
-$this_site_is_lang = 'This site is';
-$no_events_day_lang = 'No events today.';
-$no_events_week_lang = 'No events this week.';
-$no_events_month_lang = 'No events this month.';
+$this_site_is_lang = 'Esta p&aacute;gina es';
+$no_events_day_lang = 'No hay eventos para hoy.';
+$no_events_week_lang = 'No hay eventos para esta semana.';
+$no_events_month_lang = 'No hay eventos para este mes.';
$rss_day_date = 'g:i A'; // Lists just the time
-$rss_week_date = '%b %e'; // Lists just the day
-$rss_month_date = '%b %e'; // Lists just the day
+$rss_week_date = '%e de %b'; // Lists just the day
+$rss_month_date = '%e de %b'; // Lists just the day
// -------------------------
$daysofweek_lang = array ('Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado');
diff --git a/print.php b/print.php
index cbc35e5..97b3a29 100644
--- a/print.php
+++ b/print.php
@@ -163,4 +163,7 @@ if ($printview == 'day') {
</td>
</tr>
</table>
-<?php include (BASE.'footer.inc.php'); ?> \ No newline at end of file
+<?php include (BASE.'footer.inc.php'); ?>
+</center>
+</body>
+</html> \ No newline at end of file
diff --git a/search.php b/search.php
index a2ab225..4ffa0c8 100644
--- a/search.php
+++ b/search.php
@@ -4,20 +4,218 @@ define('BASE','./');
$current_view = 'search';
include('./functions/ical_parser.php');
+if (isset($HTTP_SERVER_VARS['HTTP_REFERER']) && $HTTP_SERVER_VARS['HTTP_REFERER'] != '') {
+ $back_page = $HTTP_SERVER_VARS['HTTP_REFERER'];
+} else {
+ $back_page = BASE.$default_view.'.php?cal='.$cal.'&getdate='.$getdate;
+}
+
+$search_valid = false;
+if (isset($HTTP_GET_VARS['query']) && $HTTP_GET_VARS['query'] != '') {
+ $query = $HTTP_GET_VARS['query'];
+ $search_valid = true;
+}
+
+$formatted_start_range = localizeDate($dateFormat_week, $start_range_time);
+$formatted_end_range = localizeDate($dateFormat_week, $end_range_time);
+
+$search_box = '';
// yet to be implemented
switch($HTTP_GET_VARS['mode']) {
case 'advanced_search':
// display advanced search stuff
+
break;
case 'search':
// display simple search stuff
+ $search_box .=
+ '<form action="search.php" method="GET">'."\n".
+ '<input type="text" size="15" name="query" value="'.$query.'">'."\n".
+ '<input type="submit" value="Search">'."\n".
+ '</form>';
break;
case 'results':
// display results of either simple or advanced search
break;
default:
// some generic thing, maybe same as search
+ $search_box .=
+ '<form action="search.php" method="GET">'."\n".
+ '<input type="text" size="15" name="query" value="'.$query.'">'."\n".
+ '<input type="submit" value="Search">'."\n".
+ '</form>';
+}
+
+$search_started = getmicrotime();
+if ($search_valid) {
+ $format_search_arr = format_search($query);
+ $formatted_search = $format_search_arr[0];
+ if (isset($master_array) && is_array($master_array)) {
+ foreach($master_array as $date_key_tmp => $date_tmp) {
+ if (is_array($date_tmp)) {
+ foreach($date_tmp as $time_tmp) {
+ if (is_array($time_tmp)) {
+ foreach ($time_tmp as $event_tmp) {
+ if (is_array($event_tmp)) {
+ $results1 = search_boolean($format_search_arr,$event_tmp['event_text']);
+ if (!$results1) {
+ $results2 = search_boolean($format_search_arr,$event_tmp['description']);
+ }
+ if ($results1 || $results2) {
+ $event_tmp['date'] = $date_key_tmp;
+ $the_arr[] = $event_tmp;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} else {
+ $formatted_search = '<b>No query given</b>';
}
+$search_ended = getmicrotime();
+
+$search_took = number_format(($search_ended-$search_started),3);
+
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8">
+ <title><?php echo "$calendar_name - $results_lang"; ?></title>
+ <link rel="stylesheet" type="text/css" href="styles/<?php echo $style_sheet.'/default.css'; ?>">
+</head>
+<body bgcolor="#FFFFFF">
+<center>
+<table border="0" width="700" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder">
+ <tr>
+ <td>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td align="left" width="90" class="navback"><?php echo '<a href="'.$back_page.'"><img src="styles/'.$style_sheet.'/back.gif" alt="" border="0" align="left"></a>'; ?></td>
+ <td class="navback">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td align="center" class="navback" nowrap valign="middle"><font class="H20"><?php echo $results_lang; ?></font></td>
+ </tr>
+ </table>
+ </td>
+ <td align="right" width="90" class="navback">
+ <table width="90" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><?php echo '<a class="psf" href="day.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/day_on.gif" alt="" border="0"></td>'; ?>
+ <td><?php echo '<a class="psf" href="week.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/week_on.gif" alt="" border="0"></td>'; ?>
+ <td><?php echo '<a class="psf" href="month.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/month_on.gif" alt="" border="0"></td>'; ?>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" class="dayborder"><img src="images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td colspan="3">
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td align="center" valign="top">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="3" height="1"></td>
+ </tr>
+ <tr>
+ <td colspan="3" class="G10B" align="center"><?php echo $search_box; ?></td>
+ </tr>
+ <tr>
+ <td colspan="3" class="G10B" align="center"><?php echo $query_lang.$formatted_search; ?></td>
+ </tr>
+ <tr>
+ <td colspan="3" class="G10B">&nbsp;</td>
+ </tr>
+ <?php
+ if (isset($the_arr) && is_array($the_arr)) {
+ foreach($the_arr as $val) {
+ $key = $val['date'];
+ $dayofmonth = strtotime ($key);
+ $dayofmonth = localizeDate ($dateFormat_day, $dayofmonth);
+ echo "<tr><td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\"></td>\n";
+ echo "<td align=\"left\" colspan=\"2\"><font class=\"V12\"><b><a class=\"ps3\" href=\"day.php?cal=$cal&getdate=$key\">$dayofmonth</a></b></font></td></tr>";
+ echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"5\"></td></tr>\n";
+
+ if ($val["event_text"]) {
+ $event_text = stripslashes(urldecode($val["event_text"]));
+ $description = stripslashes(urldecode($val["description"]));
+ $event_start = $val["event_start"];
+ $event_end = $val["event_end"];
+ $event_start = date ($timeFormat, strtotime ("$event_start"));
+ $event_end = date ($timeFormat, strtotime ("$event_end"));
+ $event_start = "$event_start - $event_end";
+ if (!$val["event_start"]) {
+ $event_start = "$all_day_lang";
+ $event_start2 = '';
+ $event_end = '';
+ }
+ echo "<tr>\n";
+ echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\"></td>\n";
+ echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\"></td>\n";
+ echo "<td align=\"left\">\n";
+ echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n";
+ echo "<tr>\n";
+ echo "<td width=\"100\" class=\"G10BOLD\">$time_lang:</td>\n";
+ echo "<td align=\"left\" class=\"G10B\">$event_start</td>\n";
+ echo "</tr>\n";
+ echo "<tr>\n";
+ echo "<td valign=\"top\" width=\"100\" class=\"G10BOLD\">$summary_lang:</td>\n";
+ echo "<td valign=\"top\" align=\"left\" class=\"G10B\">$event_text</td>\n";
+ echo "</tr>\n";
+ if ($val["description"]) {
+ echo "<tr>\n";
+ echo "<td valign=\"top\" width=\"100\" class=\"G10BOLD\">$description_lang:</td>\n";
+ echo "<td valign=\"top\" align=\"left\" class=\"G10B\">$description</td>\n";
+ echo "</tr>\n";
+ }
+ echo "</table>\n";
+ echo "</td>\n";
+ echo "</tr>\n";
+ echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"10\"></td></tr>\n";
+ }
+ }
+ } else {
+ echo '<tr><td colspan="3" class="G10B" align="center">';
+ echo $no_results_lang;
+ echo '</td></tr><tr><td class="G10B">&nbsp;</td></tr>';
+ }
+
+
+
+ ?>
+ <tr>
+ <td colspan="3" class="G10B" align="center">
+ <?php
+ echo 'Recurring events searched in range:<br>';
+ echo '<b>'.$formatted_start_range.' - '.$formatted_end_range.'</b><br>';
+ echo '<font class="V9G">Search took '.$search_took.' seconds</font><br><br>';
+ ?>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</center>
+<?php include (BASE.'footer.inc.php'); ?>
+</body>
+</html>
+<?php
// takes a boolean search and formats it into an array
// use with sister function search_boolean()
@@ -143,133 +341,8 @@ function search_boolean($needle_arr, $haystack) {
return true;
}
-$search_string = 'final';
-
-$format_search_arr = format_search($search_string);
-$formatted_search = $format_search_arr[0];
-
-if (isset($master_array) && is_array($master_array)) {
- foreach($master_array as $date_key_tmp => $date_tmp) {
- if (is_array($date_tmp)) {
- foreach($date_tmp as $time_tmp) {
- if (is_array($time_tmp)) {
- foreach ($time_tmp as $event_tmp) {
- if (is_array($event_tmp)) {
- $results1 = search_boolean($format_search_arr,$event_tmp['event_text']);
- if (!$results1) {
- $results2 = search_boolean($format_search_arr,$event_tmp['description']);
- }
- if ($results1 || $results2) {
- $event_tmp['date'] = $date_key_tmp;
- $the_arr[] = $event_tmp;
- }
- }
- }
- }
- }
- }
- }
+function getmicrotime() {
+ list($usec, $sec) = explode(' ',microtime());
+ return ((float)$usec + (float)$sec);
}
-
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
-<html>
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8">
- <title><?php echo "$calendar_name - Search Results"; ?></title>
- <link rel="stylesheet" type="text/css" href="styles/<?php echo "$style_sheet/default.css"; ?>">
- <?php include "functions/event.js"; ?>
-</head>
-<body>
-<center>
-<table border="0" width="520" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder">
- <tr>
- <td align="left" valign="top" width="1" class="sideback"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"1\" height=\"20\" border=\"0\" align=\"left\">"; ?></td>
- <td align="center" class="sideback"><font class="G10BOLD"><?php print "Search Results" ?></font></td>
- <td align="right" valign="top" width="1" class="sideback"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"1\" height=\"20\" border=\"0\" align=\"right\">"; ?></td>
- </tr>
- <tr>
- <td colspan="3">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td align="center" valign="top">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="left" valign="top" width="1" height="20" class="montheventtop"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"1\" height=\"20\" border=\"0\" align=\"left\">"; ?></td>
- <td align="center" class="montheventtop" height="20" width="320" nowrap><font class="G10B"><?php echo 'Search: '.$formatted_search; ?></font></td>
- <td align="right" valign="top" width="1" height="20" class="montheventtop"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" width=\"1\" height=\"20\" border=\"0\" align=\"right\">"; ?></td>
- </tr>
- <tr>
- <td colspan="3" height="1"></td>
- </tr>
- <?php
- // Iterate the search results
- if (is_array($the_arr)) {
- echo "<tr>\n";
- echo "<td colspan=\"3\"><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\">\n";
- foreach($the_arr as $val) {
- $thedate = $val['date'];
- $dayofmonth = strtotime ($thedate);
- $dayofmonth = localizeDate ($dateFormat_week_list, $dayofmonth);
- $i = 0;
- if ($getdate == $thedate) {
- $fontclass="class=\"G10BOLD\"";
- } else {
- $fontclass="class=\"G10B\"";
- }
- if ($val["event_text"]) {
- $event_text = stripslashes(urldecode($val["event_text"]));
- $event_text2 = addslashes($val["event_text"]);
- $event_text2 = str_replace("\"", "&quot;", $event_text2);
- $event_text2 = urlencode($event_text2);
- $description = addslashes($val["description"]);
- $description = str_replace("\"", "&quot;", $description);
- $event_start = $val["event_start"];
- $event_end = $val["event_end"];
- $event_start = date ($timeFormat, strtotime ("$event_start"));
- $event_end = date ($timeFormat, strtotime ("$event_end"));
- $event_text = str_replace ("<br>", "", $event_text);
- $event_start2 = $event_start;
- if (strlen($event_text) > 70) {
- $event_text = substr("$event_text", 0, 65);
- $event_text = $event_text . "...";
- }
- if (!$val["event_start"]) {
- $event_start = "$all_day_lang";
- $event_start2 = '';
- $event_end = '';
- }
- echo "<tr><td width=\"30%\" class=\"montheventline\" nowrap align=\"left\" valign=\"top\"><font $fontclass>&nbsp;<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$thedate\">$dayofmonth</a></font> <font class=\"V9G\">($event_start)</font></td>\n";
- echo "<td width=\"30%\" class=\"montheventline\" nowrap align=\"left\" valign=\"top\">\n";
- echo "&nbsp;<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start2', '$event_end', '$description')\"><font class=\"G10B\">$event_text</font></a>\n";
- echo "</td>\n";
- echo "<td align=\"left\" valign=\"top\" nowrap>\n";
- echo '<font class="G10B">'.htmlspecialchars(urldecode($val["description"])).'</font>';
- echo "</td></tr>\n";
- }
- }
- echo "</table></td>\n";
- echo "</tr>\n";
-
- } else {
- echo "<tr>\n";
- echo "<td colspan=\"3\" align=\"center\"><font class=\"G10B\">No results found</font></td>\n";
- echo "</tr>\n";
- }
-
- ?>
- </table>
- </td>
- </tr>
- </table>
-
-
- </td>
- </tr>
-</table>
-<?php include (BASE.'footer.inc.php'); ?>
-</center>
-</body>
-</html>
+?> \ No newline at end of file

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