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)Skip certain events on calendar template
Pages: [1]   Go Down
Print
Author Topic: Skip certain events on calendar template  (Read 322 times)
0 Members and 1 Guest are viewing this topic.
Fasta Playa
Guest
« on: October 18, 2004, 11:02:00 AM »

I am trying to display a printable calendar for our School Calendar.  We have decided to exclude all athletic events except for Varsity Football and Varsity Basketball.  I have a few drop-downs set up.  So I would like the event to not be displayed if the event has the "category" of "Athletics", and if the "level" is not "Varsity" and the "sport" does not equal "Football" or "Basketball".  My current code looks like this:

<%FOREACH EVENT%>
<% next if (((($EVENT->{details}->{category} eq "Athletics") && ($EVENT->{details}->{level} ne "Varsity")) && (($EVENT->{details}->{category} eq "Athletics") && ($EVENT->{details}->{sport} ne "Football"))) | | ((($EVENT->{details}->{category} eq "Athletics") && ($EVENT->{details}->{level} ne "Varsity")) && (($EVENT->{details}->{category} eq "Athletics") && ($EVENT->{details}->{sport} ne "Basketball")))); %>

But it doesn't work.  You can see the results here: http://lion.spx.org/calendar/calendar.pl?calendar=default&template=school_calendar_print9.html

Any help would be much appreciated.

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: October 18, 2004, 12:47:00 PM »

** We have decided to exclude all athletic events except for Varsity Football and Varsity Basketball. **

I've simplified and changed your conditional expression somewhat, see if it will work now:

<% next unless ( $EVENT->{details}->{category} eq "Athletics" && $EVENT->{details}->{level} eq "Varsity" && ($EVENT->{details}->{sport} eq "Football" | | $EVENT->{details}->{sport} eq "Basketball") ); %>

        NOTE: There should NOT be a space between the | | in the above code. This forum software adds it.

Also, make sure the references "category", "level", "sport", "Athletics", "Varsity", "Football" and "Basketball" are all spelled exactly the same (case too) as the values defined in the script.

Dan O.

[This message has been edited by DanO (edited October 18, 2004).]

Logged
Fasta Playa
Guest
« Reply #2 on: October 18, 2004, 01:30:00 PM »

DanO, thanks for the response.  The code you provided takes out all events that are not Varsity Baskteball or Varsity Football.  This is a step, but I need all non-athletic events to show.  I only want events that are in the "Athletic" category and are not Varsity Basketball or Varsity Football to be skipped.  I hope I am making sense.
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #3 on: October 18, 2004, 06:30:00 PM »

** I hope I am making sense **

Very confusing.

** The code you provided takes out all events that are not Varsity Baskteball or Varsity Football. This is a step, but I need all non-athletic events to show [*as well*] **

Maybe try:

<% next unless ( $EVENT->{details}->{category} ne "Athletics" | | ($EVENT->{details}->{category} eq "Athletics" && $EVENT->{details}->{level} eq "Varsity" && ($EVENT->{details}->{sport} eq "Football" | | $EVENT->{details}->{sport} eq "Basketball")) ); %>

Dan O.

PS. Don't forget about the | |

[This message has been edited by DanO (edited October 18, 2004).]

Logged
Fasta Playa
Guest
« Reply #4 on: October 19, 2004, 09:02:00 AM »

Works Great!  Thanks DanO!
Logged
Pages: [1]   Go Up
Print
Jump to: