When listing a filter in the LIST view, the calendar will show a date for each event in the calendar even if no events are eligible to print. This is a little annoying, so what I did was to duplicate the 'foreach eventlist' loop and set $event_flag if any events showed up. Then, the second time thru the 'foreach eventlist', I print the date header if the $event_flag had been set indicating an event should be printed.
Wes
<%-- LIST STYLE DISPLAY --%>
<CENTER><TABLE BORDER="0" WIDTH="90%"><TR><TD ALIGN="left">
<SPAN CLASS="text">
<DL>
<%$total_events=0;%>
<%FOREACH EVENTLIST%>
<%$event_flag=0;%>
<%IF EVENTS EXIST%>
<%FOREACH EVENT%>
<% if (($in{filter} eq "All") or ($in{filter} eq $EVENT->{'details'}->{'category'}) or ($EVENT->{'details'}->{'category'} eq "" )) { %>
<% next if (($EVENT->{details}->{eventtype} eq "Private") and ($EVENT->{details}->{author_id} ne $User->{username}) ); %>
<% next if (($EVENT->{details}->{eventtype} eq "Employee") and ("anonymous" eq $User->{username}) ); %>
<%$event_flag=1;%>
<% } %>
<%/FOREACH%>
<%/IF%>
<%IF EVENTS EXIST%>
<%$total_events++;%>
<% if ($event_flag eq "1") {%><DT><B><A HREF="<%=$CGI_URL_QUERYSTRING%>selected_datestring=<%=$DAY->{'datestring'}%>&datestring=<%=$DAY->{'datestring'}%>&view=Day" CLASS="text"><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%></A></B><DD><%}%>
<%FOREACH EVENT%>
<% if (($in{filter} eq "All") or ($in{filter} eq $EVENT->{'details'}->{'category'}) or ($EVENT->{'details'}->{'category'} eq "" )) { %>
<% next if (($EVENT->{details}->{eventtype} eq "Private") and ($EVENT->{details}->{author_id} ne $User->{username}) ); %>
<% next if (($EVENT->{details}->{eventtype} eq "Employee") and ("anonymous" eq $User->{username}) ); %>
<% if ($_SHOW_GRID_EVENT_BULLET) {%><%}%>
<% if ($_SHOW_EVENT_TIMES eq "ALL" | | $_SHOW_EVENT_TIMES eq "START") { %>
<% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %>
<% } %>
<% if ($_SHOW_EVENT_TIMES eq "ALL") { %>
<% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %>
<% } %>
<% if (($_SHOW_EVENT_TIMES eq "ALL" | | $_SHOW_EVENT_TIMES eq "START") && ($EVENT->{'schedule'}->{'start_time'})) { %> : <% } %>
<A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>&datestring=<%=$DAY->{datestring}%>" STYLE="text-decoration:underline;" CLASS="text"><%= EVENT FIELD(machine) %> <%= EVENT FIELD(title) %></A><BR>
<% } %>
<%/FOREACH%>
<%/IF%>
<%/FOREACH%>
</DL>
<%unless($total_events){%>
<I><%= $_NO_EVENTS_LABEL %></I>
<% } %>
</SPAN>
</TD></TR></TABLE></CENTER>
<% } %>
<%-- END LIST STYLE DISPLAY --%>
[This message has been edited by kd4rdb (edited April 24, 2003).]