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)

Nadeemjp 10-30-2008 06:25 AM

Quote:

Originally Posted by MrEyes (Post 1648458)
I have been running this mod for a few days and not found any of the issues that other people are describing. So here is some information that may or may not help other mod users:

1) The Google Maps API key is irrelevant to this mod and is a red herring
2) You have to get the code to embed from:

http://maps.google.com

Looking at the bbcode it seems that other Google domains (i.e. .es may work but I have not try this)

3) For my users I have created an FAQ that details exactly how to use the mod, see here for that:

http://www.therevcounter.com/faq/241...ads-posts.html

4) This is how I have the bbcode configured:

Title:
Google Map

BB Code Tag Name:
gmap

Replacement 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>

Example
[gmap]iframe code[/gmap]

Description:
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][/gmap]

Use {option}:
No

Button Image (Optional)
I didn't define one, you can if you want

Remove Tag If Empty
Disable BB Code Within This BB Code
Disable Smilies Within This BB Code
Disable Word Wrapping Within This BB Code

All yes

itried the above mentioned and i got the following error!

Quote:

Wrong map URL, edit the post to change it.

Reload the page when finished to check if correct.
any clues?

oasi 10-30-2008 12:59 PM

Ooooohhh!!

Finally I've been able to reproduce this!!
I'm using the advanced Browser Firefox, so despite of using the WYSIWYG editor I wasn't having this problem...

Now I've been testing and I'm have a solution, I have to do some more testing, but tomorrow I'll post the new version.

Thanks all for your patience :D

Leo Brazil 10-30-2008 02:29 PM

That's correct oasi, my bad in not informing you about it. But it only happens if you're using IE.

Not at all, thank you for your patience and support.

cvn 10-31-2008 01:58 AM

@oasi : take your time, we can wait! :)

Thanks so much!

Nadeemjp 10-31-2008 04:46 AM

i seee........ok oasi hope you can fix it:) waiting for your updated xml file:)

oasi 10-31-2008 07:56 AM

Ok, I upgraded the code (first post on each page).
Please, test it and tell me if it works now...

I've tested on Explorer and Firefox and seems to run for me...

Please, mark as installed if you use it...

cvn 10-31-2008 12:23 PM

It still does not work with my board :(

The maps link:
PHP Code:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=Singapore&amp;sll=40.446947,-86.923828&amp;sspn=0.040497,0.090723&amp;ie=UTF8&amp;ll=1.352083,103.819836&amp;spn=0.0532,0.090723&amp;z=14&amp;output=embed&amp;s=AARTsJqkLJNXPDqzeV-2S6QWBWQf58w4dg"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=Singapore&amp;sll=40.446947,-86.923828&amp;sspn=0.040497,0.090723&amp;ie=UTF8&amp;ll=1.352083,103.819836&amp;spn=0.0532,0.090723&amp;z=14&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small

And the page source code:
PHP Code:

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

t='';incr=0;t_i="<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=Singapore&amp;sll=40.446947,-86.923828&amp;sspn=0.040497,0.090723&amp;ie=UTF8&amp;ll=1.352083,103.819836&amp;spn=0.0532,0.090723&amp;z=14&amp;output=embed&amp;s=AARTsJqkLJNXPDqzeV-2S6QWBWQf58w4dg"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=Singapore&amp;sll=40.446947,-86.923828&amp;sspn=0.040497,0.090723&amp;ie=UTF8&amp;ll=1.352083,103.819836&amp;spn=0.0532,0.090723&amp;z=14&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>";
t_n_q=t_i.replace(/&quot;/g,'"');

if(
t_n_q.indexOf("91;url")>0)
{ if(
t_n_q.indexOf('91;url="')>0){t=t_n_q.substr(t_n_q.indexOf('91;url="')+8,t_n_q.length);t_n_q='';}
  if(
t_n_q.indexOf('91;url=')>0) {t=t_n_q.substr(t_n_q.indexOf('91;url=')+7,t_n_q.length);t_n_q='';a=t.replace(/93;/g,'"');t=a;incr=2;}
  if(
t_n_q.indexOf('91;url')>0)  {if (t_n_q.indexOf('93;')==(t_n_q.indexOf('91;url')+8)){t=t_n_q.substr(t_n_q.indexOf('91;url')+11,t_n_q.length);a=t.replace(/91;/g,'"');t=a;}}
}
else
t=t_n_q.substr(t_n_q.indexOf('src="')+5,t_n_q.length);}
u=t.substr(0,t.indexOf('"')-incr);
up=u.replace(/amp;/g,'');u=up;

if (
ckURL())
document.write('<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+u+'"></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

Please help us look into it to see what's possibly wrong.

Thankssss!

oasi 10-31-2008 12:43 PM

I don't know why your gmap pasted code isn't chaged to html chars...

" should be &quot;
< 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...

cvn 10-31-2008 01:03 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 &quot;
< 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...

Oh, I tried with what you suggested and it works now.

So at least it works for my system. But as your concern, it might not be stable. Please help me to find what could be the reason that let my system not identical with yours.

Thanks so much!

Leo Brazil 11-03-2008 10:58 AM

It' works great for me now !!

Thank you oasi, MOTM for sure.


All times are GMT. The time now is 09:30 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.01484 seconds
  • Memory Usage 1,781KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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