Hi,
You could edit /admin/Plugins/SearchFilter.pm, replace:
Code:
sub search_results {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'search_results'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my $tags = shift;
my $query = $IN->param('query');
my @words = split /\s+/, $query;
my $opts = Links::Plugins::get_plugin_user_cfg('SearchFilter');
my $sf = $DB->table ('SearchFilter');
my $cond = GT::SQL::Condition->new('filter_word', 'IN', \@words);
if ($sf->count($cond)) {
my $filtered_words = $sf->select($cond)->fetchall_hashref;
$tags->{filtered_words} = $filtered_words;
GT::Plugins->action ( STOP );
if ($opts->{search_filter_what} eq 'url') {
print $IN->redirect ($opts->{search_filter_url});
return;
}
}
return $tags;
}
..with:
Code:
sub search_results {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'search_results'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my $tags = shift;
my $query = $IN->param('query');
my @words = split /\s+/, $query;
my $opts = Links::Plugins::get_plugin_user_cfg('SearchFilter');
my $sf = $DB->table ('SearchFilter');
my $cond = GT::SQL::Condition->new('filter_word', 'IN', \@words);
if ($sf->count($cond)) {
my $filtered_words = $sf->select($cond)->fetchall_hashref;
$tags->{filtered_words} = $filtered_words;
GT::Plugins->action ( STOP );
if ($opts->{search_filter_what} eq 'url') {
print $IN->redirect ($opts->{search_filter_url});
return;
}
}
if ($IN->param('query') =~ /\Q<script/i && $IN->param('query') =~ /\Q<\/script>/i) {
GT::Plugins->action ( STOP );
print $IN->redirect ($opts->{search_filter_url});
return;
} return $tags;
}
I gave it a test on one of my dev installs, and works fine.
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work! Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500) Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins! Compare our different Plugin packages *new* Free CSS Templates