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)Who to prevent the script showing Holidays in the ssi-call?
Pages: [1]   Go Down
Print
Author Topic: Who to prevent the script showing Holidays in the ssi-call?  (Read 585 times)
0 Members and 1 Guest are viewing this topic.
Triple M
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: May 02, 2002, 04:23:00 PM »

Hi there,

I've got an other question: Is there an easy way to prevent the script when calling the upcoming-events-list as an ssi to show the holidays? I already cerated a selectbox "Holiday?" with a yes/no option. Unfortunately I do not have any clue how to put that into my ssi.html!

Can anyone help me?

Thanks a lot, Triple M

Logged
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #1 on: May 02, 2002, 04:36:00 PM »

Open your ssi.html file, and find the tag <%FOREACH EVENT%>.  It's the part that's indented the farthest in.  Right after that put this line of code:

<% next if ($EVENT->{details}->{holiday} eq "yes"); %>

That should do it.

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

Triple M
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: May 02, 2002, 11:35:00 PM »

Hi Dave,

I almost knew that you'd come up with the right answer! Great! Thanks!
There's only one little thing: If there are no other events on a particular date (except the holiday), the date is shown in my upcoming events list without any entries. Can I prevent the script from doing that also?

Thanks so far!

Triple M

Logged
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #3 on: May 03, 2002, 02:00:00 AM »

Here's the modified version of the ssi.html that will get you set up correctly.

code:

<%
&getEvents( {'duration'=>$in{duration}} );
$DAY = $Grid->{'grid'}->
  • ->
  • ;
    $EVENTS = $DAY->{events};
    $total_events=0;
    %>
    <DL>
    <%FOREACH EVENTLIST%>
       <%IF EVENTS EXIST%>
       <%$curr_events = 0;%>
       <%FOREACH EVENT%>
       <%$curr_events++ if ($EVENT->{details}->{holiday} ne "yes"); %>
       <%/FOREACH%>
       <%next unless ($curr_events);%>
       <%$total_events++;%>
       <DT><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%>
       <DD>
          <%FOREACH EVENT%>
             <% next if ($EVENT->{details}->{holiday} eq "yes"); %>
             •
             <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= $EVENT->{'schedule'}->{'start_time'} %><% } %>
             <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= $EVENT->{'schedule'}->{'end_time'} %><% } %>
             <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %>
             <%= $EVENT->{'details'}->{'title'} %><BR>
          <%/FOREACH%>
       <%/IF%>
    <%/FOREACH%>
    </DL>
    <%unless($total_events){%>
    <CENTER><I>No Events</I></CENTER>
    <% } %>
    <A HREF="<%=$AdminConfig->get("calendar_url")%>?calendar=<%=$calendar_key%>">View Calendar</A>

That code "simulates" the next day by incrementing $curr_events if there is an event that's not a holiday.  Then you check and see if there are any $curr_events, skipping the rest of the display for the current date if there's not.  Give that a try and see what happens.

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

Triple M
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: May 03, 2002, 12:00:00 PM »

Hey Dave,

you're bombastic! Just did it and it works just outstanding!
Thanks so much!!!!

Best Regards, Tom

Logged
Fasta Playa
Guest
« Reply #5 on: August 27, 2002, 01:20:00 PM »

How about if you just wanted to show the holidays?
Logged
Fasta Playa
Guest
« Reply #6 on: August 27, 2002, 01:27:00 PM »

Nevermind.  Duh, I got it.  Just sub "eq" for "ne" in the code.
Logged
L-P
Guest
« Reply #7 on: September 17, 2002, 10:19:00 AM »

Tripple M, this does exactly what I want to do as well, however I was wondering if you could share you code to add the select box?

Thanks,

L.P.

Logged
L-P
Guest
« Reply #8 on: September 17, 2002, 10:26:00 AM »

Or then again:

Is ther a way to achieve the same thing by having the ssi.html file look for certain words or tags in the event's title?

For instance, if I put the word "practice" somewhere in the title, I'd like it to be filtered out of the ssi.

Thanks,

L.P.

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #9 on: August 08, 2003, 12:44:00 PM »

** Is ther a way to achieve the same thing by looking for certain words or tags in the event's title? For instance, if I put the word "practice" somewhere in the title **

Yes,

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

Dan O.

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

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