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


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)Showing only certain events - SSI
Pages: [1]   Go Down
Print
Author Topic: Showing only certain events - SSI  (Read 290 times)
0 Members and 1 Guest are viewing this topic.
TacoSteve
Guest
« on: August 14, 2003, 07:55:00 AM »

I figured out how to NOT show specific events by doing something like this:

<%FOREACH EVENT%>
<% next if ($EVENT->{details}->{title} =~ /text here/); %>

So that would not show events in my SSI with anything that would have the "text here" part. But I'm looking to do the exact opposite. I want to be able to show ONLY events that have "text here". I know the answer must be staring me in the face, but I just don't know enough yet to figure it out. Help would be appreciated.

Here is a stripped down version of the SSI I'm using:

<%
&getEvents( {'startdate'=>'19990101', 'enddate'=>'20050101'} );
$DAY = $Grid->{'grid'}->

  • ->
  • ;
    $EVENTS = $DAY->{events};
    $total_events=0;
    %>

    <center><DL>
    <%EVENTLOOP:%>
    <%FOREACH EVENTLIST%>
       <%IF EVENTS EXIST%>
       
          <%FOREACH EVENT%><% next if ($EVENT->{details}->{title} =~ /pr.gif/); %>
                      <DT><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%><br>
                       <%$total_events++;%><%if (total_events == 5) { last EVENTLOOP; } %>
             <% 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'})) { %> : <% } %>
             <%= $EVENT->{'details'}->{'title'} %><br><%= EVENT FIELD(description) %></font><br><br>
          <%/FOREACH%>
       <%/IF%>
    <%/FOREACH%>
    </DL></center>
    <%unless($total_events){%>
    <CENTER><I><%= $_NO_EVENTS_LABEL %></I></CENTER>
    <% } %>

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #1 on: August 15, 2003, 01:06:00 PM »

** <% next if ($EVENT->{details}->{title} =~ /text here/); %> **

** So that would not show events in my SSI with anything that would have the "text here" part. But I'm looking to do the exact opposite. **

You can try

<% next unless ($EVENT->{details}->{title} =~ /text here/); %>

or

<% next if ($EVENT->{details}->{title} !~ /text here/); %>

(note the !~ in place of =~)

Both should do the same thing.

Dan O.


[This message has been edited by DanO (edited August 15, 2003).]

Logged
TacoSteve
Guest
« Reply #2 on: August 19, 2003, 07:13:00 AM »

Of course you're a genius. But I am your idiot  
Logged
Pages: [1]   Go Up
Print
Jump to: