aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-02-01 07:20:46 +0000
committerChad Little <clittle@users.sourceforge.net>2004-02-01 07:20:46 +0000
commit079f586e17e76feb1ac39adba0bbeaf5396e2ee4 (patch)
treec4fc56393ffa9db8a3e8b003a9ac2b282cfc9acc
parent360568009988ec4dc4cef2af54d6790550ab4c18 (diff)
downloadphpicalendar-079f586e17e76feb1ac39adba0bbeaf5396e2ee4.tar.gz
phpicalendar-079f586e17e76feb1ac39adba0bbeaf5396e2ee4.tar.bz2
phpicalendar-079f586e17e76feb1ac39adba0bbeaf5396e2ee4.zip
Month bottom now works.
-rw-r--r--functions/template.php56
-rw-r--r--month.php2
-rw-r--r--templates/default/month.tpl26
3 files changed, 71 insertions, 13 deletions
diff --git a/functions/template.php b/functions/template.php
index 81b5016..3d694b4 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -106,7 +106,6 @@ class Page {
#print_r($switch);
foreach ($switch as $tag => $data) {
- #echo $tag.'<br>';
$temp = str_replace('{'.$tag.'}', $data, $temp);
}
$middle .= $temp;
@@ -125,10 +124,61 @@ class Page {
$return = str_replace('{MONTH_TITLE}', $month_title, $return);
$return = str_replace('{CAL}', $cal, $return);
- return $return;
-
+ return $return;
}
+ function monthbottom() {
+ global $template, $getdate, $master_array, $this_year, $this_month, $cal, $timeFormat, $timeFormat_small, $dateFormat_week_list, $lang;
+ preg_match("!<\!-- loop showbottomevents_odd on -->(.*)<\!-- loop showbottomevents_odd off -->!is", $this->page, $match1);
+ preg_match("!<\!-- loop showbottomevents_even on -->(.*)<\!-- loop showbottomevents_even off -->!is", $this->page, $match2);
+
+ $loop[0] = trim($match1[1]);
+ $loop[1] = trim($match2[1]);
+
+ $m_start = $this_year.$this_month.'01';
+ $u_start = strtotime($m_start);
+ $i=0;
+ do {
+ foreach ($master_array[$m_start] as $event_times) {
+ $switch['CAL'] = $cal;
+ $switch['START_DATE'] = localizeDate ($dateFormat_week_list, $u_start);
+ foreach ($event_times as $val) {
+ $event_calno = $val['calnumber'];
+ $event_calna = $val['calname'];
+ $event_url = $val['url'];
+ if (!isset($val['event_start'])) {
+ $switch['START_TIME'] = $lang['l_all_day'];
+ $switch['DESCRIPTION'] = urldecode($val['description']);
+ $switch['EVENT_TEXT'] = openevent($event_calna, '', '', $val, $month_event_lines, 15, '', '', 'psf', $event_url);
+ } else {
+ $event_start = $val['start_unixtime'];
+ $event_end = (isset($val['display_end'])) ? $val['display_end'] : $val["event_end"];
+ $event_start = date($timeFormat, $val['start_unixtime']);
+ $event_end = date($timeFormat, @strtotime ($event_end));
+ $switch['START_TIME'] = $event_start . ' - ' . $event_end;
+ $switch['EVENT_TEXT'] = openevent($event_calna, '', '', $val, $month_event_lines, 15, '', '', 'psf', $event_url);
+ $switch['DESCRIPTION'] = urldecode($val['description']);
+ }
+ if ($switch['EVENT_TEXT'] != '') {
+ $switch['DAYLINK'] = $m_start;
+ $temp = $loop[$i];
+ foreach ($switch as $tag => $data) {
+ $temp = str_replace('{'.$tag.'}', $data, $temp);
+ }
+ $middle .= $temp;
+ $i = ($i == 1) ? 0 : 1;
+ }
+ }
+ }
+ $u_start = strtotime("+1 day", $u_start);
+ $m_start = date('Ymd', $u_start);
+ $check_month = date('m', $u_start);
+ unset ($switch);
+ } while ($this_month == $check_month);
+
+ $this->page = ereg_replace('<!-- loop showbottomevents_odd on -->(.*)<!-- loop showbottomevents_even off -->', $middle, $this->page);
+
+ }
function Page($template = 'std.tpl') {
if (file_exists($template))
diff --git a/month.php b/month.php
index 760edba..2ae91a5 100644
--- a/month.php
+++ b/month.php
@@ -72,6 +72,8 @@ $page->replace_tags(array(
'style_select' => $style_select
));
+$page->monthbottom($this->page);
+
$page->output();
diff --git a/templates/default/month.tpl b/templates/default/month.tpl
index dc24b50..59bc790 100644
--- a/templates/default/month.tpl
+++ b/templates/default/month.tpl
@@ -42,34 +42,40 @@
{CALENDAR_NAV}
<!-- switch showbottom on -->
<br>
- <table width="737" border="0" cellspacing="0" cellpadding="0" class="calborder">
+ <table width="735" border="0" cellspacing="0" cellpadding="0" class="calborder">
<tr>
- <td colspan="3" align="center" class="sideback" nowrap>
- <div style="height: 20px;">
- <b>{L_THIS_MONTHS}</b>
- </div>
+ <td align="center" valign="middle" bgcolor="white">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td align="right" width="40%" class="navback"><a class="psf" href="month.php?cal={CAL}&amp;getdate={PREV_MONTH}"><img src="templates/{TEMPLATE}/images/left_day.gif" alt="{L_PREV}" border="0" align="right"></a></td>
+ <td align="center" width="20%" class="navback" nowrap valign="middle"><font class="H20">{L_THIS_MONTHS}</font></td>
+ <td align="left" width="40%" class="navback"><a class="psf" href="month.php?cal={CAL}&amp;getdate={NEXT_MONTH}"><img src="templates/{TEMPLATE}/images/right_day.gif" alt="{L_NEXT}" border="0" align="left"></a></td>
+ </tr>
+ </table>
</td>
- </tr>
+ </tr>
<tr>
<td>
<table width="100%" cellspacing="1" cellpadding="4" border="0">
<!-- loop showbottomevents_odd on -->
<tr align="left" valign="top">
<td width="170" nowrap>
- <a class="psf" href="{CAL}&amp;getdate={DAYLINK}">{START_DATE}</a> <font class="V9G">({START_TIME})</font>
+ <a class="psf" href="day.php?cal={CAL}&amp;getdate={DAYLINK}">{START_DATE}</a><br>
+ <span class="V9G">{START_TIME}</span>
</td>
<td>
- {JS_OPENEVENT}<a class="psf" href="#" onclick="openEventWindow({EVENT_NUMBER}); return false;"><font class="G10B">{EVENT_TEXT}</font></a>
+ {EVENT_TEXT}<br><span class="V9G">{DESCRIPTION}</span>
</td>
</tr>
<!-- loop showbottomevents_odd off -->
<!-- loop showbottomevents_even on -->
<tr align="left" valign="top">
<td width="170" nowrap bgcolor="#EEEEEE">
- <a class="psf" href="{CAL}&amp;getdate={DAYLINK}">{START_DATE}</a> <font class="V9G">({START_TIME})</font>
+ <a class="psf" href="day.php?cal={CAL}&amp;getdate={DAYLINK}">{START_DATE}</a><br>
+ <span class="V9G">{START_TIME}</span>
</td>
<td bgcolor="#EEEEEE">
- {JS_OPENEVENT}<a class="psf" href="#" onclick="openEventWindow({EVENT_NUMBER}); return false;"><font class="G10B">{EVENT_TEXT}</font></a>
+ {EVENT_TEXT}<br><span class="V9G">{DESCRIPTION}</span>
</td>
</tr>
<!-- loop showbottomevents_even off -->

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