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)template glitches i cant work out
Pages: [1]   Go Down
Print
Author Topic: template glitches i cant work out  (Read 236 times)
0 Members and 1 Guest are viewing this topic.
beneath_the_ashes
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: October 06, 2004, 06:01:00 PM »

i have set up a template that SHOULD only display events with a given value for a field created called 'country'.  there are 2 problems i have with this i cant figure out...

1)  if i am not logged in, the template shows every event with the given field, but ALSO every event with nothing in that field.

2) if i am logged in...it almost works correctly by showing all the events with the given field, but it ALSO shows any other events that are on the same day as an event with the correct value for the field.  even if the other event that day has a blank value for the country field.....

i have been working on this issue for what feels like an eternetity, so now im turning to the masses.....the code for the template is below... and the link to my tempalte is:   http://www.darkvisionsmedia.com/cgi-bin/calendar/calendar.pl?template=BTAshows.htm&country=666 ...this link should only be showing events with 666 as the value for the field 'country'.....

thank you much
-brewster

code:

<STYLE>
BODY {scrollbar-face-color: "774F27"}
BODY {scrollbar-3dLight-Color: "black"}
BODY {scrollbar-Arrow-Color: "FFB85B"}
BODY {scrollbar-Base-Color: "774F27"}
BODY {scrollbar-DarkShadow-Color: "black"}
BODY {scrollbar-Highlight-Color: "black"}
BODY {scrollbar-Shadow-Color: "black"}
BODY {scrollbar-Track-Color: "black"}
</STYLE>
<body link="#FFB85B" text="#FFB85B" bgcolor="#000000" bgproperties="fixed"
background="http://bta.darkvisionsmedia.com./BTAv2/Site/Images/BG_16_2.jpg" vlink="#FFB85B"
alink="#FFB85B" topmargin="0" leftmargin="0">

<FONT SIZE= 1 face = "Arial, Helvetica">
<%
($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 -->
    </FONT>

    <FONT SIZE= 1 face = "Verdana">
    <div align="center">
     <center>

    <TABLE border=0 cellspacing="0" cellpadding="5" style="border-collapse: collapse" height="47" >
    <TR align="center" >
     <TD style="border-style:solid; border-width:1; " bordercolor="#FFB85B" height="13"
    bgcolor="#774F27" width="50">
     <p style="margin-top: 0; margin-bottom: 0"><font size="1"><b>DATE</b></TD>
     <TD style="border-style:solid; border-width:1; " bordercolor="#FFB85B" height="13"
    bgcolor="#774F27">
     <p style="margin-top: 0; margin-bottom: 0"><b><font size="1">SHOW/TOUR<br>
     </font><span style="font-size: 6pt">(click for more info)</span></b></TD>
     <TD style="border-style:solid; border-width:1; " bordercolor="#FFB85B" height="13"
    bgcolor="#774F27">
     <font size="1"><b>LOCATION</b></font></TD>
     <TD style="border-style:solid; border-width:1; " bordercolor="#FFB85B" height="13"
    bgcolor="#774F27" width="50%">
     <font size="1"><b>DETAILS</b></font></TD></TR>

    <%FOREACH EVENTLIST%><font size="1">
         <%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 "") or ($searchcountry =~ m/$eventcountry/ ) ) {%>
                    <% $eventstate=lc($EVENT->{'details'}->{'state'}); %>
                      <%if ( ($searchstate eq "") or ($searchstate =~ m/$eventstate/ ) ) {%>
                           <%if ($flag eq 0) {%> </font>
                           <TR align="center">
                               <%$total_events++;%><font size="1"> </font>
                               <% $firstdate = shift(@$titlearray);
                               $lastdate = pop(@$titlearray);
                               $firstmonth = shift(@$montharray);
                               $lastmonth = pop(@$montharray);  
                               $firstdow=$DAY->{dayabbreviation};
                               %><font size="1"> </font>
                               <TD align="left" style="border-top-style: solid; border-top-width: 1;
    border-bottom-style: solid; border-bottom-width: 1" bordercolor="#FFB85B" height="15" valign="top"
    width="50"><font size="1"><%=$firstmonth%> <%=$firstdate%>
                               <% if ($lastdate) { %>
                               <p align="left" style="margin-top: 0; margin-bottom: 0">  
                               ~<p align="left" style="margin-top: 0; margin-bottom: 0"><%if
    ($firstmonth ne $lastmonth) {%>
                                           <%=$lastmonth;%>
                                     <%};%>
                                     <%=$lastdate;%>
                               <%};%>
                               </FONT></TD>
                               <TD align="left" style="border-top-style: solid; border-top-width: 1;
    border-bottom-style: solid; border-bottom-width: 1" bordercolor="#FFB85B" height="15"
    valign="top"><font size="1"><A
    HREF="<%=$CGI_URL_QUERYSTRING%>popup=1&template=BTAeventview.html&event_id=<%=$EVENT->{'details'}->
    {'id'}%>" STYLE="text-decoration:underline;"
    onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;"><%=
    $EVENT->{'details'}->{'title'}; %></A><p align="left" style="margin-top: 0; margin-bottom: 0"></TD>
                               <TD align="left" style="border-top-style: solid; border-top-width: 1;
    border-bottom-style: solid; border-bottom-width: 1" bordercolor="#FFB85B" height="15"
    valign="top"><font size="1"><%= EVENT FIELD(location) %></font></TD>
                               <TD align="left" style="border-top-style: solid; border-top-width: 1;
    border-bottom-style: solid; border-bottom-width: 1" bordercolor="#FFB85B" height="15" valign="top"
    width="50%"><font size="1"><%= EVENT FIELD(description) %></font></TD>
                               </TR>
                               <%push(@titleevent,$EVENT->{'details'}->{'title'});%></FONT><FONT SIZE=
    1 face = "Verdana">
                          <%}%>
                     <%}%>
                 <%}%>
             <%/FOREACH%>
           <%} %>
        <%/IF%>
    <%/FOREACH%>
                               
    </TABLE>

     </center>
    </div>
    </FONT>

    <FONT SIZE= 1 face = "Arial, Helvetica">

    <FONT SIZE= 1 face = "Verdana">

    <%if ($total_events) {%>
        <p align="center" style="margin-top: 0; margin-bottom: 0">Total Events: <%=$total_events%><BR>
     
    <%} else {%>
        <CENTER>
        <p><I>No Events</I></p>
        <p> </p>
    </CENTER>
    </FONT>
    <%}%>
    <p></p>

    <FONT SIZE= 1 face = "Verdana">
                               <p align="center" style="margin-top: 0; margin-bottom: 0">
                               <b>
                               <a target="_blank"
    href="<%=$AdminConfig->get("calendar_url")%>?calendar=<%=$Calendar%>">Go To Dark Visions Media
    Calendar</a></b></p>
    </FONT>
    </FONT>


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