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
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)A simplified one-month view?
Pages: [1]   Go Down
Print
Author Topic: A simplified one-month view?  (Read 424 times)
0 Members and 1 Guest are viewing this topic.
memobug
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: January 09, 2002, 03:30:00 PM »

Greetings,

Well, my SSI events listing is working with a 30-day window, but I would prefer to have a list in which each event link appears just once to save space.  When an event runs for a week or more, it really clutters up with the same event recurring day after day.

P.S. I put my event titles in quotes just to make it clearer, they don't really look that way.


HOW ABOUT THIS:

• "Belgium Show" (Sat, Jan 12 - Sun, Jan 13)
• "Hayward, CA BIB Show" (Sat, Jan 12 - Sun, Jan 13)
• "Oakland, CA BABA Show" (Sat, Jan 19)
• "Los Angeles, CA  Shohin Show' (Sat, Jan 19 - Sun, Jan 20)
• "Fremont, CA Maple Class" (Sun, Jan 20)
• "Santa Nella, CA  Shohin Conv." (Fri, Feb 1 - Sun, Feb 3)


INSTEAD OF THIS:

Saturday, January 12
• "Belgium - Show"
• "Hayward, CA BIB Show'

Sunday, January 13
• "Belgium  Show"
• "Hayward, CA  BIB Show"

Saturday, January 19
• "Oakland, CA  BABA Show"
• "Los Angeles, CA  Shohin Show"

Sunday, January 20
• "Los Angeles, CA  Shohin Show"
• "Fremont, CA  Maple Class"

Friday, February 1
• "Santa Nella, CA  Shohin Conv."

Saturday, February 2
• "Santa Nella, CA  Shohin Conv."

Sunday, February 3
• "Santa Nella, CA  Shohin Conv."

Regards,

Matt

Logged

Regards,

Matt

Kent
New Member
*

Karma: 0
Offline Offline

Posts: 0

IT


WWW
« Reply #1 on: January 09, 2002, 05:27:00 PM »

Here's a quickie hack...its not perfect but it should get you started.  

It does account for multiple dates and will not repeat the event later on in upcoming days.  However, if you have an event that takes place once a week (like on 12/1, 12/8, 12/15) it will convert it to "Dec 1-15" which is obviously wrong.  But, if you don't mind a style more similar to "Dec 1,8,15" then this'll work fine with some very minor editing.

Note: This is a not meant to be a final template, although it does print out events and dates...it is just to give you the tools and functionality to plug it into your template.

---------------------
<% &getEvents( { 'range'=>'month' } ); %>
<!-- BEGIN DATE GATHERING -->
<%FOREACH GRID COLUMN%>
<%/FOREACH%>
<%FOREACH GRID ROW%>
<%FOREACH GRID COLUMN%>
<%IF DISPLAY%>
<%FOREACH EVENT%>
<%$titlearray=$EVENT->{'details'}->{'title'};%>
<%push(@$titlearray,$DAY->{'dd'});%>
<%/FOREACH%>
<%/IF%>
<%/FOREACH%>
<%/FOREACH%>
<!-- END DATE GATHERING -->
<%FOREACH EVENTLIST%>
   <%IF EVENTS EXIST%>
   <%$total_events++;%>
      <%FOREACH EVENT%>
         <%$flag=0;%>
         <%$titlearray=$EVENT->{'details'}->{'title'};%>
         <%foreach$dupetest(@titleevent) {%>
            <%if($EVENT->{'details'}->{'title'} eq $dupetest) {
               $flag=1;
            }%>
         <%}%>
      <%if($flag eq 0) {%>
         <%= $EVENT->{'details'}->{'title'} %>
         <%$firstdate = shift(@$titlearray);%>
         <%$lastdate = pop(@$titlearray);%>
         <%= $firstdate%>-<%= $lastdate%><br>
         <%push(@titleevent,$EVENT->{'details'}->{'title'});%>
      <%}%>
      <%/FOREACH%>
   <%/IF%>
<%/FOREACH%>
<%unless($total_events){%>
<CENTER><I>No Events</I></CENTER>
<% } %>

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

[This message has been edited by Kent (edited January 09, 2002).]

Logged
memobug
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: January 11, 2002, 05:03:00 AM »

Thanks Kent!

I had to put a bunch of trace lines in to understand what you were doing, and I think I have it about 90%, and learned a lot in the process.

I think there is a little bug here in the $total_events accumulator because it was running up too high.  I moved it down to where the event is actually printed, that seemed to fix it for me.

I have a lot of new things going and will fill you in on where I am.  I would like to clean up the template output and the code itself, and then I hope to add more here with a sample.

------------------
Regards,

Matt

Logged

Regards,

Matt

cosmocanuck
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: August 25, 2004, 12:55:00 PM »

Hello Matt!

I've been trying to solve the very same problem as you, getting multi-day events to just show the range and not every single day separately. Someone helpfully provided me with their hack for this, but it has turned out to be flawed. Now I've discovered your version and it seems to be far superior - I'd like to put it to use.

I'm wondering if you could send me the version you referred to in your last posting, with the bug fix?

Thanks!
Cosmo
adamabrams@shaw.ca


-----------------
Thanks Kent!

I had to put a bunch of trace lines in to understand what you were doing, and I think I have it about 90%, and learned a lot in the process.

I think there is a little bug here in the $total_events accumulator because it was running up too high.  I moved it down to where the event is actually printed, that seemed to fix it for me.

I have a lot of new things going and will fill you in on where I am.  I would like to clean up the template output and the code itself, and then I hope to add more here with a sample.

---
Regards,

Matt

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

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