aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJason Oster <parasytic@users.sourceforge.net>2010-02-09 18:06:33 +0000
committerJason Oster <parasytic@users.sourceforge.net>2010-02-09 18:06:33 +0000
commit36380c2546c970bffb131644d95f376ac5688c9a (patch)
treeb679d2674976a3b44390d8bbeb2497353770d30b /functions
parent6f43ce3da6131d96ba5e56f2279d279a30d65db6 (diff)
downloadphpicalendar-36380c2546c970bffb131644d95f376ac5688c9a.tar.gz
phpicalendar-36380c2546c970bffb131644d95f376ac5688c9a.tar.bz2
phpicalendar-36380c2546c970bffb131644d95f376ac5688c9a.zip
Some fixes for the search page
Diffstat (limited to 'functions')
-rw-r--r--functions/template.php129
1 files changed, 66 insertions, 63 deletions
diff --git a/functions/template.php b/functions/template.php
index 22a52ee..d00c890 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -144,13 +144,16 @@ class Page {
global $phpiCal_config, $getdate, $cal, $the_arr, $printview, $dateFormat_day, $timeFormat, $week_start, $week_end, $lang;
preg_match("!<\!-- switch results on -->(.*)<\!-- switch results off -->!Uis", $this->page, $match1);
- preg_match("!<\!-- switch recur on -->(.*)<\!-- loop recur off -->!Uis", $this->page, $match2);
+ preg_match("!<\!-- switch recur on -->(.*)<\!-- switch recur off -->!Uis", $this->page, $match2);
preg_match("!<\!-- switch exceptions on -->(.*)<\!-- switch exceptions off -->!Uis", $this->page, $match3);
$loop_event = trim($match1[1]);
$loop_recur = trim($match2[1]);
$loop_except = trim($match3[1]);
$parse_month = date ("Ym", strtotime($getdate));
+ $events_found = 0;
+ $some_events = '';
+ $final = '';
if (isset($the_arr)){
// Pull out each event
foreach($the_arr as $key => $val) {
@@ -162,83 +165,83 @@ class Page {
if ($val['event_text']) {
$event_text = stripslashes(urldecode($val['event_text']));
$description = stripslashes(urldecode($val['description']));
- $location = stripslashes(urldecode($val['location']));
+ $location = stripslashes(urldecode($val['location']));
$event_start = $val['event_start'];
$event_end = $val['event_end'];
if (isset($val['display_end'])) $event_end = $val['display_end'];
- if (!$val['event_start']) {
- $event_start = $lang['l_all_day'];
- $event_start2 = '';
- $event_end = '';
- } else {
- $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 = $lang['l_all_day'];
+ $event_start2 = '';
+ $event_end = '';
+ } else {
+ $event_start = date ($timeFormat, strtotime ($event_start));
+ $event_end = date ($timeFormat, strtotime ($event_end));
+ $event_start = $event_start .' - '.$event_end;
}
+ }
- if ($description == '') {
- $events_tmp = preg_replace('!<\!-- switch description_events on -->.*<\!-- switch description_events off -->!Uis', '', $events_tmp);
- }
- if (!isset($val['exceptions'])) {
- $events_tmp = preg_replace('!<\!-- switch exceptions on -->.*<\!-- switch exceptions off -->!Uis', '', $events_tmp);
- }else{
- $some_exceptions = "";
- foreach ($val['exceptions'] as $except_val){
- $except_tmp = $loop_except;
-
- $except_date = strtotime($except_val['date']);
- $except_date = localizeDate ('%A, %B %e %Y', $except_date);
- $except_tmp = str_replace('{DAYOFMONTH}', $except_date, $except_tmp);
-
- $except_event_start = date ($timeFormat, strtotime ($except_val['event_start']));
- $except_event_end = date ($timeFormat, strtotime ($except_val['event_end']));
- $except_event_start = $except_event_start .' - '.$except_event_end;
-
- $except_tmp = str_replace('{EVENT_START}', $except_event_start, $except_tmp);
-
- $except_event_text = stripslashes(urldecode($except_val['event_text']));
- $except_tmp = str_replace('{EVENT_TEXT}', $except_event_text, $except_tmp);
-
- #is there a recur in the exception?
- if (!$except_val['recur']) {
- $except_tmp = preg_replace('!<\!-- switch except_recur on -->.*<\!-- switch except_recur off -->!Uis', '', $except_tmp);
- }else{
- $except_tmp = str_replace('{EXCEPT_RECUR}', $except_val['recur'], $except_tmp);
- }
- #is there a description in the exception?
- if (!$except_val['description']) {
- $except_tmp = preg_replace('!<\!-- switch except_description on -->.*<\!-- switch except_description off -->!Uis', '', $except_tmp);
- }else{
- $except_description = stripslashes(urldecode($except_val['description']));
- $except_tmp = str_replace('{EXCEPT_DESCRIPTION}', $except_description, $except_tmp);
- }
- $some_exceptions .= $except_tmp;
+ if ($description == '') {
+ $events_tmp = preg_replace('!<\!-- switch description_events on -->.*<\!-- switch description_events off -->!Uis', '', $events_tmp);
+ }
+ if (!isset($val['exceptions'])) {
+ $events_tmp = preg_replace('!<\!-- switch exceptions on -->.*<\!-- switch exceptions off -->!Uis', '', $events_tmp);
+ }else{
+ $some_exceptions = "";
+ foreach ($val['exceptions'] as $except_val){
+ $except_tmp = $loop_except;
- }
- $events_tmp = preg_replace('!<\!-- switch exceptions on -->.*<\!-- switch exceptions off -->!Uis', $some_exceptions,$events_tmp );
+ $except_date = strtotime($except_val['date']);
+ $except_date = localizeDate ('%A, %B %e %Y', $except_date);
+ $except_tmp = str_replace('{DAYOFMONTH}', $except_date, $except_tmp);
+ $except_event_start = date ($timeFormat, strtotime ($except_val['event_start']));
+ $except_event_end = date ($timeFormat, strtotime ($except_val['event_end']));
+ $except_event_start = $except_event_start .' - '.$except_event_end;
- }
+ $except_tmp = str_replace('{EVENT_START}', $except_event_start, $except_tmp);
+
+ $except_event_text = stripslashes(urldecode($except_val['event_text']));
+ $except_tmp = str_replace('{EVENT_TEXT}', $except_event_text, $except_tmp);
+
+ #is there a recur in the exception?
+ if (!$except_val['recur']) {
+ $except_tmp = preg_replace('!<\!-- switch except_recur on -->.*<\!-- switch except_recur off -->!Uis', '', $except_tmp);
+ }else{
+ $except_tmp = str_replace('{EXCEPT_RECUR}', $except_val['recur'], $except_tmp);
+ }
+ #is there a description in the exception?
+ if (!$except_val['description']) {
+ $except_tmp = preg_replace('!<\!-- switch except_description on -->.*<\!-- switch except_description off -->!Uis', '', $except_tmp);
+ }else{
+ $except_description = stripslashes(urldecode($except_val['description']));
+ $except_tmp = str_replace('{EXCEPT_DESCRIPTION}', $except_description, $except_tmp);
+ }
+ $some_exceptions .= $except_tmp;
- if (!$val['recur']) {
- $events_tmp = preg_replace('!<\!-- switch recur on -->.*<\!-- switch recur off -->!Uis', '', $events_tmp);
- $events_tmp = str_replace('{L_STARTING_ON}', '', $events_tmp);
- }else{
- $events_tmp = str_replace('{RECUR}', $val['recur'], $events_tmp);
}
+ $events_tmp = preg_replace('!<\!-- switch exceptions on -->.*<\!-- switch exceptions off -->!Uis', $some_exceptions,$events_tmp );
+
+
+ }
+
+ if (!$val['recur']) {
+ $events_tmp = preg_replace('!<\!-- switch recur on -->.*<\!-- switch recur off -->!Uis', '', $events_tmp);
+ $events_tmp = str_replace('{L_STARTING_ON}', '', $events_tmp);
+ }else{
+ $events_tmp = str_replace('{RECUR}', $val['recur'], $events_tmp);
+ }
- $search = array('{EVENT_START}', '{EVENT_TEXT}', '{DESCRIPTION}','{LOCATION}');
- $replace = array($event_start, $event_text, $description, $location);
- $events_tmp = str_replace($search, $replace, $events_tmp);
- $some_events .= $events_tmp;
- $events_tmp = $loop_event;
+ $search = array('{EVENT_START}', '{EVENT_TEXT}', '{DESCRIPTION}','{LOCATION}');
+ $replace = array($event_start, $event_text, $description, $location);
+ $events_tmp = str_replace($search, $replace, $events_tmp);
+ $some_events .= $events_tmp;
+ $events_tmp = $loop_event;
$some_events = str_replace('{KEY}', $val['date'], $some_events);
$some_events = str_replace('{DAYOFMONTH}', $dayofmonth, $some_events);
- $final .= $day_tmp.$some_events;
- unset ($day_tmp, $some_events);
+ $final .= $some_events;
+ $some_events = '';
}
}

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