vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Guranteed toughest question on here... (https://vborg.vbsupport.ru/showthread.php?t=68577)

Takamine334 08-20-2004 11:37 PM

Guranteed toughest question on here...
 
I bet no one on here can answer this



when I typed this in a forum with HTML enabled:

HTML Code:


<a href="javascript:popUp('http://everydayjones.com/msgboard/calendar.php?do=getinfo&e=1&day=2004-8-12&c=1')">The Swiss Pub</a>



it will output this:

HTML Code:


http://www.everydayjones.com/javascript<b></b>:popUp('http://everydayjones.com/msgboard/calendar.php?do=getinfo&e=2&day=2004-9-30&c=1')

why?

CarCdr 08-21-2004 01:31 AM

The BBCode parser will not allow 'javascript:' in a post. In order to nullify it, it replaces such a reference with 'javascript<b></b>:'.

Before resolving the rest of this interesting transformation, riddle me this: Did you surround the HTML code you said you "typed" with [HTML] tags? What was your exact input? (HTML being allowed in a forum simply means you can use [HTML] tags.)

Also, was the "Automatically parse links in text" on or off when you entered the post?

Takamine334 08-21-2004 01:45 AM

I didn't surround the html with [html ] & [/html] because it would have looked like this in the post:

HTML Code:

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
  <tr>
    <td width="50%"><u><b>Upcoming Shows:</b></u></td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">
    <p align="center">&nbsp;</p>
    </td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">
    <p align="right"><u><span style="FONT-WEIGHT: 700">September</span></u></p>
    </td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">
    <p align="left">Thursday, September 30, 2004</p>
    </td>
    <td width="50%" align="right">
    <a href="javascript:popUp('http://everydayjones.com/msgboard/calendar.php?do=getinfo&e=2&day=2004-9-30&c=1')">
    The Swiss Pub, Tacoma WA</a></td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%"><u><b>Previous Shows:</b></u></td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">
    <p align="right"><u><b>August</b></u></p>
    </td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">Thursday, August 12, 2004</td>
    <td width="50%" align="right">
    <a href="javascript:popUp('http://everydayjones.com/msgboard/calendar.php?do=getinfo&e=1&day=2004-8-12&c=1')">
    The Swiss Pub, Tacoma WA</a></td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">
    <p align="right"><u><b>July</b></u></p>
    </td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
  <tr>
    <td width="50%">Saturday, July 10, 2004</td>
    <td width="50%" align="right">
    <p align="right">
    <a href="javascript:popUp('http://everydayjones.com/msgboard/calendar.php?do=getinfo&e=3&day=2004-7-10')">
    The Unicorn Tavern, Ruston WA</a></p>
    </td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%" align="right">&nbsp;</td>
  </tr>
</table>

and above is the exact text I put into the thread.

"Automatically parse links in text" was checked, but I have unchecked it and it still gives me the same 'javascript<b></b>:' output.

www.everydayjones.com

CarCdr 08-21-2004 01:47 AM

Well, I solved half your problem -- the 'javascript:' part.

The other half of the problem, the adding of your board URL to the front is being done by your browser. If you look at the actual page source (the HTML), you will see that the link looks like this:

<a href="javascript<b></b>: popUp('http://everydayjones.com/msgboard/calendar.php?do=getinfo&amp;e=2&amp;day=2004-9-30&amp;c=1')">The Swiss Pub, Tacoma WA</a>

Since it looks like relative link to your browser (i.e., does not start with something like "http://"), it is adding the current page's directory (http://www.everydayjones/com/XXX) in front of it when you click the link.

Takamine334 08-21-2004 01:51 AM

so, there must be a better way of being able to pop up a message when they click on those links. Have any ideas since I can't use 'javascript:' ?

CarCdr 08-21-2004 01:56 AM

Ahhh... now we are moving away from your initial question. :) There are lots of ways to get a new window. The simplest one is to use the attribute:

target="_blank"

in your <A> tag.

BTW, you can use javascript in vB html, just not 'javascript:'.

Takamine334 08-21-2004 01:59 AM

the reason I used the 'javascript:' is because I had this in the headinclude

Code:

<script LANGUAGE="JavaScript">

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=400');");
}
</script>


Takamine334 08-21-2004 02:00 AM

and you would use this for your links:

Code:

<a href="javascript:('http://www.yoursite.com')">Your Site</A>

CarCdr 08-21-2004 02:08 AM

You know, you really should not allow users to enter HTML in posts. It's an open door for a hacker.

You could try onClick. Example:

<A HREF="#" TITLE="Some description"
onClick="popUp(URL)">Swiss Pub</A>

Takamine334 08-21-2004 02:12 AM

I'm the admin and only I can post in those threads. I just use it for updating information that is displayed.


All times are GMT. The time now is 08:12 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.01321 seconds
  • Memory Usage 1,766KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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