Gossamer Forum
Quote Reply
Combine two globals?
I'm using these two globals to show search words from the title and from description:
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
Subject Author Views Date
Thread Combine two globals? Matthias70 16355 Jan 5, 2013, 7:46 AM
Thread Re: [Matthias70] Combine two globals?
Andy 16053 Jan 5, 2013, 8:18 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15911 Jan 5, 2013, 9:56 AM
Thread Re: [Matthias70] Combine two globals?
Andy 16057 Jan 5, 2013, 10:00 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15927 Jan 5, 2013, 10:10 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15929 Jan 6, 2013, 1:24 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15930 Jan 6, 2013, 5:50 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15902 Jan 6, 2013, 6:18 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15928 Jan 6, 2013, 11:07 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15930 Jan 7, 2013, 12:20 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15879 Jan 7, 2013, 4:33 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15918 Jan 7, 2013, 4:44 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15878 Jan 7, 2013, 5:01 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15908 Jan 7, 2013, 6:29 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15806 Jan 7, 2013, 7:05 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15844 Jan 7, 2013, 8:06 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15825 Jan 7, 2013, 9:34 AM
Thread Re: [Matthias70] Combine two globals?
Matthias70 15865 Jan 7, 2013, 11:59 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15847 Jan 8, 2013, 12:41 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15743 Jan 8, 2013, 6:40 AM
Thread Re: [Matthias70] Combine two globals?
Matthias70 15796 Jan 8, 2013, 10:00 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15789 Jan 8, 2013, 10:07 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15786 Jan 8, 2013, 10:45 AM
Thread Re: [Matthias70] Combine two globals?
Andy 15757 Jan 9, 2013, 12:03 AM
Thread Re: [Andy] Combine two globals?
Matthias70 15792 Jan 9, 2013, 6:11 AM
Thread Re: [Matthias70] Combine two globals?
Andy 7882 Jan 9, 2013, 6:13 AM
Thread Re: [Andy] Combine two globals?
Matthias70 7893 Jan 9, 2013, 6:36 AM
Thread Re: [Matthias70] Combine two globals?
Andy 7885 Jan 9, 2013, 6:37 AM
Thread Re: [Andy] Combine two globals?
Matthias70 7899 Jan 9, 2013, 6:43 AM
Post Re: [Matthias70] Combine two globals?
Andy 7856 Jan 9, 2013, 6:44 AM
Thread Re: [Andy] Combine two globals?
Matthias70 7593 Aug 25, 2013, 8:44 AM
Thread Re: [Matthias70] Combine two globals?
Andy 7836 Aug 26, 2013, 11:17 PM
Thread Re: [Andy] Combine two globals?
Matthias70 7551 Aug 27, 2013, 2:18 AM
Thread Re: [Matthias70] Combine two globals?
Andy 7593 Aug 27, 2013, 5:57 AM
Thread Re: [Andy] Combine two globals?
Matthias70 7612 Aug 27, 2013, 9:49 AM
Thread Re: [Matthias70] Combine two globals?
Andy 7554 Aug 27, 2013, 9:55 AM
Thread Re: [Andy] Combine two globals?
Matthias70 7583 Aug 27, 2013, 10:00 AM
Post Re: [Matthias70] Combine two globals?
Andy 7556 Aug 27, 2013, 10:02 AM