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


Login with username, password and session length

Search

 
Advanced search

8240 Posts in 1905 Topics- by 2172 Members - Latest Member: JeffHLB
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO)Yahoo Maps or Mapquest Mod?
Pages: 1 [2]   Go Down
Print
Author Topic: Yahoo Maps or Mapquest Mod?  (Read 4286 times)
0 Members and 1 Guest are viewing this topic.
vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #15 on: January 24, 2003, 02:49:00 PM »

Here is the code you requested:

               <%-- EVENT VIEW --%>
foreach $field (@$fields) {
                               next unless ($db->{'properties'}->{$field}->{'display_details'});
                  #             next if    ($db->{'properties'}->{$field}->{'name'} eq "Zip");
                  #             next if    ($db->{'properties'}->{$field}->{'name'} eq "Street Addr");
       %>
                                 <TR><TD ALIGN="right" VALIGN="top"><SPAN
                                 CLASS="text"><B><%=$db->{'properties'}->{$field}->{'name'}%>: </B></SPAN></TD>
                                 <TD ALIGN="left" VALIGN="top"><SPAN CLASS="text"><%=$EVENT->{details}->{$field}%>
                                   <%
                                 if (($db->{'properties'}->{$field}->{'name'} eq  "Location") &&
                                   ($EVENT->{'details'}->{'zip'}) &&   ($EVENT->{'details'}->{'streetaddr'}) ){
                                   $EVENT->{'details'}->{'streetaddrurl'} = $EVENT->{'details'}->{'streetaddr'};
                                   $EVENT->{'details'}->{'streetaddrurl'} =~ s/\s/\+/g;
                                   %>
<!-- MAP -->
(<a href="http://mapquest.com/maps/map.adp?country=US&address=<%=$EVENT->{'details'}->{'streetaddrurl'}%>&zipcode=<%=$EVENT->{'details'}->{'zip'}%>&homesubmit.x  =29&homesubm
it.y=7">map</a> )      
                       <% } %>      
   </SPAN></TD></TR>
                       <% } %>
               <% } elsif ($VIEW eq "Event") { %>
                       <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
                       <%
                       foreach (@$fields) {
                               next unless ($db->{'properties'}->{$_}->{'display_details'});
                       %>
                               <TR><TD ALIGN="right" VALIGN="top"><SPAN CLASS="text"><B><%=$db->{'properties'}->{$_}->{'name'}%>: </B></SPAN></TD><TD ALIGN="left" VALIGN="to
p"><SPAN CLASS="text"><%=$EVENT->{details}->{$_}%></SPAN></TD></TR>
                       <% } %>
                       </TABLE>
                               
               <%-- SEARCH VIEW --%>
               <% } elsif ($VIEW eq "Search") { %>

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #16 on: January 24, 2003, 06:36:00 PM »

I think the problem is here:

<% } %>
</SPAN></TD></TR>
<% } %>
<% } elsif ($VIEW eq "Event") { %>

Try removing the second <% } %> bolded above or just commenting it out for now like:

<% # } %>

BTW. You appear to have a space in the part of the code for the link URL ".x =29". There shouldn't be one there or the link may not work properly.

Dan O.

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

Logged
vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #17 on: January 25, 2003, 11:49:00 PM »

I went ahead and put the # where you mentioned and I also removed the extra space. The script is now running but I never get a "map" link next to my location field. Here are the three fields I created along with their properties:

Display name: Location
Unique Field ID: location
Description: Event Location

Display name: Street Address
Unique Field ID: streetaddr
Description: Event Street Address

Display name: Zip
Unique Field ID: zip
Description: Event Zip Code

All three of the above are configured as the following:
Required: No
Display in Add Form: Yes
Display in details: Yes
Searchable: Yes
Input Type: Text

I also tried the location field as the following with no luck:

Unique Field ID: Location

Thank you for your help,
Ty

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #18 on: January 26, 2003, 01:51:00 PM »

** The script is now running but I never get a "map" link
next to my location field. **

Do you have an Street Address and Zip fields filled out for the
events being displayed? If not, no link will (or can)
be printed.

Other than that, I don't know where the problem would be. Sorry.

BTW. If you want to see the map link printed regardless of those other fields, change this line (temporarily)

if (($db->{'properties'}->{$field}->{'name'} eq "Location") && ($EVENT->{'details'}->{'zip'}) && ($EVENT->{'details'}->{'streetaddr'}) ){

to

if (1){

Dan O.

[This message has been edited by DanO (edited January 26, 2003).]

Logged
vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #19 on: January 27, 2003, 02:05:00 PM »

Thank you for all your help but I still have no map link.

I just reinstalled the entire thing from scratch hopefully that would do the trick. After that I added location, streetaddr and zip to my customize event fields. I then added the if statement that was posted by Zim on March 15, 2002 10:19 AM. I of course made the few corrections that you mentioned in your previous messages.

But after all of that, I still have no luck. Any other ideas of what I should do?

Thanks in advance,
Ty

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #20 on: January 31, 2003, 01:57:00 PM »

** I still have no map link. **

Did you try the
if (1){
to help us see if it is the if statement causing the problem?

** Any other ideas of what I should do? **

None other than checking the spelling of the fields you've added to make sure they correspond with the fields named in the if statement.

Dan O.

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

Logged
vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #21 on: February 02, 2003, 07:57:00 AM »

Thanks for all your help. I did try the if (1){ but that still didn't force te maps link to appear. I have no idea what I have done wrong. I also checked the spelling of the fields and this is what I have.

Display name: Location
Unique Field ID: location
Description: Event Location

Display name: Street Address
Unique Field ID: streetaddr
Description: Event Street Address

Display name: Zip
Unique Field ID: zip
Description: Event Zip Code

All three of the above are configured as the following:
Required: No
Display in Add Form: Yes
Display in details: Yes
Searchable: Yes
Input Type: Text

I also tried the location field as the following with no luck:

Unique Field ID: Location


I would be willing to reinstall everything if you wanted to provide me with the step-by-step instructions of what I need to do to get this done.

Ty

Logged
DanO
Moderator
Sr. Member
*****

Karma: 13
Offline Offline

Posts: 273

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


WWW
« Reply #22 on: February 08, 2003, 06:26:00 PM »

Sorry but I don't know where your problem may be.

Dan O.

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

Logged
David H
New Member
*

Karma: 0
Offline Offline

Posts: 0

Network Administrator


WWW
« Reply #23 on: March 31, 2003, 02:51:00 PM »

I had similar problems getting my map link to work but now it works in event view as detailed earlier!!

Here's what I noticed while debugging:
1) I noticed that ($field) was put in place of ($_) in the code snippit. When I replaced $_ with $field the field names and values for the event disappeared from the event view.

2) The problem causing my perl code to error must have been in the "map" section of the code or directly thereafter. I cut and pasted code in a little at a time and tested. The last paste worked so I saved and declared "victory".

Here is my whole section of code:

<!-- EVENT VIEW -->
      <% } elsif ($VIEW eq "Event") { %>
         <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
         <%foreach (@$fields) {
            next unless ($db->{'properties'}->{$_}->{'display_details'});
             next if    ($db->{'properties'}->{$_}->{'name'} eq "Zip Code");                  
             next if    ($db->{'properties'}->{$_}->{'name'} eq "Street Address");%>
         
            <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}->{$_}%>
            
         <% if (($db->{'properties'}->{$_}->{'name'} eq  "Location") && ($EVENT->{'details'}->{'zip'}) && ($EVENT->{'details'}->{'streetaddr'}))
         {$EVENT->{'details'}->{'streetaddrurl'} = $EVENT->{'details'}->{'streetaddr'};
         $EVENT->{'details'}->{'streetaddrurl'} =~ s/\s/\+/g; %>
         
         <!-- MAP -->
         (<a href="http://mapquest.com/maps/map.adp?country=US&address=
         <%=$EVENT->{'details'}->{'streetaddrurl'}%>&zipcode=
         <%=$EVENT->{'details'}->{'zip'}%>&homesubmit.x =29&homesubmit.y=7"><b><font color=#990000>MAP</font></b></a> )   
         <% } %>     
            
            </SPAN></TD>
            </TR>
         <% } %>
         </TABLE>

      <!-- SEARCH VIEW -->

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

Logged
David H
New Member
*

Karma: 0
Offline Offline

Posts: 0

Network Administrator


WWW
« Reply #24 on: March 31, 2003, 02:55:00 PM »

Now for a map link in "LIST VIEW"

It seems that some of the code for event view is specific to it only so . . .

What part of the code needs to be included in the List View section?

Where specifically do I place it?

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

Logged
David H
New Member
*

Karma: 0
Offline Offline

Posts: 0

Network Administrator


WWW
« Reply #25 on: April 01, 2003, 02:50:00 PM »

The following is the code and placement for list view access to a map link.

<!-- END GRID STYLE DISPLAY -->
         <% } elsif ($STYLE eq "List") { %>
         <!-- LIST STYLE DISPLAY -->
            <CENTER><TABLE BORDER="0" WIDTH="90%"><TR><TD ALIGN="left">
            <SPAN CLASS="text">
            <DL>
            <%$total_events=0;%>
            <%FOREACH EVENTLIST%>
               <%IF EVENTS EXIST%>
               <%$total_events++;%>
               <DT><B><A HREF="<%=$CGI_URL_QUERYSTRING%>selected_datestring=<%=$DAY->{'datestring'}%>&datestring=<%=$DAY->{'datestring'}%>&view=Day" CLASS="text"><%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%></A></B>
               <DD>
                  <%FOREACH EVENT%>
                     •
                     <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %>
                     <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %>
                     <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %>
                     <A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" STYLE="text-decoration:underline;" CLASS="text"><%= EVENT FIELD(title) %></A>
                  <%= ", location:" %><%= EVENT FIELD(location) %>
                     <% if( ($EVENT->{'details'}->{'zip'}) && ($EVENT->{'details'}->{'streetaddr'}) ){
                        $EVENT->{'details'}->{'streetaddrurl'} = $EVENT->{'details'}->{'streetaddr'};
                        $EVENT->{'details'}->{'streetaddrurl'} =~ s/\s/\+/g;%>
         <!-- MAP -->
            (<a href="http://mapquest.com/maps/map.adp?country=US&address=<%=$EVENT->{'details'}->{'streetaddrurl'}%>&zipcode=<%=$EVENT->{'details'}->{'zip'}%>&homesubmit.x =29&homesubmit.y=7" target="_blank">map</a> )
            <% } %>
   
                  <BR>
                  <%/FOREACH%>
               <%/IF%>
            <%/FOREACH%>
            </DL>
            <%unless($total_events){%>
            <I>No Events</I>
            <% } %>
            </SPAN>
            </TD></TR></TABLE></CENTER>
         <% } %>
         <!-- END LIST STYLE DISPLAY -->

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

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