vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   BB Code Enhancements - Google maps BBCode (https://vborg.vbsupport.ru/showthread.php?t=193760)

Leo Brazil 11-04-2008 01:41 PM

Oasi, after giving you some headaches to fix it and now that's is working great....

....I was thinking to my self yeasterday....How about to improve this BBCode or even a new one ? I mean, how about to include Google Earth on it ?

Just an idea...lol...

mattcaswell 11-15-2008 03:34 PM

Quote:

Originally Posted by oasi (Post 1656596)
I don't know why your gmap pasted code isn't chaged to html chars...

" should be "
< should ve &lt;

An easy "fix" would be to change this line in the code:

t_i="{param}";

to

t_i='{param}';

But if could fail if there is some ' char into the code of the map...

Try it...

This was the only way I could get this to work on my system. Thanks for all your hard work!

matt

CThiessen 11-19-2008 06:01 PM

Hi,
I head the following Problem .
If I test this BBCode in my "Admin Only" Part of the Forum everything was OK.
If I copied the Post to the Forum where I make Announcements it stops working.
Long time ago I set up this Forum with the Possibility of the use of HTML
this is not working together with this BBCode.
Just to let you know, maybe helps somebody if this is not running.
Best regards
Christian

aciurczak 11-20-2008 06:32 PM

How does it confirm that it is a valid google maps code? Looking at the code, one of the checks seems to be that the URL starts with http://maps.google, and it also confirms that there isn't any other http:// within the code. But if someone posted something like http://maps.google.evildomain.com, would that fail this check or would it be approved?

oasi 11-24-2008 05:40 AM

->Christian,

Could you copy the generated code to see what's wrong?

->aciurczak

The check would fail with the URL you posted, I know that this is not perfect :P
If you try to get a better security check for this please post it here to share it with us.

Thanks!

aciurczak 11-24-2008 06:22 AM

Quote:

Originally Posted by oasi (Post 1671797)
The check would fail with the URL you posted, I know that this is not perfect :P
If you try to get a better security check for this please post it here to share it with us.

Hi Oasi -

I changed that check to:

PHP Code:

if (u.indexOf("http://maps.google.com/")!=0){return false;} 

so the code has to include http://maps.google.com/, not just http://maps.google . Still not perfect, but a little better.

oasi 11-24-2008 06:38 AM

I hope all your users come from the US or UK ;-)

What about

http://maps.google.it/
http://maps.google.es/
http://maps.google.de/

If all of your users use the .com domain to insert the maps, it's a very valid solution...

Other option would be to check that after the http://maps.google. there are as maximum 4/5 characters, so only a domain could be included, or set an array of valid domains to check that the rest of the URL is one of the domains allowed.

aciurczak 11-24-2008 07:20 AM

Quote:

Originally Posted by oasi (Post 1671805)
I hope all your users come from the US or UK ;-)

I'm not worried about anything but .com yet. It will cover 95% of my users, and likely 100% of my users who would be prone to embedding a map. As soon as one of my users tries embedding a google map from a non .com address and runs into a problem, I'll deal with it then.

Also, even if the map or route is not in the US or UK, you can still use maps.google.com to map it or route it. Here's an example route from Berlin to Paris using maps.google.com. Yes, it's in English, but it still works fine.

zelnik 11-25-2008 01:00 PM

Great little code... two questions.

1> Is there a way of adding the directions to the map or a automatic link?
2> Why when i zoom into a map to the highest point can I not use the embed code?

Thanks marked as installed.

oasi 11-26-2008 06:09 AM

Quote:

1> Is there a way of adding the directions to the map or a automatic link?
I'm not suere if it's that you're asking, but you can add directions, routes or whatever the google maps app let you add. You only have to click the link button when you've finished adding the stuff and put this code into the [gmap] bbcode.

It's not possible to add the link, but you only have to add an html link below...

Quote:

2> Why when i zoom into a map to the highest point can I not use the embed code?
I've been able to add maps with the StreetView inclusive, but it's true that some maps does'nt have the "link" option to add the code to a web or a direct link. You'll have to ask google why, I don't know the reason :(

zelnik 11-26-2008 09:11 AM

Quote:

Originally Posted by oasi (Post 1673185)
I'm not suere if it's that you're asking, but you can add directions, routes or whatever the google maps app let you add. You only have to click the link button when you've finished adding the stuff and put this code into the [gmap] bbcode.

I mean including the direction, such as "Turn left onto the n332 Alicante" next to the map.

Any help would be appreciated.

RAIDPTN 12-07-2008 07:55 PM

Moltes gràcies oasi funciona perfectament.

fins una altra.

intruder 12-23-2008 04:25 PM

Very nice addon.
I'll donate 10$ for a yahoo maps bb code.

bymetinay 02-06-2009 05:38 PM

thanks perfect

qti 02-12-2009 01:36 PM

I tried on my vb 3.6.8 and it doesn't work - need to pay for a vb update to get this to work I suppose? :(

mykkal 02-16-2009 09:31 AM

Can someone make an XML and separate files for this? I don't want to make code changes unless necessary. I'd like to be able to uninstall it cleanly.

Sonyuserforum 02-16-2009 11:34 AM

Quote:

Originally Posted by mykkal (Post 1745751)
Can someone make an XML and separate files for this? I don't want to make code changes unless necessary. I'd like to be able to uninstall it cleanly.

You have to make a new custom BBCode. Please read carefully.

mykkal 02-16-2009 11:54 AM

Quote:

Originally Posted by Sonyuserforum (Post 1745812)
You have to make a new custom BBCode. Please read carefully.


Ok... Thanks.

inciarco 02-16-2009 02:54 PM

Thank You For Sharing this BB Code. :up:

There is a Problem when the Map is Searched via "Search in Map", the Embed HTML includes the Search Result Code and when Included in the GMAP BBCode then it Browse the Original Result and Not the Zoomed and Moved Map that supposes to be the one to be seen on the Embed HTML Code.

At first it seems to Displays the Zoomed Map but a Few Seconds Later when the Page is Loaded it Zoomes Back to the Original Result of the Search in Map.

Code:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=es&amp;geocode=&amp;q=burj+al+arab&amp;sll=37.0625,-95.677068&amp;sspn=25.20756,56.601563&amp;ie=UTF8&amp;ll=25.141149,55.185614&amp;spn=0.006295,0.006295&amp;t=h&amp;output=embed&amp;s=AARTsJrQ_VeJ0vHH1hWqkq_CSvs8lI6h2A"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=es&amp;geocode=&amp;q=burj+al+arab&amp;sll=37.0625,-95.677068&amp;sspn=25.20756,56.601563&amp;ie=UTF8&amp;ll=25.141149,55.185614&amp;spn=0.006295,0.006295&amp;t=h" style="color:#0000FF;text-align:left">Ver mapa m?s grande</a></small>
This is a Zoomed Version of the Hotel Burj Al Arab, (Max Zoom), but if you Include it on the GMAP BBCode you'll see that it's Displayed Zoomed Out.

How can I Correct that and Tell Google Maps to Ignore the Search Code (You can see it on the Code as "q=burj+al+arab&amp" and some other Codes that are Different than the ones obtained by Browsing the Google Map and Not Searching it, and by Browsing it the Code is Correct and Displays the Zoomed Map as it should be)? :confused::confused::confused:

I obtained this by searching burj al arab on Google Maps and choosing/clicking on the first result.

My Best Regards.

:)

Vaupell 02-16-2009 04:22 PM

Tx.. lovely mod.. Installed and voted.. yeah. ;)

senadxxx 02-16-2009 11:47 PM

very good picture to google maps Enjoy

ozvr4com 02-28-2009 12:57 AM

Got it working, and its ACE! Thanks!

Defkalion 03-20-2009 09:36 AM

Very nice, installed.

Thankyou :)

BlueNinjaGo 03-20-2009 01:39 PM

Awesome... works... thanks!

cellarius 04-21-2009 07:04 AM

Works for me in all browsers (Firefox, Safari, Chrome, Opera) but in IE. In IE 7 and 8 I only get blank, white page inside the iframe. If I look at the source code of the iframe page, it seems to be there alright, but it displays as just plain white...

GeoMapia 04-23-2009 01:56 PM

Quote:

Originally Posted by cellarius (Post 1795747)
Works for me in all browsers (Firefox, Safari, Chrome, Opera) but in IE. In IE 7 and 8 I only get blank, white page inside the iframe. If I look at the source code of the iframe page, it seems to be there alright, but it displays as just plain white...

use this code:

Code:

<script type="text/javascript">
function checkURL()
  {
      if ((url.indexOf("http://")!=url.lastIndexOf("http://"))||url.lastIndexOf("http://")!=0){return false;}
      if (url.indexOf('&quot')>=0) {return false;}
      if (url.indexOf("http://maps.google")!=0){return false;}
      return true
  }

tot='{param}';
tot=tot.substr(tot.indexOf("src=&quot;")+10,tot.length);
url=tot.substr(0,tot.indexOf("&quot;"));
urlp=url.replace(/;amp;/g,';');
url=urlp;

if (checkURL())

    document.write('<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+url+'"></iframe>');
}
else
{
document.write("<p><b>Wrong map URL, edit the post to change it.</b></p>Reload the page when finished to check if correct.");
}
</script>

The others settings for the BBCode are:

Title:
Code:

Google Map
Tag:
Code:

GMAP
Sample:
Code:

[gmap]iframe code[/gmap]
Description:
Code:

Embeds Google maps into posts. To use this find the map you want on Google Maps, click the link icon and select all text that is in the "Paste HTML to embed in website" section. Then paste into the post surround by [gmap]iframe code[/gmap]
Use {option}: -> No
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

and use this button on the message editor toolbar (16x16 Pixels | PNG transparent)

cellarius 04-26-2009 07:07 AM

Whereas the Code in the Firstpost worked in all browsers but IE, the code by GeoMapia does not work for me at all.

spillage 05-16-2009 08:16 PM

Are there any more revisions to this code?

I'm trying to get it to work on vB3.8, with little success.

I've tried each of the code examples and fixes posted here, and the best I get is for it to work in the BBCode test screen, but not in an actual post.

I noted that when I go back in to BBCode Manager to edit it, the "Example" code is cropped short of the full code originally pasted in that field, hence I never have a working example.

Any thoughts would be greatly appreciated.

THANK!

Sunka 05-16-2009 11:32 PM

This is work for me in vBulletin v3.8.2

Code:

<script type="text/javascript">
function checkURL()
  {
      if ((url.indexOf("http://")!=url.lastIndexOf("http://"))||url.lastIndexOf("http://")!=0){return false;}
      if (url.indexOf('&quot')>=0) {return false;}
      if (url.indexOf("http://maps.google")!=0){return false;}
      return true
  }

tot='{param}';
tot=tot.substr(tot.indexOf("src=&quot;")+10,tot.length);
url=tot.substr(0,tot.indexOf("&quot;"));
urlp=url.replace(/;amp;/g,';');
url=urlp;

if (checkURL())

    document.write('<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+url+'"></iframe>');
}
else
{
document.write("<p><b>Wrong map URL, edit the post to change it.</b></p>Reload the page when finished to check if correct.");
}
</script>


spillage 05-17-2009 01:14 PM

Thanks Sunka, that seems to initially work in the Test your BBCode area, but in an actual post I get the "Wrong map URL, edit the post to change it. Reload the page when finished to check if correct." error message.

On return to the BBCode Manager, and trying the Test your BBCode again, I also get the error there as well.

This is the sample map code used in all instances;
Code:

[gmap]<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&amp;ll=2..."></iframe><br /><small><a href="http://maps.google.com/?ie=UTF8&amp;ll=2...p;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>[/gmap]
Also in the BBCode Manager window, the "Example" field doesn't work, as the code above gets trimmed when saved... and looks like this;
Code:

[gmap]<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="[URL]http://maps.google.com/?ie=UTF8&amp;ll=26.468114,-80.065699&amp;spn=0.024625,0.028195&a
Any further thoughts?

Sunka 05-18-2009 06:48 AM

Hmmm.
On Google Maps, you choose LINK and then copy Paste HTML to embed in website
This is code for Zagreb on Google maps:

Code:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&amp;ll=45.786679,15.930176&amp;spn=0.387841,0.839081&amp;t=h&amp;z=10&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/?ie=UTF8&amp;ll=45.786679,15.930176&amp;spn=0.387841,0.839081&amp;t=h&amp;z=10&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>

If this code I use on my forum with [ gmap ] [ /gmap ] all is OK

Sportsriders 06-05-2009 05:44 PM

I found the IE issue is related to this

{ document.write('<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+u+'"></iframe>');}

with this you can see the map but it messes with the php


{ document.write('<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+u+'"</iframe>');}

So it is a formatting in the above line in BOLD that is causing the IE issues. Not yet worked out what is the actual issue.

ricardoNJ 06-07-2009 12:04 AM

Thanks a lot!!!!

Sportsriders 06-07-2009 03:07 PM

Some more information

Internet Explored adds [URL] tags to the Google code and this causes the map not to
show. You see
"Wrong map URL, edit the post to change it. Reload the page when finished to check if correct."

You need to edit the [URL] tags out. Firefox and Chrome do not add these tags when
posting the Google code.

Sportsriders 06-07-2009 03:32 PM

And more..................

If you can see WHITE where the map should be in IE, then Refreshing the page with the <REFRESH>
button will not cause the map to show. HOWEVER right clicking on where the map should be and selecting
REFRESH will cause the map to show.

I noticed that IE will show the map only the first time the page with the map is accessed. After that it will
not load the map the next time the page is loaded ( unless you use the above mentioned refresh ).

Sportsriders 06-07-2009 03:48 PM

I wonder is someone with code experience could modify the script to detect if IE is the
browser and if so detected, refresh the frame twice and also remove any URL /URL
tags from betten the GAMP /GMAP tags.

Sportsriders 06-07-2009 03:53 PM

Quote:

Originally Posted by Sunka (Post 1812151)
This is work for me in vBulletin v3.8.2

Code:

<script type="text/javascript">
function checkURL()
  {
      if ((url.indexOf("http://")!=url.lastIndexOf("http://"))||url.lastIndexOf("http://")!=0){return false;}
      if (url.indexOf('&quot')>=0) {return false;}
      if (url.indexOf("http://maps.google")!=0){return false;}
      return true
  }

tot='{param}';
tot=tot.substr(tot.indexOf("src=&quot;")+10,tot.length);
url=tot.substr(0,tot.indexOf("&quot;"));
urlp=url.replace(/;amp;/g,';');
url=urlp;

if (checkURL())

    document.write('<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+url+'"></iframe>');
}
else
{
document.write("<p><b>Wrong map URL, edit the post to change it.</b></p>Reload the page when finished to check if correct.");
}
</script>


This worked for me when I used Firefox to do add the BBcode. But strangely, when I used
IE it did not work.

hytram 06-08-2009 08:10 AM

thanks for great Mod..

It been working fine for a few weeks and today we have hit a glitch, I think its always been there but only showed up today

until now all [gmap] code has been in threads started by one of 2 Admins, members have replied with maps and they have showed up with no problems. Today a supermod posted a map in his own thread and it errored and didnt show up, Even if an Admin post a [gmap] in that thread it wouldnt show up. Cut and paste the same code into a Admin started thread, it works fine

doing the research on my forum, Admins have HTML turned on, no one else does, I dont want to turn it on if I can help it.

will turning HTML on for everyone but turn HTML code of be safe?

I will do some more testing, but I wont be near a puter for the next 24hr

any thoughts or ideas?

ta

Marty

Sportsriders 06-09-2009 12:29 AM

Quote:

Originally Posted by hytram (Post 1825513)
thanks for great Mod..

until now all [gmap] code has been in threads started by one of 2 Admins, members have replied with maps and they have showed up with no problems. Today a supermod posted a map in his own thread and it errored and didnt show up, Even if an Admin post a [gmap] in that thread it wouldnt show up. Cut and paste the same code into a Admin started thread, it works fine

doing the research on my forum, Admins have HTML turned on, no one else does, I dont want to turn it on if I can help it.

will turning HTML on for everyone but turn HTML code of be safe?

I will do some more testing, but I wont be near a puter for the next 24hr

any thoughts or ideas?

ta

Marty

Every thing I have read suggests keep HTML turned off for the forums. I am admin on
my forum and I do not have HTML turned on and my users can post maps.

You should post up the error message.

hytram 06-09-2009 11:28 AM

there is no error message, just nothing..blank


All times are GMT. The time now is 04:18 AM.

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.01483 seconds
  • Memory Usage 1,854KB
  • 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
  • (11)bbcode_code_printable
  • (1)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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