Ignore:
Timestamp:
02/14/07 13:03:31 (18 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Tweak complex search to allow more results on a single page, or all on
one page if *really* wanted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/search.cgi

    r323 r357  
    4040my %webvar = parse_post();
    4141cleanInput(\%webvar);
     42
     43if (defined($webvar{rpp})) {
     44  ($RESULTS_PER_PAGE) = ($webvar{rpp} =~ /(\d+)/);
     45}
    4246
    4347if (!defined($webvar{stype})) {
     
    185189  } else {
    186190    # Add the limit/offset clauses
    187     $sql .= " order by cidr limit $RESULTS_PER_PAGE offset $offset";
     191    $sql .= " order by cidr";
     192    $sql .= " limit $RESULTS_PER_PAGE offset $offset" if $RESULTS_PER_PAGE != 0;
    188193    # And tell the user.
    189194    print "<div class=heading>Searching...............</div>\n";
     
    420425
    421426  # print the page thing..
    422   if ($rowCount > $RESULTS_PER_PAGE) {
     427  if ($RESULTS_PER_PAGE > 0 && $rowCount > $RESULTS_PER_PAGE) {
    423428    my $pages = ceil($rowCount/$RESULTS_PER_PAGE);
    424429    print qq(<div class="center"> Page: );
Note: See TracChangeset for help on using the changeset viewer.