Except with that you end up with things like:
16 - 20 of 16 Links
Try this instead:
my $tags = shift;
my $total = $tags->{link_hits};
my $high = $Links::CFG->{search_maxhits};
my $low = 1;
my $page = $tags->{nh} || 1;
if ($page > 1) {
$low = (($page - 1) * $high) + 1;
}
my $top = ($high + $low > $total) ? $total : (($high + $low) - 1);
return "Viewing $low to $top of $total";
}
16 - 20 of 16 Links
Try this instead:
Code:
sub { my $tags = shift;
my $total = $tags->{link_hits};
my $high = $Links::CFG->{search_maxhits};
my $low = 1;
my $page = $tags->{nh} || 1;
if ($page > 1) {
$low = (($page - 1) * $high) + 1;
}
my $top = ($high + $low > $total) ? $total : (($high + $low) - 1);
return "Viewing $low to $top of $total";
}