Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Search Details »»
FAQ Search
Version: 1.00, by wolfstream wolfstream is offline
Developer Last Online: Sep 2009 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.7.0 Rating:
Released: 05-05-2008 Last Update: Never Installs: 2
Re-useable Code Code Changes Translations  
No support by the author.

This is a very simple modification, which will enforce the search length when searching the FAQ. Not sure whether it was 'forgotten' about, or simply not added intentionally.

I don't expect huge accolades here, it's a quick and easy fix. No templates, a simple file mod. If someone knows of a better way to do this, by all means I'm up for it!

In faq.php, find
Code:
	if ($vbulletin->GPC['q'] == '')
	{
		eval(standard_error(fetch_error('searchspecifyterms')));
	}
After, add
Code:
	$slen=$vbulletin->options['minsearchlength'];
	if (strlen($vbulletin->GPC['q']) < $slen)
	{
		$nterm = $vbulletin->GPC['q'];
		eval(standard_error("Your search term ($nterm) is too  short. Please try again"));
	}

This takes advantage of the globally set search length (for search.php).

Again, nothing major by any means, it's quick and simple. I just thought I'd pass it along for those that were interested in using it.

I ran across the need for this myself because on random forums, I would get an SQL error when trying a faq search with just one letter (a,b,c,etc), which shouldn't be allowed anyways.

Hopefully someone finds this useful, and, again, if you can come up with a better way to do it, by all means, post it in here for all of us to benefit from!

Show Your Support

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

Comments
  #2  
Old 05-07-2008, 05:17 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont think searching the FAQ's will be that server intensive to warrant a minimum search length, but thanks for sharing either way.
Reply With Quote
  #3  
Old 05-07-2008, 05:53 AM
wolfstream wolfstream is offline
 
Join Date: Jan 2003
Location: Iowa
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Like I said, I had (sort of) an ulterior motive for creating this.

I've noticed a bug in at least a few forums (still trying to pinpoint what causes it) where a search of a single character in the FAQ causes a mysql error.

Figured this would be at least a quick hack to get it fixed. I'm sure it's not that "intense" at all, but still, a quick and dirty way to force individuals to use the min. search length.
Reply With Quote
Reply

Thread Tools

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 02:11 PM.


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.03754 seconds
  • Memory Usage 2,203KB
  • Queries Executed 16 (?)
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
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete