Hi All.
I am trying to test for presence of a variable in the event description 'addr' If the field is blank, I want to hide the link. So that I assume that if the street address is present, the rest of the location address elements are present and the link can be shown.
This is my code, but it's blanking out the event results in the event details page.
Your help is greatly appreciated ;-)
code:
<%-- EVENT VIEW --%>
<% } elsif ($VIEW eq "Event") { %>
<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
<%
foreach (@$fields) {
next unless ($db->{'properties'}->{$_}->{'display_details'});
next unless ( $EVENT->{details}->{$_} );
%>
<TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD><TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD></TR>
<% } %>
<TR><TD colspan="2" ALIGN="center" VALIGN="top"><br><br>
<a href="http://maps.yahoo.com/py/maps.py?city=<%= $EVENT->{'details'}->{'city'} %>&state=<%= $EVENT->{'details'}->{'state'} %>&addr=<%= $EVENT->{'details'}->{'addr'} %>&zip=<%= $EVENT->{'details'}->{'zip'} %>&zoom=8" target="_blank">Click here for a map and directions</a><br><br>
<% unless ($EVENT->{'details'}->{'addr'}->($_) ) { %><SPAN CLASS="text"><B><a href="http://www.mapquest.com/maps/map.adp?city=<%= $EVENT->{'details'}->{'city'} %>&state=<%= $EVENT->{'details'}->{'state'} %>&address=<%= $EVENT->{'details'}->{'addr'} %>&zip=<%= $EVENT->{'details'}->{'zip'} %>&zoom=8" target="_blank">Click here for a map and directions</a></SPAN><% } %></TD></TR>
</TABLE>
------------------
Pete http://www.TotalHosting.com
[This message has been edited by TotalHosting (edited January 09, 2004).]
[This message has been edited by TotalHosting (edited January 09, 2004).]