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
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!