This is the code that I incorporated:
code:<!-- EVENT VIEW --> <% } elsif ($VIEW eq "Event") { use Time::Local; $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BSchedule; $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1); foreach (@$schedules) {if ($_->{event_id} == $EVENT->{details}->{id}) {$EVENT->{schedule} = $_;last;}}$db = $main: BEvents;$fields = &main: BGetFieldsInDisplayOrder($db);} { %> <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0"> <% foreach (@$fields) { next unless ($db->{'properties'}->{$_}->{'display_details'}); %><TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B>Time: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"> <% $start = &Date::formatTime($EVENT->{'schedule'}->{'start_time'}, $Config->get(time_format)); $end = &Date::formatTime($EVENT->{'schedule'}->{'end_time'}, $Config->get(time_format)); if ($EVENT->{'schedule'}->{'all_day'} == "1") { print "All Day"; } else { print $start; if ($start ne $end) { print " - ", $end; } } %> </SPAN></TD></TR> <TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B>Date: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"> <% $start = &SimpleDateFormat::formatDate($EVENT->{'schedule'}->{'start'}, $Config->get(date_format)); $end = &SimpleDateFormat::formatDate($EVENT->{'schedule'}->{'end'}, $Config->get(date_format)); print $start; if ( $start ne $end) { print " - ", $end; } %> </SPAN></TD></TR> <TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD></TR> <% } %> </TABLE>
<!-- EVENT VIEW --> <% } elsif ($VIEW eq "Event") { use Time::Local; $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BSchedule; $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1); foreach (@$schedules) {if ($_->{event_id} == $EVENT->{details}->{id}) {$EVENT->{schedule} = $_;last;}}$db = $main: BEvents;$fields = &main: BGetFieldsInDisplayOrder($db);} { %> <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0"> <% foreach (@$fields) { next unless ($db->{'properties'}->{$_}->{'display_details'}); %><TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B>Time: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"> <% $start = &Date::formatTime($EVENT->{'schedule'}->{'start_time'}, $Config->get(time_format)); $end = &Date::formatTime($EVENT->{'schedule'}->{'end_time'}, $Config->get(time_format)); if ($EVENT->{'schedule'}->{'all_day'} == "1") { print "All Day"; } else { print $start; if ($start ne $end) { print " - ", $end; } } %> </SPAN></TD></TR> <TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B>Date: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"> <% $start = &SimpleDateFormat::formatDate($EVENT->{'schedule'}->{'start'}, $Config->get(date_format)); $end = &SimpleDateFormat::formatDate($EVENT->{'schedule'}->{'end'}, $Config->get(date_format)); print $start; if ( $start ne $end) { print " - ", $end; } %> </SPAN></TD></TR> <TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD></TR> <% } %> </TABLE>
But I get the following error:
quote:ERROR PROCESSING TEMPLATEThere was an error in your template file. Below is the template file and also the perl code generated from it to help you with debugging.syntax error at (eval 1) line 195, near "$main:" syntax error at (eval 1) line 195, near "$main:" syntax error at (eval 1) line 195, near "&main:" syntax error at (eval 1) line 202, near "} elsif" syntax error at (eval 1) line 235, near "; }"
syntax error at (eval 1) line 195, near "$main:" syntax error at (eval 1) line 195, near "$main:" syntax error at (eval 1) line 195, near "&main:" syntax error at (eval 1) line 202, near "} elsif" syntax error at (eval 1) line 235, near "; }"
and this is what I see (highlighted in yellow) on line 195:
code:} elsif ($VIEW eq "Event") { use Time::Local; $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BSchedule; $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1); foreach (@$schedules) {if ($_->{event_id} == $EVENT->{details}->{id}) {$EVENT->{schedule} = $_;last;}}$db = $main: BEvents;$fields = &main: BGetFieldsInDisplayOrder($db);} {
} elsif ($VIEW eq "Event") { use Time::Local; $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main: BSchedule; $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1); foreach (@$schedules) {if ($_->{event_id} == $EVENT->{details}->{id}) {$EVENT->{schedule} = $_;last;}}$db = $main: BEvents;$fields = &main: BGetFieldsInDisplayOrder($db);} {
Any idea what I am doing wrong? I can't even call the calendar now. So I am yanking out this hack. FWIW: I am running a clean install (meaning no mods) to the calendarscript.
thanks
Pete
------------------Petehttp://www.TotalHosting.com
------------------
quote:Note to any one reading this code: a smiley is a : D (colon D) without the space. While I'm on it, if you see two pipes ('|') anywhere on these bulletin boards, remove the space between them while copying and pasting.
Any code you see like--> :-- space --D or |-- space --| you have to remove any space between them.
Dan O.
I have read all the above messages and thought I'd figured out which bits to change and what links to change but no luck to getting an events date on it's main page - simply get errors.
Can anyone who has got an event page to include this to work simply put one message up with instructions.
Greatly appreciated.
P.S. If you need a link to errors then please wait a bit as I am moving servers - maybe by some freak cosmic influence the new server mau help _ NOT !!!
When we click on the event (i.e., Oct 1) from the calendar grid, the event page displays a date of 01/01/1970. AND, in addition to the event being displayed on the grid as a day span item in gray, it is ALSO displayed on EACH day (i.e., it displays as an individual event on Oct. 1 and Oct. 2).
To see my calendar, go to http://apps.nyscul.org/cs/calendar.pl?calendar=nyscul
I visited kayleigh's web site at http://www.mnjaycees.org/cgi-local/calendar31/calendar.pl and noticed she had the same problem. See her "tunnel of terror" event for the last week of October.
Does anyone have a solution? Thanks.
It should read:
When we click on the day SPAN event from the calendar grid, the event page displays a date of 01/01/1970. (i.e., when we click on the gray area span for Oct 1 - 2.)
Could this be a dayspan template problem?
I'd like to modify one small thing. Does anyone know how I can change the format of the date from MM/DD/YYYY (this may be called SimpleDateFormat in his mod) to something like February 3, 2003?
Thanks a million for your help. I'm assuming if I knew any perl, this would be easy.
It looks like you can't access the event view of any event in the last day of any month.
Rather, the Error Processing Template appears, saying, "Day 31 out of range 1...30 at (eval 1) line 64.
If the month has 28 days, like February, the error template says, "Day 29 out of range."
My line 64 is from Tuba Dave's May 3rd post illustrating how to add the date: $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1);
Any help would be greatly appreciated!
code: $schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1);
$schedules = &Event::getEventsInRange($db,timegm(0,0,0,$DATE,$MONTH-1,$YEAR-1900),timegm(0,0,0,$DATE+1,$MONTH-1,$YEAR-1900)-1);
for the second timegm use
timegm(59,59,23,$DATE,$MONTH-1,$YEAR-1900)-1
That means don't use $DATE+1For me this is working.
-----------A Question:
David says "the date of the currently displayed" could be displayed by
Date : <%= $MONTH_NAME %> <%= $DATE %>, <%= $YEAR %>
This only shows the actually date from my computer. Not a date from an event. Is this correct, or should it really be the date of the actually event?
RegardsJohannes
So I went to a clean new copy of default.html and followed the May 03 instructions, and nothing else. I get exactly the same problem. The time does not show, and the date is 01/01/1970. What could this be? I did replace the happy face with a colon D without any spaces, so that is not it. Was there anything else that I should have done outside of the May 03 TubaDave post directions???
Thanks!
It sounds link you're not passing the date in the links tothe event. Did you add the date to the link URLs for theevent as shown in TubaDave's message?
** The time does not show **
I don't know what your problem is there. Sorry.
[This message has been edited by DanO (edited March 25, 2003).]
I've modified the search results url like so:<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>&datestring=<%=$DAY->{datestring}%>" STYLE="text-decoration:underline;" CLASS="text"><FONT COLOR="<%=EVENT FIELD(color)%>"><%= EVENT FIELD(title) %></FONT></A>
Do I also have to change something here:
elsif ($VIEW eq "Search") { $db = $main: BEvents; # Keep form values to populate form fields foreach (keys %in) {$name = $_; if ($name =~ s/^FIELD_//) { $search_params->{$name} = $in{$_}; } } }Thanks in advance.Jon
[This message has been edited by jdillon (edited April 15, 2003).]
The event date is returned in different variables and format from the search function. You'll have to use different code for it in that part of the template.
** and no time. ** I don't see where you've added the time to the link at all!
Try adding something like this to the search results links to see it it helps.
&datestring=<%=$EVENT->{schedule}->{nextoccurrence}->{year}%><% print sprintf("%02d%02d",$EVENT->{schedule}->{nextoccurrence}->{month},$EVENT->{schedule}->{nextoccurrence}->{date}); %>&starttime=<%= $EVENT->{schedule}->{start_time} %>&endtime=<%= $EVENT->{schedule}->{end_time} %>
[This message has been edited by DanO (edited April 15, 2003).]
Jon