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 10-21-2008 05:00 PM

Quote:

Originally Posted by HCGB (Post 1649791)
Yes, it is set up absolutely correctly. I have discovered some stuff that might shed light on my (and other's) problems:

The "Automatically parse links in text" option ALWAYS screws up the HTML code on the map page whenever the post edit box is loaded (it's too late even if you turn it off before saving the edit). You can either disable the function in the Vb Admin (not very convenient for users) or re-paste the Google map code into a post during editing.

If I use your code exactly as is it returns "Wrong Map URL..." every time. I've placed the code on a this page with the correct Google map code so you can view and debug the source (it doesn't seem to recognise the first search string?). Out of desperation, I modified the code to simplify it and tested it on this other page with exactly the same Google code and it seems to work OK (I've removed a couple of tests and avoided using ") It's probably full of security holes as I'm no programmer :)

I've mentioned this on last page.

Quote:

Originally Posted by Leo Brazil (Post 1648854)
Just one small thing, does someone here knows an instrution to include on the code to remove the hyperlinks from Google Maps before the gmap instruction ?

I'll tell you why, on my board I have to use "parse links automaticaly" so when I past the Google Map link it comes with the links and if I use it with the link parsed the BB Code doesn't work, so I have to remove the hyperlink manually. As most my users are hard to teach this sequence I was wondering about this solution to be inside of gmap BBCode it self.

No idea so far. But I'm sure there must to be a way to include a string just at the beginning of this BBCode to unparse the links. I'm just trying to figure out each one. :confused:

mycitylive 10-22-2008 04:28 AM

Hallo please Help me i habe problem the google map

Error Message:

Wrong map URL, edit the post to change it.

Reload the page when finished to check if correct.

MrEyes 10-22-2008 08:33 AM

I have found another quirk that your users need to be aware of....

If they are using the enhanced WYSIWYG post editor this will automatically parse the links in the Google iframe code to include [noparse][URL][/URL][noparse] tags, this breaks the bbcode.

They need to change to the standard editor

mycitylive 10-22-2008 09:37 AM

Unfortunately I do not understand exactly what you mean because I can not so good English would be better for me, you can deuzsch Maybe it somewhat easier to explain.

Would be great thank you

Leo Brazil 10-22-2008 12:57 PM

[QUOTE=MrEyes;1650263]I have found another quirk that your users need to be aware of....

If they are using the enhanced WYSIWYG post editor this will automatically parse the links in the Google iframe code to include [noparse][URL][/URL][noparse] tags, this breaks the bbcode.

They need to change to the standard editor[/QUOTE]

This is exactly what I tried to describe. The point is using the standar editor really sucks and switching from standard do enhanced WYSIWYG also. The only "solution" I've found at this moment is never use quick reply editor, always Go Advanced, past Google link, select it all, click on Remove Links and after that use Google Maps BBcode.

If we had a string before this BBcode to remove the links from it would solve this issue at all.

HCGB 10-22-2008 02:10 PM

Quote:

Originally Posted by Leo Brazil (Post 1650416)
This is exactly what I tried to describe. The point is using the standar editor really sucks and switching from standard do enhanced WYSIWYG also. The only "solution" I've found at this moment is never use quick reply editor, always Go Advanced, past Google link, select it all, click on Remove Links and after that use Google Maps BBcode.

If we had a string before this BBcode to remove the links from it would solve this issue at all.

Vb doesn't just add [url .. etc to the map code, it also re-arranges the parameters inside the <iframe..> block. I'm afraid I've had to give up on this one unless someone knows how to fix it - disabling the WYSIWYG editor or the automatic link parsing isn't an option for our users

Leo Brazil 10-22-2008 03:23 PM

Quote:

Originally Posted by HCGB (Post 1650457)
Vb doesn't just add [url .. etc to the map code, it also re-arranges the parameters inside the <iframe..> block. I'm afraid I've had to give up on this one unless someone knows how to fix it - disabling the WYSIWYG editor or the automatic link parsing isn't an option for our users

That's correct. The editor parses [B] [U] [COLOR] and [URL] in case of Google maps links.

I've been playing here with intructions like stripe_tags and urlrx but I'm not a coder but I'm sure it can be possible. I'm sure someone here will come up with something for this.

mycitylive 10-23-2008 06:32 AM

None has a solution for the problem?

Because one knows another similar addon BBCode?

About an answer I would be very happy!
Thank you in advance for the sometimes painful.

oasi 10-24-2008 06:33 AM

I'm going to test it when I have a time slot...
I'll try to fix it, it seems possible...

Thanks all for testing

Leo Brazil 10-24-2008 11:28 AM

Quote:

Originally Posted by oasi (Post 1651633)
I'm going to test it when I have a time slot...
I'll try to fix it, it seems possible...

Thanks all for testing

Thanks oasi for that. My comments here were given just with good intetions to improve this BBCode. I've been looking for this for so long and never found a easy and good solution as this one. Like I told before with this fix will be one of the best BBCodes ever publish here and will be MOTM for sure. :up:

oasi 10-24-2008 11:45 AM

I'm not been able to reproduce the link stuff you mentioned, but This version could solve this stuff and the related with the &amp;

Please, try it and let me know...

Code:

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

tot='';
tot_ini='{param}';
tot_no_amp=tot_ini.replace(/&amp;/g,'&');
tot_no_quo=tot_no_amp.replace(/&quot;/g,'"');
tot=tot_no_quo.substr(tot_no_quo.indexOf('marginwidth="0" src="')+21,tot_no_quo.length);
url=tot.substr(0,tot.indexOf('"'));
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 URL</b></p>Recorda que cal enganxar el contingut del camp que indica que es per enganxar en una web.<br />Un cop arreglat el post, has de recarregar la plana per poder veure si ha funcionat.");
}
</script>

If this fails, and the error message appears, please view source on the document and paste here the value for the variable tot_ini ( Right click on document, View source, search tot_ini)

Thanks

Leo Brazil 10-24-2008 05:42 PM

Hi oasi,

Nothing changed so far, let's see.

This is the link I'm using for tests already with gmap tags

[gmap]<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhm P4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iw loc=addr&amp;output=embed&amp;s=AARTsJrSb_gFa1Ssu_ 1wwOFTDbl5gJKezg"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhm P4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iw loc=addr&amp;source=embed" style="color:#0000FF;text-align:left">Exibir mapa ampliado</a></small>[/gmap]


And this is the source code of my page after I post it.


Code:

                <!-- message -->
                <div id="post_message_26"><font face="Arial"><font size="2"><script type="text/javascript">
function checkURL()
  {
      if ((url.indexOf("http://")!=url.lastIndexOf("http://"))||url.lastIndexOf("http://")!=0){return false;}
      if (url.indexOf('"')>=0) {return false;}
      if (url.indexOf("http://maps.google")!=0){return false;}
      return true
  }

tot='';
tot_ini='&lt;iframe width=&quot;425&quot; height=&quot;350&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;[url=&quot;http://maps.google.com/maps?f=q&amp;amp;hl=pt-BR&amp;amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;amp;ie=UTF8&amp;amp;cd=1&amp;amp;geocode=FdJhmP4de304_Q&amp;amp;ll=-23.558323,-46.62529&amp;amp;spn=0.036583,0.054932&amp;amp;z=14&amp;amp;iwloc=addr&amp;amp;output=embed&amp;amp;s=AARTsJrSb_gFa1Ssu_1wwOFTDbl5gJKezg&quot;&gt;&lt;/iframe&gt;&lt;br&quot;][color=#0000ff]http://maps.google.com/maps?f=q&amp;amp;hl=pt-BR&amp;amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;amp;ie=UTF8&amp;amp;cd=1&amp;amp;geocode=FdJhmP4de304_Q&amp;amp;ll=-23.558323,-46.62529&amp;amp;spn=0.036583,0.054932&amp;amp;z=14&amp;amp;iwloc=addr&amp;amp;output=embed&amp;amp;s=AARTsJrSb_gFa1Ssu_1wwOFTDbl5gJKezg&quot;&gt;&lt;/iframe&gt;&lt;br[/color][/url] /&gt;&lt;small&gt;&lt;a href=&quot;[url=&quot;http://maps.google.com/maps?f=q&amp;amp;hl=pt-BR&amp;amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;amp;ie=UTF8&amp;amp;cd=1&amp;amp;geocode=FdJhmP4de304_Q&amp;amp;ll=-23.558323,-46.62529&amp;amp;spn=0.036583,0.054932&amp;amp;z=14&amp;amp;iwloc=addr&amp;amp;source=embed&quot;][color=#0000ff]http://maps.google.com/maps?f=q&amp;amp;hl=pt-BR&amp;amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;amp;ie=UTF8&amp;amp;cd=1&amp;amp;geocode=FdJhmP4de304_Q&amp;amp;ll=-23.558323,-46.62529&amp;amp;spn=0.036583,0.054932&amp;amp;z=14&amp;amp;iwloc=addr&amp;amp;source=embed[/color][/url]&quot; style=&quot;color:#0000FF;text-align:left&quot;&gt;Exibir mapa ampliado&lt;/a&gt;&lt;/small&gt;';
tot_no_amp=tot_ini.replace(/&amp;/g,'&amp;');
tot_no_quo=tot_no_amp.replace(/&quot;/g,'"');
tot=tot_no_quo.substr(tot_no_quo.indexOf('marginwidth="0" src="')+21,tot_no_quo.length);
url=tot.substr(0,tot.indexOf('"'));
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 URL</b></p>Recorda que cal enganxar el contingut del camp que indica que es per enganxar en una web.<br />Un cop arreglat el post, has de recarregar la plana per poder veure si ha funcionat.");
}
</script></font></font></div>
                <!-- / message -->

The problem is I must use WYSIWYG editor on my board and when I paste the Google Maps links the editor parses a lot of thing with braking the pure link itself.

MediaHound 10-24-2008 07:17 PM

Subscribing to thread, this is a wonderful hack, hope the "Wrong map URL, edit the post to change it." errors get fixed as that's a problem for me as well.

tintin74 10-24-2008 08:14 PM

First of all a big thank you to Oasi for studing on this very useful mod. I'm search for it for a long time!

I've tried to embed several Google maps without any problem but now I want to embed this kind of map , but I've had negative result.

This is the web page from where I have take the iframe link:

Code:

http://maps.google.com/maps?f=d&saddr=Bagolino+BS&daddr=darfo+boario+to:endine+to:Frazione+Rigosa%2FSP28+to:san+pellegrino+terme+to:sant%27omobono+imagna+to:valcava+to:Como+CO&hl=it&geocode=%3B%3B%3BFR7ougId7q6UAA%3B%3B%3B%3B&mra=ls&via=3&sll=45.702343,9.813538&sspn=0.895773,1.757813&ie=UTF8&ll=45.844108,9.775085&spn=0.893499,1.757813&t=p&z=9
As you could see, it doesn't work.

Could you solve also this issue, please?

Thank you

Regards

Tintin

oasi 10-27-2008 07:02 AM

Ok, now I see the error :D

Please, test this code (this is going to fix the tintin74 problem too) and tell if it works to upgrade the "release"

The damn code BBCode don't seems to work... :mad:

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

tot='';
tot_ini="{param}";
tot_no_quo=tot_ini.replace(/&quot;/g,'"');
if(tot_no_quo.indexOf("[url=")>0)
{ tot=tot_no_quo.substr(tot_no_quo.indexOf('[url="')+6,tot_no_quo.length);}
else
{ tot=tot_no_quo.substr(tot_no_quo.indexOf('src="')+ 5,tot_no_quo.length);}
url=tot.substr(0,tot.indexOf('"'));
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>

tintin74 10-27-2008 07:22 AM

Yeeeeessss! Thank you very much , Oasi!

segwayon 10-27-2008 08:37 AM

Quote:

Originally Posted by oasi (Post 1653576)
Ok, now I see the error :D

Please, test this code (this is going to fix the tintin74 problem too) and tell if it works to upgrade the "release"

The damn code BBCode don't seems to work... :mad:

I get the "Wrong map URL, edit the post to change it." message with the 1.0 script, and nothing gets rendered with this one.

oasi 10-27-2008 08:50 AM

Please, could you paste the generated code for your page, as LeoBrazil did, or paste an example URL?

If I can see the value for the tot_ini variable I would be able to figure what's wrong...

Leo Brazil 10-27-2008 10:26 AM

With the new code I've got double error messages.

Here is what I've got from the source code. I'm still using the same link from Google maps for tests.

[CODE] <!-- message -->
<div id="post_message_27"><font face="Arial"><script type="text/javascript">
function checkURL()
{
if ((url.indexOf("http://")!=url.lastIndexOf("http://"))||url.lastIndexOf("http://")!=0){return false;}
if (url.indexOf('"')>=0) {return false;}
if (url.indexOf("http://maps.google")!=0){return false;}
return true
}

tot='';
tot_ini="&lt;iframe width=&quot;425&quot; height=&quot;350&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;";
tot_no_quo=tot_ini.replace(/&quot;/g,'"');
if(tot_no_quo.indexOf("http://maps.google.com/maps?f=q&amp;amp;hl=pt-BR&amp;amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;amp;ie=UTF8&amp;amp;cd=1&amp;amp;g eocode=FdJhmP4de304_Q&amp;amp; ll=-23.558323,-46.62529&amp;amp;spn=0.036583,0.054932&amp;amp;z=1 4&amp;amp;iwloc=addr&amp;amp;o utput=embed&amp;amp;s=AARTsJrSb_gFa1Ssu_1wwOFTDbl5 gJKezg&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a href=&quot;http://maps.google.com/maps?f=q&amp;amp;hl=pt-BR&amp;amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;amp;ie=UTF8&amp;amp;cd=1&amp;amp;g eocode=FdJhmP4de304_Q&amp;amp; ll=-23.558323,-46.62529&amp;amp;spn=0.036583,0.054932&amp;amp;z=1 4&amp;amp;iwloc=addr&amp;amp;s ource=embed&quot; style=&quot;color:#0000FF;text-align:left&quot;&gt;Exibir mapa ampliado&lt;/a&gt;&lt;/small&gt;";
tot_no_quo=tot_ini.replace(/&quot;/g,'"');
if(tot_no_quo.indexOf("[url=")>0)
{ tot=tot_no_quo.substr(tot_no_quo.indexOf('[url="')+6,tot_no_quo.length);}
else
{ tot=tot_no_quo.substr(tot_no_quo.indexOf('src="')+ 5,tot_no_quo.length);}
url=tot.substr(0,tot.indexOf('"'));
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>Endereço errado do Mapa, edite seu post para alterá-lo.</b></p>Recarregue a página quando verificar que está correto.");
}
</script></div>
<!-- / message -->[/CODE]

oasi 10-27-2008 10:54 AM

Leo

You have to set the option "Disable BB Code Within This BB Code" to yes when you add the gmap code...

I think the problem is that gmap takes as parameter {param} all the content you put between [gmap] and [/gmap], but if the url BBcode is also between [gmap] and [/gmap] other different {param} value is appeared and the gmap addon can't catch the value for the iframe, and the content appears 2 times, but without a valid value.

There is no workaround with this I fear ...

Despite of this, in my forums I use the WYSIWYG editor and I'm not having all these weird problems, I don't figure how this is happening if you verified those values

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

Leo Brazil 10-28-2008 12:21 PM

Quote:

Originally Posted by oasi (Post 1653675)
Leo

You have to set the option "Disable BB Code Within This BB Code" to yes when you add the gmap code...

100% sure this is correct and I'm using this in my test forum without plugins installed.


Quote:

Originally Posted by oasi (Post 1653675)
I think the problem is that gmap takes as parameter {param} all the content you put between [gmap] and [/gmap], but if the url BBcode is also between [gmap] and [/gmap] other different {param} value is appeared and the gmap addon can't catch the value for the iframe, and the content appears 2 times, but without a valid value.

If try to post the Google link directly it gaves me an error, if I edit the post I can see what happens with the link. All tags were included in it as below. I wrapped with HTML tags otherwise the editor would parse the link and you woundn't get what really happens. Check the tags that appears on the Google Link.

HTML Code:

[gmap]<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="[/gmap][gmap][url="http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iwloc=addr&amp;output=embed&amp;s=AARTsJrSb_gFa1Ssu_1wwOFTDbl5gJKezg"></iframe><br"][font=Arial][color=#0000ff]http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iwloc=addr&amp;output=embed&amp;s=AARTsJrSb_gFa1Ssu_1wwOFTDbl5gJKezg"></iframe><br[/color][/font][/url][font=Arial] /><small><a href="[/font][url="http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iwloc=addr&amp;source=embed"][font=Arial][color=#0000ff]http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iwloc=addr&amp;source=embed[/color][/font][/url][font=Arial]" style="color:#0000FF;text-align:left">Exibir mapa ampliado</a></small>[/font][/gmap]

Quote:

Originally Posted by oasi (Post 1653675)
Despite of this, in my forums I use the WYSIWYG editor and I'm not having all these weird problems, I don't figure how this is happening if you verified those values

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

That's exactly what I have here since the beginning.

I tought with Disable BB Code Within This BB Code -> Yes - I would never had what I'm getting on the example I gave above. You can still see com BB Codes on it. Weird huh ?

oasi 10-28-2008 01:00 PM

And these BBcode tags are added automatically??

HTML Code:

src="[/gmap][gmap]
Tomorrow I'll try to solve it. The solution is going to add extra+unuseful code to the html, but I think it can work...

Leo Brazil 10-28-2008 02:25 PM

Yes, did you notice those in the middle, right ?

They were placed there buy the editor automaticaly, just after I clicked preveiw post.

Weird ? Yes, but I found why. The link I'm using as an example I placed on Microsoft Word File because I use to keep a file on WORD of all mods I like and use just to make my life easier to organize and for upgrades, check diferences. Same as I did with yours, visually nothing chances but I think WORD uses weird HTML or something the scroll this up. I did that as I was using exactly the same link for several tests it's faster than going to Google and check for the same link all the time, you know.

But now I just copy/paste directly from Google and this was what I've got:

HTML Code:

[gmap]<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="[url]http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;sll=37.0625,-95.677068&amp;sspn=32.38984,56.25&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;g=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;iwloc=addr&amp;output=embed&amp;s=AARTsJpM49-sTq_lIb07cjYCRnPUSvYXwA"></iframe><br[/url] /><small><a href="[url]http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;sll=37.0625,-95.677068&amp;sspn=32.38984,56.25&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;g=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;iwloc=addr&amp;source=embed[/url]" style="color:#0000FF;text-align:left">Exibir mapa ampliado</a></small>[/gmap]
You'll see those between the link were gone but a lot of tags still remains the same and conparing the raw link with the this one those tags are causing this errors.

Sorry bugging you around with all those long posts I'm just trying to be usefull.

oasi 10-29-2008 07:18 AM

Ok,

I think this has to work...

Code:

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

tot='';
tot_ini="{param}";
tot_no_quo=tot_ini.replace(/&quot;/g,'"');
if(tot_no_quo.indexOf("[url")>0)
{ //The URL affaire...
  if(tot_no_quo.indexOf('[url="')>0) {tot=tot_no_quo.substr(tot_no_quo.indexOf('[url="')+6,tot_no_quo.length);tot_no_quo='';}
  if(tot_no_quo.indexOf('[url=')>0)  {tot=tot_no_quo.substr(tot_no_quo.indexOf('[url=')+5,tot_no_quo.length);tot_no_quo='';a=tot.replace(/\]/g,'"');tot=a;}
  if(tot_no_quo.indexOf('[url]')>0)  {tot=tot_no_quo.substr(tot_no_quo.indexOf('[url]')+5,tot_no_quo.length);a=tot.replace(/\[/g,'"');tot=a;}
}
else
{ tot=tot_no_quo.substr(tot_no_quo.indexOf('src="')+5,tot_no_quo.length);}
url=tot.substr(0,tot.indexOf('"'));
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>La URL que has passat per al mapa contenia errors, edita el post per arreglar-ho</b></p>Recorda que cal enganxar el contingut del camp que indica que es per enganxar en una web.<br />Un cop arreglat el post, has de recarregar la plana per poder veure si ha funcionat.");
}
</script>


cvn 10-29-2008 07:58 AM

Now I don't see the "wrong URL" error but see nothing displays. Nothing, no map nor error message.

oasi 10-29-2008 10:03 AM

Please, paste your tot_ini value here (view source for the page)...

cvn 10-29-2008 02:06 PM

Certainly!

Here is the code I used with [GMAP] tag:
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=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iwloc=addr&amp;output=embed&amp; s=AARTsJrSb_gFa1Ssu_1wwOFTDbl5gJKezg"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;hl=pt-BR&amp;q=Liberdade,+S%C3%A3o+Paulo+-+SP,+Brasil&amp;ie=UTF8&amp;cd=1&amp;geocode=FdJhmP4de304_Q&amp;ll=-23.558323,-46.62529&amp;spn=0.036583,0.054932&amp;z=14&amp;iwloc=addr&amp;source=embed" style="color:#0000FF;text-align:left">Exibir mapa ampliado</a></small

And here the source code of my page after posted:

PHP Code:

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

tot='';
tot_ini="<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&amp;ll=40.84706,-98.448486&amp;spn=2.576261,5.806274&amp;z=8&amp;output=embed&amp;s=AARTsJqzARj-Z8VnW5pkPMLMmZbqrJcYpw"></iframe><br /><small><a href="http://maps.google.com/?ie=UTF8&amp;ll=40.84706,-98.448486&amp;spn=2.576261,5.806274&amp;z=8&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>";
tot_no_quo=tot_ini.replace(/&quot;/g,'"');
if(
tot_no_quo.indexOf("[url")>0)
//The URL affaire...
  
if(tot_no_quo.indexOf('[url="')>0) {tot=tot_no_quo.substr(tot_no_quo.indexOf('[url="')+6,tot_no_quo.length);tot_no_quo='';}
  if(
tot_no_quo.indexOf('[url=')>0)  {tot=tot_no_quo.substr(tot_no_quo.indexOf('[url=')+5,tot_no_quo.length);tot_no_quo='';a=tot.replace(/\]/g,'"');tot=a;}
  if(
tot_no_quo.indexOf('[url]')>0)  {tot=tot_no_quo.substr(tot_no_quo.indexOf('[url]')+5,tot_no_quo.length);a=tot.replace(/\[/g,'"');tot=a;}
}
else
tot=tot_no_quo.substr(tot_no_quo.indexOf('src="')+5,tot_no_quo.length);}
url=tot.substr(0,tot.indexOf('"'));
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>La URL que has passat per al mapa contenia errors, edita el post per arreglar-ho</b></p>Recorda que cal enganxar el contingut del camp que indica que es per enganxar en una web.<br />Un cop arreglat el post, has de recarregar la plana per poder veure si ha funcionat.");
}
</
script


FReeSTER 10-29-2008 05:00 PM

Thank you for this BB code. Works great

dreamer81 10-29-2008 07:23 PM

how do I use this? is there installation instructions somewhere?

Leo Brazil 10-29-2008 07:27 PM

Quote:

Originally Posted by oasi (Post 1655108)
Ok,

I think this has to work...

Sorry but don't. I'm still getting the wrong URL and also all my previous posts that were working got the same wrong messages.

But worry, I wrote a very detailed instructions to my members and the first code published here is working fine with them. Just a pain to switch editor mode to do it but it's fine.

Tks.

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 07: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.01822 seconds
  • Memory Usage 1,992KB
  • 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
  • (5)bbcode_code_printable
  • (3)bbcode_html_printable
  • (4)bbcode_php_printable
  • (13)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