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 CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)SSI Max Events (Too many events = no display date?)
Pages: [1]   Go Down
Print
Author Topic: SSI Max Events (Too many events = no display date?)  (Read 323 times)
0 Members and 1 Guest are viewing this topic.
Sean
Guest
« on: September 03, 2003, 07:33:00 PM »

Since a picture is worth a thousand words:  http://www.thecity.org/onthehorizon.shtml

As you can see, the first problem is the whole "Content-type: text/html" header thing. My server admin is working on that issue. Any suggestions would be nice, though.

The issue I'm trying to deal with is the displaying of the final events in the list, and their date. It seems that there are too many events on that particular day and so the SSI doesn't pull the date into the html. Would this assumption be correct?

Help/suggestions?

P.S. By the way, CalendarScript is meeting my needs perfectly, and I'm really impressed with the functionality. Here's my original (manually done) list of events:  http://www.thecity.org/onthehorizon.htm . Compare the two and you can see the power of CS customization!  

Logged
Sean
Guest
« Reply #1 on: September 04, 2003, 01:59:00 PM »

I've updated my SSI template with some modifications... but I'm not a perl programmer, so I'm sure it's in desperate need of some cleanup (which could be one of the reasons I'm having the date problem).

I wonder if someone would be willing to take a look, and make any needed changed for me?

===
<!--#include file="styles_scripts.html"-->
<%
&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);
    %>
    <!-- ======== -->
    <!-- DISPLAY -->
    <!-- ======= -->
    <DL>
    <%FOREACH EVENTLIST%>
       <%IF EVENTS EXIST%>
       <%$total_events++;%>
       <%FOREACH EVENT%>
       <% next if ($EVENT->{details}->{homepage} =~ /No/); %>
       <%$flag=0;%>
       <%$titlearray=$EVENT->{'details'}->{'title'};%>
       <%foreach $dupetest(@titleevent) {%>
       <%if ($EVENT->{'details'}->{'title'} eq $dupetest) {$flag=1;}%>
       <%};%>
    <!-- No time
    <SPAN CLASS="time">
    <% $total_trueevents++;%>
    <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= $EVENT->{'schedule'}->{'start_time'} %><% } %>
    <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= $EVENT->{'schedule'}->{'end_time'} %><% } %>
    <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %>
    </SPAN><BR>
    /No time -->
    <%if ($flag eq 0) {%>
       <SPAN CLASS="event">
       <A HREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;"><%= $EVENT->{'details'}->{'title'} %></A><BR>
       <% if($total_trueevents >= $max_events) {
          exit();
          }%>
       </SPAN>
    <SPAN CLASS="date">
    <%if($DAY->{dd} >= $mday) { %>
    <%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%>
    </SPAN><br><img src="img/dotted_line.gif" width="160" height="3" vspace="5"><br>
    <%push(@titleevent,$EVENT->{'details'}->{'title'});%>
       <%/FOREACH%>
       <%/IF%>
       <%}%>
    <%};%>
    <%/FOREACH%>
    </DL>
    <%unless($total_events){%>
    <CENTER><I>No Events</I></CENTER>
    <% } %>
    <A HREF="<%=$AdminConfig->get("calendar_url")%>?calendar=<%=$Calendar%>">View Calendar</A>
    ===
Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

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


WWW
« Reply #2 on: September 04, 2003, 08:07:00 PM »

** "Content-type: text/html" header thing. My server admin is working on that issue. **

As they should. If you'e on a Windows server, that can happen if Perl scripts are linked to the perl.dll and not perl.exe but the server administrator should know which is being used for your script.

** It seems that there are too many events on that particular day and so the SSI doesn't pull the date into the html. Would this assumption be correct? **

More acurately, the script just isn't getting to the part of the template where the date is printed after the printing the last event title.

You can try moving the following lines of code lower maybe to just before one of the proceeding <%/FOREACH%>
statements.

<% if($total_trueevents >= $max_events) {
exit();
}%>


Dan O.


[This message has been edited by DanO (edited September 04, 2003).]

Logged
Sean
Guest
« Reply #3 on: September 04, 2003, 08:59:00 PM »

That worked perfectly, thanks, Dan. You da' man!

S.

Logged
Wiz
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: September 04, 2003, 10:05:00 PM »

Hi, I'm the Admin Sean is talking about.
At first I was running Perl 5.22 and it was suggested that wasn't new enough so I upgraded to the newest available from Activeperl.

I have had the server pointing to the perl.exe file all along, but just to see what happens I changed the server to look at perl.dll and everything got even worse for Sean.
I quickly changed it back.

I do have other scripts running without these kinds of issues, and even though it was suggested that my server might be returning some default header that is getting misinterpreted I can not find any such thing going on.

So far none of the suggested fixes have worked, what do I check next?
I really want to get this working for Sean.

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

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


WWW
« Reply #5 on: September 05, 2003, 12:49:00 PM »

** So far none of the suggested fixes have worked, what do I check next? **

Sorry, I don't do Windows. What I suggested as a possible cause is what turned out to be causing the Content-type header being printed in another Perl script I help out with in its support forums.

        If I'm not mistaken, SSI is also usually a function of Perl. What Perl installation is SSI using on the server? If perl.dll, that might be the cause?


        What SSI tag is being used to call CalendarScript? Maybe it is not fully supported on your server?

The only other thing I can suggest it to conditionally print out the Content-type header depending if the calendar.pl file is being called via SSI or not. That would require editing of the calendar.pl file.

Dan O.

[This message has been edited by DanO (edited September 05, 2003).]

Logged
Wiz
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: September 07, 2003, 03:07:00 PM »

I thought I would look around in the script for "Content-type: text/html" which is printing at the top of Sean's output.
I'm no perl programmer of course, but this seems to be setting a condition where that ("Content-type: text/html") would be printed, anyway this is still an issue if anyone would like to offer any more suggestions it would be greatly appreciated.

I found this in calendar.pl:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   # Make session available in template files
   $Template::Session = $Session;
   }
unless ($no_header) {
   print "Content-type: text/html\n\n";
   }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and again in calendar_admin.pl:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Start output
# ------------
$Session = new CGISession($BASE_DIR . "session/");
unless ($no_session) {
   my ($id) = ($ENV{'HTTP_COOKIE'} =~ /CGISessionID\s*=\s*([^;]*)/);
   $Session->getSession($id);
   if (($Session->isValid()) && ($in{'command'} ne "logout")) {
      print "Set-cookie: CGISessionID=",$Session->getValue("_id"),";path=/\n";
      }
      else { print "Set-cookie: CGISessionID=;path=/;expires=Thu, 01-Jan-1970 00:00:00 GMT\n"; }
   }
unless ($no_header) {
   print "Content-type: text/html\n\n";
   }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Logged
Wiz
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #7 on: September 09, 2003, 02:42:00 AM »

Well it's working now.
I simply snipped out a little code and tested - now everything seems to be working fine.
Here is what I did.

I took this (calendar.pl file):

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Make session available in template files
$Template::Session = $Session;
}
unless ($no_header) {
print "Content-type: text/html\n\n";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

and did this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Make session available in template files
$Template::Session = $Session;
}
unless ($no_header) {
print "";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

[This message has been edited by Wiz (edited September 09, 2003).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 221

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


WWW
« Reply #8 on: September 09, 2003, 05:26:00 PM »

** Well it's working now. **

Glad to hear it.

Dan O.

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

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