Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Google maps BBCode Details »»
Google maps BBCode
Version: 1.1, by oasi oasi is offline
Developer Last Online: Dec 2008 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 3.7.x Rating:
Released: 10-15-2008 Last Update: Never Installs: 86
Re-useable Code Translations Is in Beta Stage  
No support by the author.

Hi all

I've made a Custom BBcode to be able to insert any kind of google map into the forum posts, so the Plugins I tried were'nt working as we expected.

I post the code, I hope it can be useful for anyone.

Security problems, improvements and tunning will be apreciated...

I used the tag [gmap], and inside you have to copy the code for the HTML inclusion you can copy when you click the link icon in the map:



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="{param}";
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>
The others settings for the BBCode are:

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

Please, mark as installed if it worked and you are using it.

Hope it helps!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #132  
Old 01-19-2010, 01:47 PM
Feign Feign is offline
 
Join Date: Jul 2008
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wasn't working in 3.8.4 after a recent update.

Re-added the code and it's great now.
Reply With Quote
  #133  
Old 02-12-2010, 08:58 AM
V8Owner V8Owner is offline
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have installed and tested this in VB4 & it works fine
Reply With Quote
  #134  
Old 10-05-2010, 03:02 PM
CThiessen CThiessen is offline
 
Join Date: May 2007
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,
works fine with vB4 but not with vB4 and vBSEO 3.5.2

Change:
Code:
<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+u+'"></iframe>
to
Code:
<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" rel="novbseo" src="'+u+'"></iframe>
and it keeps working.

Greetings
Christian
Reply With Quote
  #135  
Old 10-08-2010, 09:56 AM
tintin74 tintin74 is offline
 
Join Date: Jul 2007
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Goood CThiessen, thank you!
Reply With Quote
  #136  
Old 06-10-2012, 04:12 AM
Sunka Sunka is offline
 
Join Date: Mar 2008
Location: Croatia
Posts: 400
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Google link with https not working.
Anyone know what to change in code so Google link with SSL protocol works too?

Here is example Google link location on Google map with http and with https:


HTTPS
Code:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=45.811572,15.961533&amp;num=1&amp;t=h&amp;ie=UTF8&amp;z=10&amp;ll=45.814912,15.978514&amp;output=embed"></iframe><br /><small><a href="https://maps.google.com/maps?q=45.811572,15.961533&amp;num=1&amp;t=h&amp;ie=UTF8&amp;z=10&amp;ll=45.814912,15.978514&amp;source=embed" style="color:#0000FF;text-align:left">Prikaz veće karte</a></small>


HTTP
Code:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.hr/maps?q=45.554449,16.295471&amp;num=1&amp;t=h&amp;hl=hr&amp;ie=UTF8&amp;z=10&amp;ll=45.411948,16.408081&amp;output=embed"></iframe><br /><small><a href="http://maps.google.hr/maps?q=45.554449,16.295471&amp;num=1&amp;t=h&amp;hl=hr&amp;ie=UTF8&amp;z=10&amp;ll=45.411948,16.408081&amp;source=embed" style="color:#0000FF;text-align:left">Prikaz veće karte</a></small>
Reply With Quote
  #137  
Old 06-24-2012, 11:38 AM
Panosz Panosz is offline
 
Join Date: May 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems like something changed from the Google side of things and the map doesnt work anymore.

The old links (already posted ones) still works fine but if i request a new link from Google , it won't work.
Reply With Quote
  #138  
Old 07-04-2012, 11:23 AM
Mellow's Avatar
Mellow Mellow is offline
 
Join Date: Nov 2003
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have to edit the link from:
[Gmap]<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f

to

[Gmap]<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f

and it will work, not sure what changes the BB code needs to work.
Reply With Quote
  #139  
Old 07-04-2012, 02:06 PM
Mellow's Avatar
Mellow Mellow is offline
 
Join Date: Nov 2003
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried messing with the javascript but I'm far from an expert and didn't understand what some of it was doing. Someone w/more experience should be able to fix this for the current way Google is doing this and maybe even add an OR to support the previous way it was done.
Reply With Quote
  #140  
Old 07-04-2012, 02:20 PM
Mellow's Avatar
Mellow Mellow is offline
 
Join Date: Nov 2003
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simply removing the 1st 's' from the 1st 'https' will allow the script to work albeit not the best looking code. I just don't know how to do that so any help is appreciated.
Reply With Quote
Благодарность от:
Sunka
  #141  
Old 07-07-2012, 10:13 AM
Sunka Sunka is offline
 
Join Date: Mar 2008
Location: Croatia
Posts: 400
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, that is only temporary solution.
I put this problem on my forum if some user have skill in Javascript coding to find solution that code works with http and https protocol.

Any help here is welcome.
Reply With Quote
Reply


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 12:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12464 seconds
  • Memory Usage 2,314KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete