Gossamer Forum
Quote Reply
Stop Words Global...
I searched the forums for this, but couldn't find anything...

Does anyone know of a global that you could use if someone enters a stop word or two few characters (just a letter or number) that would display a error that the word was too common, or too short, etc?

My idea was something like:

Create a global called stopword_error:
Code:
sub {

# Set query variable to actual query
my $query = $IN->param('query');
my $error = '';

# Determine if query is a stop word
if $query = blahblahblah {
$error = "The word searched is too common...";
}

# Determine if the query is too short
if $query = blahblahblah {
$error = "The word searched is too short...";
}

# Return the error
return $error;

}

Then in your search.html template, you could do:

<%if error%>

<%if stopword_error%>
<p><font color="red"><b><%stopword_error%></b></font></p>
<%else%>
<p><font color="red"><b><%error%></b></font></p>
<%endif%>

<%endif%>


Being so new to perl, I'm not sure how to make this work. Does anyone have any ideas on this?

Sean

Last edited by:

SeanP: Apr 26, 2002, 10:28 AM
Subject Author Views Date
Thread Stop Words Global... SeanP 6344 Apr 26, 2002, 10:09 AM
Thread Re: [SeanP] Stop Words Global...
Alex 6221 Apr 26, 2002, 1:24 PM
Post Re: [Alex] Stop Words Global...
SeanP 6146 Apr 26, 2002, 1:42 PM
Thread Re: [Alex] Stop Words Global...
SeanP 6161 Apr 26, 2002, 6:44 PM
Thread Re: [SeanP] Stop Words Global...
Ian 6173 Apr 27, 2002, 8:11 PM
Thread Re: [sooke] Stop Words Global...
SeanP 6113 Apr 27, 2002, 10:14 PM
Post Re: [SeanP] Stop Words Global...
Ian 6134 Apr 27, 2002, 10:16 PM
Post Re: [Alex] Stop Words Global...
SeanP 6057 May 1, 2002, 9:52 AM
Thread Re: [Alex] Stop Words Global...
SeanP 6059 May 7, 2002, 5:18 PM
Thread Re: [SeanP] Stop Words Global...
SeanP 6011 May 10, 2002, 8:13 AM
Post Re: [SeanP] Stop Words Global...
SeanP 6018 May 10, 2002, 10:25 AM
Thread Re: [SeanP] Stop Words Global...
SSmeredith 5736 Feb 14, 2003, 5:59 AM
Post Re: [SSmeredith] Stop Words Global...
Paul 5707 Feb 14, 2003, 4:42 PM
Thread Re: [SSmeredith] Stop Words Global...
Andy 5708 Feb 15, 2003, 2:03 AM
Thread Re: Stop Words Global...
SSmeredith 5683 Feb 15, 2003, 5:43 AM
Post Re: [SSmeredith] Stop Words Global...
Andy 5690 Feb 15, 2003, 6:08 AM