Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8021 Posts in 1850 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationCustomizing CalendarScript (Moderators: scott, DanO, Marty)code generates tons of blank space
Pages: [1]   Go Down
Print
Author Topic: code generates tons of blank space  (Read 215 times)
0 Members and 1 Guest are viewing this topic.
beneath_the_ashes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: July 03, 2005, 06:34:00 PM »

can anyone see why this code would generate a TON of blank lines?  i cant figure it out.  also can anyone see why the commented out line #84 always generates 4:00 PM?  this is VERY much appreciated!!

code:

<%
($second, $minute, $hour, $date, $month, $year) = localtime($EVENT->{details}->{time_added} +
$main::localtime_offset);
$month++;
$year += 1900;
%>
<%
$STYLE = "List";
$defaultmax=999; # the default number of events shown

$defaultperiod='365d'; # the default period to sample
$period=int(lc($in{duration})).'d';
if (int($period)==0) {$period=$defaultperiod}; # if no maximum assume default
# $searchcity=lc($in{city});
# if (length($searchcity) < 4) {$searchcity=""}; #need at least 4 chars for valid city
# $searchstate=lc($in{state});
# if (length($searchstate) < 2) {$searchstate=""}; #need at least 2 chars for valid state
$maxevents=$in{maxevents};
if ($maxevents==0) {$maxevents=$defaultmax}; # if no maximum assume default
$searchcountry=lc($in{country});
# if (length($searchstate) > 999) {$searchcountry=''};

#print 'THIS TEST IS HARD WIRED TO SEARCH THE DATABASE FOR &country=on the command line';
#print 'CITY: '.$searchcity.' '.'STATE:'. $searchstate.' '.'COUNTRY '.$searchcountry;

#&getEvents( {'duration'=>$in{duration}} ); #original

&getEvents({duration=>$period});

$DAY = $Grid->{'grid'}->

  • ->
  • ;
    $EVENTS = $DAY->{events};
    $total_events=0; %>

    <!-- BEGIN DATE GATHERING -->
    <% FOREACH EVENTLIST%>
        <% FOREACH EVENT%>
          <% $titlearray=$EVENT->{'details'}->{'title'};
             $montharray='month'.$EVENT->{'details'}->{'title'};
    #          print 'COUNTRY READS: '.$EVENT->{'details'}->{'country'}.'<BR>';
             $thismonth=$DAY->{'monthabbreviation'};
             push(@$montharray,$thismonth);
             push(@$titlearray,$DAY->{'dd'});   %>
        <%/FOREACH%>
    <%/FOREACH%>
    <!-- END DATE GATHERING -->
    <div id="showsContainer">

    <%FOREACH EVENTLIST%>
         <%IF EVENTS EXIST%>
           <% if ($total_events < $maxevents) { %>
              <%FOREACH EVENT%>
                 <%$flag=0;%>
                 <%$titlearray=$EVENT->{'details'}->{'title'};%>
                 <%$montharray='month'.$EVENT->{'details'}->{'title'};%>
                 <%foreach $dupetest(@titleevent) {%>
                    <%if ($EVENT->{'details'}->{'title'} eq $dupetest) {
                         $flag=1;
                    }%>
                 <%};%>


               <% $eventcountry=lc($EVENT->{'details'}->{'country'}); %>
                 <%if ($searchcountry eq "$eventcountry") {%>

                    <% $eventstate=lc($EVENT->{'details'}->{'state'}); %>
                      <%if ( ($searchstate eq "") or ($searchstate =~ m/$eventstate/ ) ) {%>


                           <%if ($flag eq 0) {%>
                           
                               <%$total_events++;%>
                               <% $firstdate = shift(@$titlearray);
                               $lastdate = pop(@$titlearray);
                               $firstmonth = shift(@$montharray);
                               $lastmonth = pop(@$montharray);  
                               $firstdow=$DAY->{dayabbreviation};
                               %>

    <div class="date"><%=$firstmonth%>, <%=$firstdate%><% if ($lastdate) { %>~<%if
    ($firstmonth ne $lastmonth) {%><%=$lastmonth;%><%};%><%=$lastdate;%><%};%></div>

    <!--                            <div class="time"> @ <%=(($hour > 12)?$hour-12:$hour)%>:<% print sprintf("%02d",$minute); %> <%=(($hour > 11)?"PM":"AM")%> -  </div> -->

                               <div class="location"><%= EVENT FIELD(location) %></div>
                               <div class="info"> <%= EVENT FIELD(description) %></div><br />
                               
                               <%push(@titleevent,$EVENT->{'details'}->{'title'});%>
                          <%}%>
                     <%}%>
                 <%}%>
             <%/FOREACH%>
           <%} %>
        <%/IF%>
    <%/FOREACH%>
    </div>

    <%if ($total_events) {%>
        <p align="left" style="padding-left:10px; margin-top: 20px; margin-bottom: 0">Total Shows: <%=$total_events%><BR>
     
    <%} else {%><I>No Shows Scheduled</I><%}%>
    <p></p>

    <a target="_blank"
    href="<%=$AdminConfig->get("calendar_url")%>?calendar=<%=$Calendar%>"><div class="location"><u>go to the Man Alive Calendar</u></div></a>


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