vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced Links Directory > vBa Links Directory v2.0 Support > "How Do I..." Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2007, 11:31 PM
ludachris ludachris is offline
Senior Member
 
Join Date: Oct 2005
Posts: 184
Default Need to create a pre-filled Map link for each listing

I'm trying to create a pre-filled Google Maps URL for each listing in the directory. Each listing entry will have a street address field, city field, and state field in the db tied to it. I need to add those fields to a preset URL string and swap the spaces in each field with a + symbol so that the URL will automatically show up next to each listing and will point users to a Google Map with that address.

I don't know exactly which file I'd need to modify in the script. Can anyone help me out? Thanks in advance.
Reply With Quote
  #2  
Old 05-09-2007, 10:47 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Need to create a pre-filled Map link for each listing

If you just need to format the link a bit then you shouldn't need to edit any files. Just edit your 'ADV_LINKS_SHOWLINK' template and add something like this for the URL:

google.com/?$link[fieldX]+$link[fieldY]+$link[fieldZ]
Reply With Quote
  #3  
Old 05-09-2007, 12:49 PM
ludachris ludachris is offline
Senior Member
 
Join Date: Oct 2005
Posts: 184
Default Re: Need to create a pre-filled Map link for each listing

Thanks, got it working.
Reply With Quote
  #4  
Old 07-10-2007, 01:13 AM
guttormson guttormson is offline
Member
 
Join Date: Mar 2005
Posts: 62
Thumbs up Re: Need to create a pre-filled Map link for each listing

This is incredible! It's just what I needed and it works fantastic! I used Yahoo maps only because I like their setup a bit better.

But I have a question....
Only some of my links categories need this. In fact about half of my link categories don't even use the custom address fields that produce the map link.

Therefore...
Is there a way to only have the google map link show up in certain categories?

It would also be cool to have the map link in the pull down menu when you click on a link in the category i.e.,
- View Site
- Get Map
- View Link Details
- Post Reply
- Rate Link


Thanks in advance for your time.
Reply With Quote
  #5  
Old 07-10-2007, 09:20 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Need to create a pre-filled Map link for each listing

You can use an <if condition> within the tempate to limit it to certain categories.
Code:
<if condition="$catid == X OR $catid == Y OR $catid == Z">
Reply With Quote
  #6  
Old 07-10-2007, 11:53 AM
guttormson guttormson is offline
Member
 
Join Date: Mar 2005
Posts: 62
Default Re: Need to create a pre-filled Map link for each listing

Quote:
Originally Posted by Brian View Post
You can use an <if condition> within the tempate to limit it to certain categories.
Code:
<if condition="$catid == X OR $catid == Y OR $catid == Z">
Perfect!

Brian, you are so great to deal with, so much better than some I wont mention.

What template handles the Link Options? I want to add the mapping feature there.
Reply With Quote
  #7  
Old 07-10-2007, 11:55 AM
guttormson guttormson is offline
Member
 
Join Date: Mar 2005
Posts: 62
Default Re: Need to create a pre-filled Map link for each listing

Doh! I think I found it. It's in the same template I think.
Reply With Quote
  #8  
Old 07-10-2007, 12:07 PM
guttormson guttormson is offline
Member
 
Join Date: Mar 2005
Posts: 62
Default Re: Need to create a pre-filled Map link for each listing

Hmmm... I cant seem to figure this one out. I want the "View Map" option to right under "View Site" but I can't seem to locate where to put it.

Can you help me?
Reply With Quote
  #9  
Old 07-11-2007, 10:55 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Need to create a pre-filled Map link for each listing

You mean in the drop-down menu, right? If so, the code for that would be located in your 'adv_links_linkbit' template.
Reply With Quote
  #10  
Old 07-11-2007, 12:50 PM
guttormson guttormson is offline
Member
 
Join Date: Mar 2005
Posts: 62
Default Re: Need to create a pre-filled Map link for each listing

Quote:
Originally Posted by Brian View Post
You mean in the drop-down menu, right? If so, the code for that would be located in your 'adv_links_linkbit' template.
Perfect! Done! Thank you.
Reply With Quote
  #11  
Old 11-16-2007, 02:37 AM
NashChristian's Avatar
NashChristian NashChristian is offline
Senior Member
 
Join Date: Nov 2007
Location: Nashville, Tennessee
Posts: 249
Question Re: Need to create a pre-filled Map link for each listing

Very Cool! Very, very cool!

Ok, I coppied the code for the website link in the drop-down, then modified it to map to Google Maps, threw in an IF condition for when there is a Suite Number, then threw in another IF condition so IF there is no ADDRESS data entered, it will not even offer the "View Google Map" option in the drop-down menu. Here is the code that I ended up with:

Code:
<if condition="$link[field1]"><tr>
<td align="$stylevar[left]" class="vbmenu_option falseclass"><a href="http://local.google.com/maps?f=q&hl=en&q=$link[field1]<if condition="$link[field11]">+Suite+$link[field11]</if>+$link[field2]+$link[field3]+$link[field4]" target="_blank"<if condition="$show['nofollow']"> rel="nofollow"</if>>View Google Map</a></td>
					</tr></if>
Now for a couple of questions:
  1. For some reason the mouse-over effects don't work on the "View Website" or the "View Google Map" links in the drop-down menu. The rest of the options in the menu turn bold on mouse-over. Did I screw something up? How can I fix this?
  2. Is there a way in the IF condition to require that multiple conditions are met prior to running the command line? For example, I'm currently requiring an address for the "View Google Map" option to be available, however I would rather require an ADDRESS plus a CITY and a STATE. If all 3 fields don't have data, then I don't want the "View Google Map" option to be visible in the drop-down menu, because there likely isn't enough data for the map to work.

Here is a link to my website for review. Please keep in mind that I have only entered data into the fields of the very first entry: "Anchor Fellowship (The) - Map". The rest of the links LOOK like they have information entered, however this data is still all in the "Description" field collectively. After I work the kinks out, I will re-enter all the data in the correct fields for all the links.

Thanks for your help! This is a VERY COOL feature!

Jeff
Reply With Quote
  #12  
Old 11-16-2007, 11:29 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Need to create a pre-filled Map link for each listing

1). Try removing the 'falseclass' part from the code you've added. That was added to the <td> tag that the 'View Website' link is located in to avoid some problems with vB's javascript not allowing the link to open in a new window, but should not be necessary in any other <td> tags.

2).
Code:
<if condition="$link[field1] AND $link['field2'] AND $link['field3']">
Something like will allow you to make sure that multiple custom fields are filled out. Of course you may need to change 'field2' and 'field3' to match the custom fields you're trying to check.
Reply With Quote
  #13  
Old 11-16-2007, 01:22 PM
NashChristian's Avatar
NashChristian NashChristian is offline
Senior Member
 
Join Date: Nov 2007
Location: Nashville, Tennessee
Posts: 249
Default Re: Need to create a pre-filled Map link for each listing

Great! Thanks for the help Brian!

So, should I leave the 'falseclass' part of the code in the "View Website" TD tag? It would seem to me that since both the "View Website" and the "View Google Map" links are triggering a new browser window to open to reference offsite resources, that IF the 'falseclass' is still needed in one, then it may be needed for both???

What's your recommendation Brian? Can I remove it from both? Has vB's javascript been improved since that work-around was originally implemented?

Thanks again!
Jeff
Reply With Quote
  #14  
Old 11-16-2007, 05:11 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Need to create a pre-filled Map link for each listing

I just tried removing that from my local copy and did not have any problems in IE7 or FF, so it looks like vB might have fixed the issue. You can try removing it, and as long as the links still open in a new window, then it's fine to omit that code.
Reply With Quote
  #15  
Old 11-16-2007, 11:16 PM
NashChristian's Avatar
NashChristian NashChristian is offline
Senior Member
 
Join Date: Nov 2007
Location: Nashville, Tennessee
Posts: 249
Default Re: Need to create a pre-filled Map link for each listing

Did it, works fine, thanks a lot!

Jeff
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
...just create a link to forums from CMPS Home Page Sean Massey "How Do I..." Questions 7 11-03-2007 11:35 AM
Forum Listing warcom "How Do I..." Questions 2 04-04-2007 10:17 AM
HOW-TO: Display link ID# in a listing? ataraxia "How Do I..." Questions 5 10-07-2004 04:24 PM
How do I create a link Block b4ne Troubleshooting / "How do I..." Questions 15 08-29-2004 08:56 AM


All times are GMT -4. The time now is 11:11 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.