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


Login with username, password and session length

Search

 
Advanced search

8054 Posts in 1860 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Conditional Map Link  (Read 323 times)
0 Members and 1 Guest are viewing this topic.
TotalHosting
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: January 09, 2004, 01:50:00 AM »

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).]

Logged

DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 235

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


WWW
« Reply #1 on: January 09, 2004, 02:25:00 PM »

** but it's blanking out the event results in the event details page. **

What HTML code if being generated by the calendar?

** trying to test for presence of a variable in the event description 'addr' [field] **

** <% unless ($EVENT->{'details'}->{'addr'}->($_) ) { %> **

Tha line should probably just be:

if ( $EVENT->{'details'}->{'addr'} ) { %> ...

Dan O.

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

Logged
Total Hosting
Guest
« Reply #2 on: January 09, 2004, 05:59:00 PM »

Thanks DanO

Worked like a champ!

Pete

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 235

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


WWW
« Reply #3 on: January 09, 2004, 09:00:00 PM »

Glad to hear it.

Dan O.

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

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