Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8026 Posts in 1851 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Showing only one event  (Read 274 times)
0 Members and 1 Guest are viewing this topic.
kstrange
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: September 29, 2002, 12:23:00 PM »


That script works great for calendar view.
www.calendarscript.com/support/forum/Forum4/HTML/000382.html

 But, when you filter list view you still get the dates,
even for filtered events, in other words the dates show up
for "all" categories. Even though the unselected events
are not visible.

                                     Whew.

Logged
kstrange
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #1 on: September 29, 2002, 12:54:00 PM »

Got It.

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

Please don't PM me. Post in the open forum.


WWW
« Reply #2 on: September 29, 2002, 01:02:00 PM »

** when you filter list view you still get the dates,
even for filtered events, in other words the dates show up
for "all" categories. **

You'd likely have to modify the code for the list output to change that effect.

BTW: You should probably post messages pertaining to the same subject as replies to the original message so other can follow the whole discussion.

JMO.

Dan O.

------------------

Logged
kd4rdb
New Member
*

Karma: 0
Offline Offline

Posts: 0

engineer


WWW
« Reply #3 on: April 23, 2003, 09:54:00 AM »

This solves that problem... what I did was to duplicate the 'foreach eventlist' loop and set a flag if any events showed up.  Then, the second time thru the 'foreach eventlist', I print the date header if the flag had been set indicating an event should be printed.

Wes

<pre>
<%-- 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 --%>

</pre>

Logged
Pages: [1]   Go Up
Print
Jump to: