I went ahead and played with it any way.
detail_page.cgi can pass through parameters, such as Query=<%query%>
in detail.html you have to add a few switches:
Code:
<%if Query%>
<%highlight ($Query, $Description)%>
<%highlight_text%>
<HR>
<A href=<%db_cgi_url%>/detail_page.cgi?ID=<%ID%><%if Query%>&query=<%Query%><%endif%>>Reload page without highlighting</A>
<%else%>
<%if query%><%highlight ($query, '2x2')%><%endif%>
<%Description%>
<HR>
<A href=<%db_cgi_url%>/detail_page.cgi?ID=<%ID%><%if query%>&Query=<%query%><%endif%>>Reload page with highlighting</A>
<%endif%>
in link.html you pass in the term, like this:
Code:
<%if detailed_url%>
<a href="<%db_cgi_url%>/detail_page.cgi?ID=<%ID%><%if query%>&Query=<%query%><%endif%>">Details</a>
<%endif%>
If there is no "query" (not on a search page) it will just be ignored, and you'll get a regular page view.
Then, you add a global, a modified version of pauls fix up:
Code:
sub {
my ($query_term,$highlight_text) = @_;
if ($highlight_text eq '2x2') {
$query_term =~ s|\s+|%20|sig;
return ({query => $query_term});
}
$query_term =~ s|%20|\s|sig;
my @query = split /\s+/, $query_term;
my $desc = $highlight_text;
for (@query) {
$desc =~ s|(\Q$_\E)|<b>$1</b>|sig;
}
$query_term =~ s|\s+|%20|sig;
return ({highlight_text=>$desc, query=>$query_term, Query=>$query_term} );
}
The trick was making multiple words stick between refreshes.
PUGDOG� Enterprises, Inc. The best way to contact me is to
NOT use Email.
Please leave a PM here.