I'm using these two globals to show search words from the title and from description:
my $tags = GT::Template->tags;
my @words = split(/\s+/,$tags->{Title});
my @links;
foreach (@words){
s/^\s*//sg;
s/[\.,:\?!\(\)"]+//sg;
next if length($_)<6;
push(@links,qq|<a href="$CFG->{db_cgi_url}/search.cgi?query=$_">$_</a>|);
}
return join(" - ",@links);
}
and
my $tags = GT::Template->tags;
my @words = split(/\s+/,$tags->{Description});
my @links;
foreach (@words){
s/^\s*//sg;
s/[\.,:\?!\(\)"]+//sg;
next if length($_)<4;
push(@links,qq|<a href="$CFG->{db_cgi_url}/search.cgi?query=$_">$_</a>|);
}
return join(" - ",@links);
}
When description and title include the same words, I get double search words?
Is there a way to combine these two globals and print the results only one time...?
Thanks
Matthias
Matthias
gpaed.de
Code:
sub { my $tags = GT::Template->tags;
my @words = split(/\s+/,$tags->{Title});
my @links;
foreach (@words){
s/^\s*//sg;
s/[\.,:\?!\(\)"]+//sg;
next if length($_)<6;
push(@links,qq|<a href="$CFG->{db_cgi_url}/search.cgi?query=$_">$_</a>|);
}
return join(" - ",@links);
}
and
Code:
sub { my $tags = GT::Template->tags;
my @words = split(/\s+/,$tags->{Description});
my @links;
foreach (@words){
s/^\s*//sg;
s/[\.,:\?!\(\)"]+//sg;
next if length($_)<4;
push(@links,qq|<a href="$CFG->{db_cgi_url}/search.cgi?query=$_">$_</a>|);
}
return join(" - ",@links);
}
When description and title include the same words, I get double search words?
Is there a way to combine these two globals and print the results only one time...?
Thanks
Matthias
Matthias
gpaed.de