Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Existing Topics Check Details »»
Existing Topics Check
Version: 1.00, by Velocd Velocd is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-08-2004 Last Update: Never Installs: 55
 
No support by the author.



This hack will allow you and your members to check for existing topics, or similar ones, of the thread you plan to create when at newthread.php.

This should help to prevent double topics that often appear from newbish members who neglect to use the search feature.

It uses the exact functions as the "similar threads" feature, therefore has the same accuracy.

Tested to work on:
  • vBulletin 3 RC2
  • Internet Explorer 6 (with Javascript enabled)
  • Mozilla Firebird 0.7 / Mozilla 1.5 (with Javascript enabled)

------------------------------------------------

Tweak #1

If you would like the find icon to show upon typing in the input box, and then disappear if the input box is empty upon change, please do the following:


In the template newthread, find:
Code:
function showFind(object)
{
  if(object.value != '')
  {
    document.findicon.src = "$stylevar[imgdir_button]/findicon_on.gif";
    document.findicon.style.cursor = "pointer";
  }
  else
  {
    document.findicon.src = "$stylevar[imgdir_button]/findicon_off.gif";
    document.findicon.style.cursor = "default";
  }
}
Replace it with:
Code:
function showFind()
{
    document.findicon.src = "$stylevar[imgdir_button]/findicon_on.gif";
    document.findicon.style.cursor = "pointer";
}

function hideFind(object)
{
  if(object.value == '')
  {
    document.findicon.src = "$stylevar[imgdir_button]/findicon_off.gif";
    document.findicon.style.cursor = "default";
  }
}
In the same template, find:
Code:
<td><input type="text" class="bginput" name="subject" onChange="showFind(this)" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
Replace it with:
Code:
<td><input type="text" class="bginput" name="subject" onchange="hideFind(object)" onkeypress="showFind()" value="$subject" size="40" maxlength="85" tabindex="1" /></td>
------------------------------------------------

Attached is a screenshot.

Inside the zip are English, German, and French installation instructions. Please be aware I used a software translator for the German and French docs.

Enjoy.

Show Your Support

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

Comments
  #32  
Old 02-23-2004, 01:32 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #33  
Old 02-23-2004, 01:41 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #34  
Old 02-23-2004, 02:04 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #35  
Old 02-23-2004, 02:21 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #36  
Old 02-23-2004, 05:42 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #37  
Old 02-23-2004, 05:46 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do we fix that?
Reply With Quote
  #38  
Old 02-23-2004, 05:47 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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);
}
Reply With Quote
  #39  
Old 02-23-2004, 05:52 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

I'm glad it wasn't my imagination.
Reply With Quote
  #40  
Old 03-25-2004, 06:50 PM
Zilvia's Avatar
Zilvia Zilvia is offline
 
Join Date: Apr 2002
Location: Denver, CO
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with the final release of vB 3.0.0?
Reply With Quote
  #41  
Old 03-29-2004, 10:57 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes.
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 07:24 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.07038 seconds
  • Memory Usage 2,315KB
  • 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
  • (9)bbcode_code
  • (4)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete