wolfstream
05-05-2008, 10:00 PM
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
if ($vbulletin->GPC['q'] == '')
{
eval(standard_error(fetch_error('searchspecifyterm s')));
}
After, add
$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!
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
if ($vbulletin->GPC['q'] == '')
{
eval(standard_error(fetch_error('searchspecifyterm s')));
}
After, add
$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!