vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   BB Code Enhancements - Interactive Google Maps In Post (https://vborg.vbsupport.ru/showthread.php?t=235625)

benstillman 02-10-2010 10:00 PM

Interactive Google Maps In Post
 
1 Attachment(s)
No Google Maps API key, no mod install, no template edits, etc. This is based off YBMF's mod for 4.0, but a bit easier for the end user. Instead of the user having to input the full Google Maps link, just the address, name of business, etc is acceptable.

Admin CP --> Custom BB Codes --> Add New BB Code


Title: Map

BB Code Tag Name: map

Replacement: <div align="center" style="margin: 5px 5px 5px 5px;">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%">
<tr>
<td class="thead" style="text-align:center"><iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q={param}&output=embed"></iframe></td>
</tr>
</table>
</div>

Example: [map]201 S. Grant Avenue, Columbus, Ohio[/map]

Description: This will insert a Google map of the location you input

Use {option}: No

Button Image (Optional): whatever 20x20 image you want, attached is the one we use

Remove Tag If Empty: Yes

Disable BB Code Within This BB Code:
Yes

Disable Smilies Within This BB Code: Yes

Disable Word Wrapping Within This BB Code: Yes

voglermc 02-11-2010 07:23 PM

What about displaying a route from A-B?

benstillman 02-11-2010 07:38 PM

1 Attachment(s)
Quote:

Originally Posted by voglermc (Post 1980211)
What about displaying a route from A-B?

Easy as cake.

[map]Columbus, OH to New York, NY[/map]

Screenshot attached of the results.

voglermc 02-11-2010 07:46 PM

I mean if I create a route on Google maps, how would I display that?

LINK

benstillman 02-11-2010 08:11 PM

1 Attachment(s)
Quote:

Originally Posted by voglermc (Post 1980226)
I mean if I create a route on Google maps, how would I display that?

LINK

I made a few adjustments to this BB Code mod specifically for you (and anyone else who might need it):
https://vborg.vbsupport.ru/showthread.php?t=235632

meissenation 02-12-2010 01:07 PM

Nice! Works pretty good too.

Videx 02-17-2010 01:23 AM

As it happens, Google Maps is still showing old road names around here. Can this be made to work with Mapquest or Bing/explore?

Jabong82 02-22-2010 08:53 PM

Very nice mod! Nominated and installed.

I don't suppose there is a way to get this to show up in the "Visitors Message" reply in the User Profile area?

Thanks in advance.

adreen 03-04-2010 05:28 AM

thanks!

glen290 03-08-2010 08:22 AM

I like this mod, how would I put multiple locations in, for my website I would like to put in locations of Bowling Centres in the Northwest of England, is this possible ?

benstillman 04-13-2010 12:28 PM

Quote:

Originally Posted by Videx (Post 1984246)
As it happens, Google Maps is still showing old road names around here. Can this be made to work with Mapquest or Bing/explore?

Let me see what i can do.

Videx 04-13-2010 12:38 PM

Quote:

Originally Posted by benstillman (Post 2020507)
Let me see what i can do.

The problem is that neither Bing nor Mapquest seems to want to take a simple URL like Google maps will, so I've had no luck with them.

Mutt 04-13-2010 12:45 PM

Thanks

BirdOPrey5 05-16-2010 11:46 PM

Installed and working great in 3.8.4 PL2. I must say your implementation adds far more security then the original hack because it forces the iframe to google instead of getting it passed from the user.

Marcus97 05-17-2010 04:09 AM

Nice Mod..thanks!!

docvader 05-17-2010 05:27 AM

Works great on 4.03

eda199 05-27-2010 04:56 PM

u rock...

eda199 05-27-2010 04:57 PM

installed and checked and rated

Wayne Luke 05-27-2010 05:24 PM

Can I ask why you enclosed the iframe in both a <div> and table? Seems like overkill in layout.

fabzster 05-31-2010 07:09 AM

aweseom thanks

dieselpowered 06-03-2010 04:57 AM

Quote:

Originally Posted by Wayne Luke (Post 2044212)
Can I ask why you enclosed the iframe in both a <div> and table? Seems like overkill in layout.

I wonder if this is the reason the spacing is different on the top and bottom? Seems the text is closer to the top of the map then the text is to the bottom?

chuckhodson 06-03-2010 05:29 AM

Cool works great thanks...

leo.prasanth 06-12-2010 06:43 PM

One question please:

I want to display the name of a place with a placemarker in my map. How do I do that ?

- thanks,
Leo

benstillman 06-14-2010 02:36 PM

Quote:

Originally Posted by Wayne Luke (Post 2044212)
Can I ask why you enclosed the iframe in both a <div> and table? Seems like overkill in layout.

Quote:

Originally Posted by benstillman
This is based off YBMF's mod for 4.0, but a bit easier for the end user.

I simply modified theirs to fit what I wanted.

CybaGirl 06-25-2010 02:26 PM

Awesome works well and just what I have been looking for!

Installed on vBulletin v4.0.3 and works perfectly!

Thank you very much!

dieselpowered 06-27-2010 09:14 PM

Seems I get an error in 4.0.4 PL 1
Quote:

The following BB Code replacement may not be properly formed. All HTML attributes should be enclosed within double quotes.

BirdOPrey5 06-27-2010 09:38 PM

Did you edit or change anything from double quotes " " to single quotes' ' ? Perhaps a double single quote '' ? Looking over the text there is no error on the author's part so either something got changed or your vB is malfunctioning. Perhaps try copying and pasting the replacement again?

dieselpowered 06-27-2010 10:04 PM

I simply copy and pasted the code right from this page.

BirdOPrey5 06-27-2010 10:15 PM

I believe you, it's just damned weird, obviously many people have done it without this issue... Although I've never seen this happen before when copying into a vb text box perhaps some extra formating is being copied over for you? Try copying and pasting the code below... if that doesn't work try copying it into a text editor like notepad then re-copy from the editor and paste- that will remove any extra formatting.

Code:

<div align="center" style="margin: 5px 5px 5px 5px;">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%">
<tr>
<td class="thead" style="text-align:center"><iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q={param}&output=embed"></iframe></td>
</tr>
</table>
</div>


BirdOPrey5 06-27-2010 10:22 PM

If those still don't work then start removing tags from the text... yes I know it won't work right but it will, hopefully, narrow down exactly what tag is causing the issue... for instance try just:

Code:

<div align="center" style="margin: 5px 5px 5px 5px;">
</div>

Do you still get an error? if not try:

Code:

<div align="center" style="margin: 5px 5px 5px 5px;">
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%">
<tr>
<td class="thead" style="text-align:center"></td>
</tr>
</table>
</div>

etc... until you find out exactly what piece of code is causing the error.

If you still get the error on even just a basic <div> </div> tag with no extras then I would look to the custom bb code immediately above this one, perhaps a quote is not closed throwing everything off... I've seen this issue cause havoc with css style sheets, never bb 's code but there's a first time for everything.

dieselpowered 06-27-2010 10:23 PM

I hear ya...its odd...worked fine with 4.0.3...just getting the error in 4.0.4 PL1 :)

Dragonsys 06-28-2010 01:43 PM

Quote:

Originally Posted by dieselpowered (Post 2060748)
I hear ya...its odd...worked fine with 4.0.3...just getting the error in 4.0.4 PL1 :)

hmmm working great for me on 4.0.4 PL1 (can see it here - http://forums.texas-fbody.org/portal.php?pageid=tfba)
I would try removing it and reinstalling

dieselpowered 06-28-2010 01:54 PM

Oh it works fine...just get that error when saving the custom BB code in admincp :)

Dragonsys 06-28-2010 05:12 PM

Quote:

Originally Posted by dieselpowered (Post 2061107)
Oh it works fine...just get that error when saving the custom BB code in admincp :)

lol oh ok, i missed that part

benstillman 07-06-2010 04:31 PM

Odd. I just tried it on 4.0.4PL1 and it works fine. Not sure what to tell you on that one.

Wilfred1 07-07-2010 08:44 AM

I also get the same error in 4.0.4 PL1 - it is the param that is causing it

BirdOPrey5 07-07-2010 09:32 AM

I see it now on my test install of vb4...
Quote:

The following BB Code replacement may not be properly formed. All HTML attributes should be enclosed within double quotes.
<div align="center" style="margin: 5px 5px 5px 5px;"> <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%"> <tr> <td class="thead" style="text-align:center"><iframe width="100%" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q={param}&output=embed"></iframe></td> </tr> </table> </div>
It's perfectly safe to ignore this error and hit continue, I imagine it would happen anytime the {param} is in an http statement, I don't know if this would qualify as another 'bug' or just a poorly thought out 'feature' of vb4.

mimocherry 07-07-2010 11:58 PM

I like it very much, but can you please help me to make a little change?

when I click on the "A" (destination) it will display the address but no picture. Sometimes the location has a picture, and I would like to display it.

for example, if you put some address in the map.google.com, like the following
Redmond City Hall
15670 Northeast 85th Street
Redmond, WA 98052-3584

you will see a picture, but with your BB code, it will not show the picture :-(

benstillman 07-08-2010 04:27 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2065765)
I see it now on my test install of vb4...


It's perfectly safe to ignore this error and hit continue, I imagine it would happen anytime the {param} is in an http statement, I don't know if this would qualify as another 'bug' or just a poorly thought out 'feature' of vb4.

Sure enough. Good catch. Yeah, that's not a problem with this but with the way vBulletin is validating the HTML.

benstillman 07-08-2010 04:30 PM

1 Attachment(s)
Quote:

Originally Posted by mimocherry (Post 2066127)
I like it very much, but can you please help me to make a little change?

when I click on the "A" (destination) it will display the address but no picture. Sometimes the location has a picture, and I would like to display it.

for example, if you put some address in the map.google.com, like the following
Redmond City Hall
15670 Northeast 85th Street
Redmond, WA 98052-3584

you will see a picture, but with your BB code, it will not show the picture :-(

Seems to be working fine for me. I just typed "Redmond City Hall 98052" within the map tags.


All times are GMT. The time now is 06:13 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.01287 seconds
  • Memory Usage 1,828KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete