vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Existing Topics Check (https://vborg.vbsupport.ru/showthread.php?t=59940)

buro9 02-23-2004 01:32 PM

Quote:

Originally Posted by Boofo
How do we add the trim code to this? ;)

To add trim you'd do something like this:

Code:

function trim(str) {return str.replace(/^\s+/,'').replace(/\s+$/,'');}

function showFind(element) {
  if(trim(element.value) != '') {

And then carry on as before.

As regards your quotes bug, it isn't apparent on my site using Firefox and IE6 to test with.

Boofo 02-23-2004 01:41 PM

I get a line 7 expected ')' error when I use the quotes in a thread title. Isn't there a way to trim any code like that in the trim statement so it only looks for words? ;) I use IE 6, by the way. ;)

buro9 02-23-2004 02:04 PM

Quote:

Originally Posted by Boofo
I get a line 7 expected ')' error when I use the quotes in a thread title. Isn't there a way to trim any code like that in the trim statement so it only looks for words? ;) I use IE 6, by the way. ;)

I have just registered on your site and tested this, and I cannot generate an error.

I believe that the problem lies elsewhere... try CTRL+F5 to refreh your IE cache in case it has old files... and then look at any changes you've made to other JavaScript on the page (such as any hacks you've put into the vb supplied javascript).

I tested with "'` and all worked fine.

Line 7 also suggests something much higher in the file... maybe in one of the included files?

Cheers

David K

Boofo 02-23-2004 02:21 PM

It only seems to happen when you use the quotes with a topic that doesn't exist. It the topic exists (like "testing") then I don't get the error. If I use "killing my chickens", I get the error. Does this make any sense?

buro9 02-23-2004 05:42 PM

Quote:

Originally Posted by Boofo
It only seems to happen when you use the quotes with a topic that doesn't exist. It the topic exists (like "testing") then I don't get the error. If I use "killing my chickens", I get the error. Does this make any sense?

Got it... it's here:

Code:

<script language="javascript">
  window.alert("No matches found for:\n\""killing all chickens"\"");
  window.close();
</script>

The double quotes aren't escaped in the javascript error message.

Boofo 02-23-2004 05:46 PM

How do we fix that? ;)

buro9 02-23-2004 05:47 PM

Quote:

Originally Posted by buro9
Got it... it's here:

Code:

<script language="javascript">
  window.alert("No matches found for:\n\""killing all chickens"\"");
  window.close();
</script>

The double quotes aren't escaped in the javascript error message.

Simple solution... in findtopic.php at the bottom, find:

Code:

eval('print_output("' . fetch_template('newthread_find') . '");');
Above it add:
Code:

if (empty($threads)) {
  $subject = str_replace('"','\"',$subject);
}


Boofo 02-23-2004 05:52 PM

You are a saint! Thank you, sir. That worked great! ;)

I'm glad it wasn't my imagination. ;)

Zilvia 03-25-2004 06:50 PM

Does this work with the final release of vB 3.0.0?

Velocd 03-29-2004 09:57 PM

Yes.


All times are GMT. The time now is 01:04 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.03735 seconds
  • Memory Usage 1,736KB
  • 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
  • (4)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