Ignore:
Timestamp:
11/27/07 12:18:27 (17 years ago)
Author:
Kris Deugau
Message:

/trunk

Merge bugfixes and enhancements from /branches/stable r351 through r359

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/search.cgi

    r351 r370  
    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.