Gossamer Forum
Home : Products : Gossamer Links : Discussions :

a short message if search string is too short.

Quote Reply
a short message if search string is too short.
How do I prompt user to enter a longer search string if it's less than 3 characters and I am using internal indexing? Thank you.
Quote Reply
Re: [flybuzz] a short message if search string is too short. In reply to
Hi. My guess would be that you need a plugin to do this.

An easier way, would be to hack SearchLogger, so that it checks;

Code:
if (length($IN->param('query') < 3) {
print $IN->header();
print Links::SiteHTML::display('search', { error => "Sorry, your search query was too short..." } );
exit;
}

I guess it would go around line 100, around;

Code:
$query =~ s/^\s*|\s*$//g;
$query = lc $query;
$query = substr ($query, 0, 24);

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] a short message if search string is too short. In reply to
Thanks for the idea... any other method available? What happens if I don't use the plugin? Would that be troublesome? Thanks.
Quote Reply
Re: [flybuzz] a short message if search string is too short. In reply to
Try this thread for some ideas:
http://www.gossamer-threads.com/...i?post=193625#193625