diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-02-05 23:45:54 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-02-05 23:45:54 +0000 |
commit | a0a7d7f0979d6d4bf6c2f39a0e2425d489112aea (patch) | |
tree | aef9ed13221e820a28cba0856be2db681a2c3553 | |
parent | 85287f1ac22ea6d20194baff2d378bf075c1c0bd (diff) | |
download | phpicalendar-a0a7d7f0979d6d4bf6c2f39a0e2425d489112aea.tar.gz phpicalendar-a0a7d7f0979d6d4bf6c2f39a0e2425d489112aea.tar.bz2 phpicalendar-a0a7d7f0979d6d4bf6c2f39a0e2425d489112aea.zip |
Wired Tomorrow's Events with new function.
-rw-r--r-- | day.php | 3 | ||||
-rw-r--r-- | functions/template.php | 42 | ||||
-rw-r--r-- | templates/default/sidebar.tpl | 10 | ||||
-rw-r--r-- | week.php | 3 |
4 files changed, 51 insertions, 7 deletions
@@ -21,6 +21,7 @@ $next_day = date('Ymd', strtotime("+1 day", $unix_time)); $prev_day = date('Ymd', strtotime("-1 day", $unix_time)); $display_date = localizeDate($dateFormat_day, $unix_time); +$sidebar_date = localizeDate($dateFormat_week_list, $unix_time); $start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); @@ -44,6 +45,7 @@ $page->replace_tags(array( 'getdate' => $getdate, 'calendar_name' => $calendar_name, 'display_date' => $display_date, + 'sidebar_date' => $sidebar_date, 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', @@ -63,6 +65,7 @@ $page->replace_tags(array( )); $page->draw_day($this->page); +$page->tomorrows_events($this->page); $page->output(); diff --git a/functions/template.php b/functions/template.php index e7bc7f1..ab0c742 100644 --- a/functions/template.php +++ b/functions/template.php @@ -18,7 +18,7 @@ class Page { $event_url = $allday['url']; if ($event_calno < 1) $event_calno=1; if ($event_calno > 7) $event_calno=7; - $event = openevent($event_calna, '', '', $allday, 0, '', '<span class="V10WB">', '</span>', 'psf', $url); + $event = openevent($event_calna, '', '', $allday, 0, '', '<span class="V10WB">', '</span>', 'psf', $event_url); $loop_tmp = str_replace('{EVENT}', $event, $loop_ad); $loop_tmp = str_replace('{CALNO}', $event_calno, $loop_tmp); $replace .= $loop_tmp; @@ -45,6 +45,46 @@ class Page { } + function tomorrows_events() { + global $template, $getdate, $master_array, $next_day, $timeFormat; + + preg_match("!<\!-- switch t_allday on -->(.*)<\!-- switch t_allday off -->!is", $this->page, $match1); + preg_match("!<\!-- switch t_event on -->(.*)<\!-- switch t_event off -->!is", $this->page, $match2); + $loop_t_ad = trim($match1[1]); + $loop_t_e = trim($match2[1]); + $return_adtmp = ''; + $return_etmp = ''; + + if (is_array($master_array[$next_day])) { + foreach ($master_array[$next_day] as $event_times) { + foreach ($event_times as $val) { + $event_text = stripslashes(urldecode($val["event_text"])); + $event_text = strip_tags($event_text, '<b><i><u>'); + if ($event_text != "") { + $event_start = $val["event_start"]; + $event_end = $val["event_end"]; + $event_calna = $val["calname"]; + $event_url = $val["url"]; + $event_start = date ($timeFormat, @strtotime ($event_start)); + $event_end = date ($timeFormat, @strtotime ($event_end)); + if (!isset($val["event_start"])) { + $event_start = $lang['l_all_day']; + $event_end = ''; + $return_adtmp = openevent($event_calna, $event_start, $event_end, $val, $tomorrows_events_lines, 21, '', '', 'psf', $event_url); + $replace_ad .= str_replace('{T_ALLDAY}', $return_adtmp, $loop_t_ad); + } else { + $return_etmp = openevent($event_calna, $event_start, $event_end, $val, $tomorrows_events_lines, 21, '', '', 'ps3', $event_url); + $replace_e .= str_replace('{T_EVENT}', $return_etmp, $loop_t_e); + } + } + } + } + } + + $this->page = ereg_replace('<!-- switch t_allday on -->(.*)<!-- switch t_allday off -->', $replace_ad, $this->page); + $this->page = ereg_replace('<!-- switch t_event on -->(.*)<!-- switch t_event off -->', $replace_e, $this->page); + } + function draw_month($template_p, $offset = '+0', $type) { global $template, $getdate, $master_array, $this_year, $this_month, $dateFormat_month, $week_start_day, $cal, $minical_view, $month_event_lines, $daysofweekreallyshort_lang, $daysofweekshort_lang, $daysofweek_lang, $timeFormat_small, $timeFormat; preg_match("!<\!-- loop weekday on -->(.*)<\!-- loop weekday off -->!is", $template_p, $match1); diff --git a/templates/default/sidebar.tpl b/templates/default/sidebar.tpl index 48a4062..f0d64e3 100644 --- a/templates/default/sidebar.tpl +++ b/templates/default/sidebar.tpl @@ -1,8 +1,8 @@ <table width="170" border="0" cellpadding="0" cellspacing="0" class="calborder"> <tr> - <td align="left" valign="top" width="24" class="sideback"><a class="psf" href="day.php?cal={CAL}&getdate={YESTERDAYS_DATE}"><img src="templates/{TEMPLATE}/images/left_arrows.gif" alt="{PREV_LANG}" width="16" height="20" border="0" align="left"></a></td> - <td align="center" width="112" class="sideback"><font class="G10BOLD">{DISPLAY_DATE}</font></td> - <td align="right" valign="top" width="24" class="sideback"><a class="psf" href="day.php?cal={CAL}&getdate={TOMORROWS_DATE}"><img src="templates/{TEMPLATE}/images/right_arrows.gif" alt="{NEXT_LANG}" width="16" height="20" border="0" align="right"></a></td> + <td align="left" valign="top" width="24" class="sideback"><a class="psf" href="day.php?cal={CAL}&getdate={PREV_DAY}"><img src="templates/{TEMPLATE}/images/left_arrows.gif" alt="{L_PREV}" width="16" height="20" border="0" align="left"></a></td> + <td align="center" width="112" class="sideback"><font class="G10BOLD">{SIDEBAR_DATE}</font></td> + <td align="right" valign="top" width="24" class="sideback"><a class="psf" href="day.php?cal={CAL}&getdate={NEXT_DAY}"><img src="templates/{TEMPLATE}/images/right_arrows.gif" alt="{L_NEXT}" width="16" height="20" border="0" align="right"></a></td> </tr> <tr> <td colspan="3" bgcolor="#FFFFFF" align="left"> @@ -79,10 +79,10 @@ <td bgcolor="#FFFFFF" align="left"> <div style="padding: 5px;"> <!-- switch t_allday on --> - <i>{T_ALLDAY}</i><br> + {T_ALLDAY}<br /> <!-- switch t_allday off --> <!-- switch t_event on --> - • {T_EVENT}<br> + • {T_EVENT}<br /> <!-- switch t_event off --> </div> </td> @@ -10,7 +10,6 @@ if ($minical_view == "current") $minical_view = "week"; $starttime = "0500"; $weekstart = 1; $unix_time = strtotime($getdate); -$thisday2 = localizeDate($dateFormat_week_list, $unix_time); $today_today = date('Ymd', strtotime("now + $second_offset seconds")); $next_week = date("Ymd", strtotime("+1 week", $unix_time)); $prev_week = date("Ymd", strtotime("-1 week", $unix_time)); @@ -21,6 +20,7 @@ $end_week_time = $start_week_time + (6 * 25 * 60 * 60); $start_week = localizeDate($dateFormat_week, $start_week_time); $end_week = localizeDate($dateFormat_week, $end_week_time); $display_date = "$start_week - $end_week"; +$sidebar_date = localizeDate($dateFormat_week_list, $unix_time); // For the side months ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); @@ -48,6 +48,7 @@ $page->replace_tags(array( 'getdate' => $getdate, 'calendar_name' => $calendar_name, 'display_date' => $display_date, + 'sidebar_date' => $sidebar_date, 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', |