Gossamer Forum
Home : Products : Links 2.0 : Customization :

Search Problem in Links 1.11

Quote Reply
Search Problem in Links 1.11
Hi,

I am making changes to my site_html.pl for my Links 1.11 system in order to customise my site.

I have come across a problem when I do a search. Even though I select say 30 matches or even use the selected 15, I will come back with the total amount of matches in the system. For instance I did a search for the word "test" (without the quotes), 15 was selected, but it came back with 44 matches.

The system used to be fine when searching. What have bit have I messed up, maybe the search.cgi file?

Here is a copy of my search form, in the site_html.pl.

-------------------------------------------------------------
<form
action="http://www.digi-zone.com/search/search.cgi"
method="GET">
<p align="center"><font color="#000000"
size="2" face="arial, helvetica">Search: </font><font
color="#000000" size="2"
face="arial, helvetica"><input type="text"
size="30" name="query"> <select
name="mh" size="1">
<option>10</option>
<option selected>15</option>
<option>30</option>
<option>50</option>
<option>100</option>
</select></font> <input type="submit" value="Search" name="submit"></p>
</form>


Thanks in advance

Martin Pitt
Quote Reply
Re: Search Problem in Links 1.11 In reply to
Has anybody got a clue, because this is driving me mad?

Martin
Quote Reply
Re: Search Problem in Links 1.11 In reply to
I would suspect something is amiss in search.cgi. Look at sub main. The following should be there:

Quote:
# Check to see if we've returned more hits then are maximum allowed..
if ($link_hits > ($maxhits * ($nh+1))) {
# If so, we build a $next variable that has the url to get then next n hits.
$next = $ENV{'QUERY_STRING'};
if ($in{'nh'}) {
$nh = $in{'nh'} + 1;
$next =~ s/&nh=(\d+)/&nh=$nh/;
}
else { $next .= "&nh=1"; }
$next = $build_search_url . "?" . $next;
if (($link_hits - ($maxhits * ($in{'nh'}+1))) <= $maxhits) {
$next_hits = ($link_hits - ($maxhits * ($in{'nh'}+1)));
}
else {
$next_hits = $maxhits;
}
}
else {
$next = "";
}

I hope this helps.



[This message has been edited by Bobsie (edited March 01, 1999).]