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
Pages: [1]   Go Down
Print
Author Topic: SSI call customization  (Read 325 times)
0 Members and 1 Guest are viewing this topic.
dynamike
New Member
*

Karma: 0
Offline Offline

Posts: 0

photographer web developer


WWW
« on: April 05, 2006, 09:58:00 AM »

O.k., so now I have my calendar set up the way I want it.  This calendar is heavily customized (well for me at least, it took two days of work), and I've got a few more things do to.  I want to customize the SSI call or at least what is shown.  I am currently using a modified version of max_events.html.  Here's the code:

<%
&getEvents( {'duration'=>$in{duration}} );
$DAY = $Grid->{'grid'}->

  • ->
  • ;
    $EVENTS = $DAY->{events};
    $total_events=0;
    $total_trueevents=0;
    $max_events=10;
       $time = time;
       ($neg_pos,$hours) = ($vars{time_offset} =~ /([+-])(\d+)/);
       if ($neg_pos eq '+') {
          $time += (60*60 * $hours);
       }
       else {
       $time -= (60*60 * $hours);
       }
       ($mday,$month,$year) = (localtime($time))[3,4,5];
       $month = $month+1;
       $year = $year+1900;
       $datestamp = sprintf("%4.4d%2.2d%2.2d",$year,$month,$mday);
    %>
    <p><%FOREACH EVENTLIST%>
       <%IF EVENTS EXIST%>
       <%$total_events++;%>
       <%if($DAY->{dd} >= $mday) { %>
       <%FOREACH EVENT%>
             •
             <% $total_trueevents++;%>
                   <% if ($EVENT->{'details'}{'state'})  { %><%= $EVENT->{'details'}->{'city'} %>, <%= $EVENT->{'details'}->{'state'} %> -  <A class="cal" HREF="/cgi-bin/calendar/calender.pl?popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" STYLE="text-decoration:underline;" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;"><% } %> <%= $EVENT->{'details'}->{'title'} %><% { %></A><% } %>
                   <% if($total_trueevents >= $max_events) { %>
          </dl><%
                exit();
             }%>
          <BR><%/FOREACH%>
       <%/IF%>
       <%}%>
    <%/FOREACH%></p>

    I have it set up where it will only show events with a state listed.  Since I require that, it will show all events except holidays.  It also doesn't show the dates, just the next 10 events.  They can see the date in the event view.

    What I would like to do is to have it show unique events.  See how it shows the top two events twice?  How would I modify the code above so that it doesn't repeat events?

    Mike

    BTW, I did remove the 'Powered by' tag at the end of all of the pages, but I also paid the full license fee and donated to DanO's page.

Logged
dynamike
New Member
*

Karma: 0
Offline Offline

Posts: 0

photographer web developer


WWW
« Reply #1 on: April 05, 2006, 10:00:00 AM »

Oh, I forgot to add that you can see the call in action at http://www.americanmotorcycleclub.com/test.shtml.

------------------
[Repaired link]

[This message has been edited by DanO (edited April 05, 2006).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #2 on: April 05, 2006, 01:32:00 PM »

** What I would like to do is to have it show unique events. How would I modify the code above so that it doesn't repeat events? **

I can't tell you the exact code but it might be possible to set up some kind of list (maybe a hash?) of the event IDs that have been printed and use that list to negate printing of the same event twice?

Dan O.

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

Logged
dynamike
New Member
*

Karma: 0
Offline Offline

Posts: 0

photographer web developer


WWW
« Reply #3 on: April 05, 2006, 02:49:00 PM »

Anybody up for the challenge?

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #4 on: April 05, 2006, 06:13:00 PM »

I don't know how much it's worth to you but if you want to hire my services, you can contact me via email. Otherwise maybe someone else will volunteer their services?

Dan O.

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

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