Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Location links to Google Maps, Bing Maps or Yahoo Maps Details »»
Location links to Google Maps, Bing Maps or Yahoo Maps
Version: 1.01, by boydy boydy is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.x.x Rating:
Released: 01-27-2011 Last Update: Never Installs: 15
Template Edits
 
No support by the author.

Hi guys,

This mod/hack let's you make a users location link to either Google Maps or Bing Maps. When you follow the hyperlink it opens the map at the location that the user has set. This can be done the the old horizontal postbit and the new vertical legacy postbit. Below is the code replacement for both maps and postbits.

=|= Install =|=

=|= Postbit (Vertical Legacy) =|=

Google Maps:

Open Template
- Postibit Templates -> postbit_legacy

Find -
Code:
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd>{vb:raw post.field2}</dd></vb:if>


Replace
-
Code:
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q={vb:raw post.field2}" target="_blank">{vb:raw post.field2}</a></dd></vb:if>


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

Bing Maps:


Open Template - Postibit Templates -> postbit_legacy

Find -
Code:
<vb:if  condition="$post['field2']"><dt>{vb:rawphrase  location_perm}</dt> <dd>{vb:raw  post.field2}</dd></vb:if>


Replace
-
Code:
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd><a href="http://www.bing.com/maps/?v=2&where1={vb:raw post.field2}" target="_blank">{vb:raw post.field2}</a></dd></vb:if>
---------------------------------------------------------------------------------------

Yahoo Maps:


Open Template - Postibit Templates -> postbit_legacy

Find -
Code:
<vb:if   condition="$post['field2']"><dt>{vb:rawphrase   location_perm}</dt> <dd>{vb:raw   post.field2}</dd></vb:if>


Replace
-
Code:
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd><a href="http://maps.yahoo.com/#mvt=m&q1={vb:raw post.field2}" target="_blank">{vb:raw post.field2}</a></dd></vb:if>


=|= Postbit (Horizontal) =|=


Google Maps:

Open Template - Postibit Templates -> postbit

Find -
Code:
<vb:if  condition="$post['field2']"><dt>{vb:rawphrase  location_perm}</dt> <dd>{vb:raw  post.field2}</dd></vb:if>


Replace
-
Code:
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q={vb:raw post.field2}" target="_blank">{vb:raw post.field2}</a></dd></vb:if>


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

Bing Maps:


Open Template - Postibit Templates -> postbit

Find -
Code:
<vb:if  condition="$post['field2']"><dt>{vb:rawphrase  location_perm}</dt> <dd>{vb:raw  post.field2}</dd></vb:if>
Replace -
Code:
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd><a href="http://www.bing.com/maps/?v=2&where1={vb:raw post.field2}" target="_blank">{vb:raw post.field2}</a></dd></vb:if>


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

Yahoo Maps:


Open Template - Postibit Templates -> postbit

Find -
Code:
<vb:if   condition="$post['field2']"><dt>{vb:rawphrase   location_perm}</dt> <dd>{vb:raw   post.field2}</dd></vb:if>


Replace
-
Code:
<vb:if  condition="$post['field2']"><dt>{vb:rawphrase  location_perm}</dt> <dd><a  href="http://maps.yahoo.com/#mvt=m&q1={vb:raw post.field2}"  target="_blank">{vb:raw  post.field2}</a></dd></vb:if>
And that's it! Screenshots below with some random locations and the resulting map search.

If you have any questions/problems or wish the location to link elsewhere and need help, post a comment and i'll help out as much as i can.

If you like this mod and/or using it please remember to mark as installed!

Thanks!

Boydy

Update 1.01 changelog;
  • Modified Google URL.
  • Hyperlink will now open in a new window.
  • Added Yahoo maps.

Screenshots

File Type: png 1296177055.png (4.8 KB, 0 views)
File Type: jpg 1296177126.jpg (125.3 KB, 0 views)
File Type: png 1296177215.png (4.5 KB, 0 views)
File Type: jpg 1296177242.jpg (130.7 KB, 0 views)
File Type: png 1296209064.png (4.7 KB, 0 views)
File Type: jpg 1296209095.jpg (145.9 KB, 0 views)
File Type: png 1296209183.png (4.9 KB, 0 views)
File Type: jpg 1296209211.jpg (109.7 KB, 0 views)
File Type: png 1296209926.png (3.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Insta-Gator

Comments
  #2  
Old 01-28-2011, 10:13 AM
zelnik zelnik is offline
 
Join Date: Aug 2008
Posts: 374
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what happens if someone puts in a location that :

a> Isn't a place (is the link still clickable?)
b> If there are more than one of the places (London for example, think there at least 3 in the world)

Looks a great idea though, tagged.
Reply With Quote
  #3  
Old 01-28-2011, 10:21 AM
boydy's Avatar
boydy boydy is offline
 
Join Date: Jan 2011
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zelnik View Post
what happens if someone puts in a location that :

a> Isn't a place (is the link still clickable?)
b> If there are more than one of the places (London for example, think there at least 3 in the world)

Looks a great idea though, tagged.
A - Well yes the link is still clickable as there isn't really an easy way for the system to determine whether it is a place or not. Let's be honest there are alot of obscure places in the world lol. Unfortunately nothing i can do about this.

B - It will go to the most well known place, people can be more specific in there location though. For example Perth, they could have the location set to Perth, UK or Perth, AU. Also the search results have a dropdown showing similar places...

Hope this helps
Reply With Quote
  #4  
Old 01-29-2011, 11:16 PM
bulldog51981's Avatar
bulldog51981 bulldog51981 is offline
 
Join Date: Oct 2010
Location: St. Louis, Mo, USA
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For anyone in the U.S., this is the code that I used:

<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q={vb:raw post.field2}" target="_blank">{vb:raw post.field2}</a></dd></vb:if>

I also added the target="_blank" after the html page so that it opens in a new window or tab (depending on your settings) instead of opening in the page that you're on.

Great mod, members already love it and it's only been in a few mins!
Reply With Quote
  #5  
Old 01-30-2011, 06:58 AM
boydy's Avatar
boydy boydy is offline
 
Join Date: Jan 2011
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Appologies i didn't even notice that it was .co.uk .

Will be updating the mod shortly anyway, glad you like it.
Reply With Quote
  #6  
Old 01-30-2011, 11:30 AM
zelnik zelnik is offline
 
Join Date: Aug 2008
Posts: 374
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by boydy View Post
Appologies i didn't even notice that it was .co.uk .

Will be updating the mod shortly anyway, glad you like it.
What do you plan on adding?
Reply With Quote
  #7  
Old 01-30-2011, 12:30 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed for testing with thanks ...

Seems to work well, except of course for people who put cute phrases in their locations instead of actualt locations ..

By the way, used bulldog's code instead of original...

Quote:
Originally Posted by bulldog51981 View Post
For anyone in the U.S., this is the code that I used:

<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q={vb:raw post.field2}" target="_blank">{vb:raw post.field2}</a></dd></vb:if>
Regards,
Doug
Reply With Quote
  #8  
Old 01-30-2011, 01:11 PM
boydy's Avatar
boydy boydy is offline
 
Join Date: Jan 2011
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zelnik View Post
What do you plan on adding?
I'll be adding new maps shortly and hopefully make the install automated in time. Any suggestions on what people would like to see is welcome.
Reply With Quote
  #9  
Old 01-30-2011, 06:56 PM
boydy's Avatar
boydy boydy is offline
 
Join Date: Jan 2011
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First update has been done. Enjoy guys and thanks to bulldog for the heads up regarding the URL. As ever any questions/suggestions post a comment and i'll get back to you!
Reply With Quote
  #10  
Old 01-31-2011, 06:02 AM
flegul flegul is offline
 
Join Date: Dec 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent :up: Nominated MOTM
Reply With Quote
Reply

Thread Tools

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


All times are GMT. The time now is 05:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04499 seconds
  • Memory Usage 2,347KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (12)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete