Oh, the one I gave you was for the category.html template. For search_results.html, do:
my $tags = shift;
my $total = $tags->{link_hits};
my $high = $IN->param('mh');
my $low = 1;
my $page = $tags->{nh} || 1;
if ($high > 0) {
$high = $IN->param('mh');
}else{
$high = $Links::CFG->{search_maxhits};
}
if ($page > 1) {
$low = (($page - 1) * $high) + 1;
}
my $top = ($high + $low > $total) ? $total : (($high + $low) - 1);
$low =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$top =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$total =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
return "$low - $top of $total";
}
Also, for the category matches on the search_results.html template, you can create another new global with this code and just replace:
with
I hope that works for you.
Sean
Code:
sub { my $tags = shift;
my $total = $tags->{link_hits};
my $high = $IN->param('mh');
my $low = 1;
my $page = $tags->{nh} || 1;
if ($high > 0) {
$high = $IN->param('mh');
}else{
$high = $Links::CFG->{search_maxhits};
}
if ($page > 1) {
$low = (($page - 1) * $high) + 1;
}
my $top = ($high + $low > $total) ? $total : (($high + $low) - 1);
$low =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$top =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
$total =~ s/^([-+]?\d+)(\d{3})/$1,$2/;
return "$low - $top of $total";
}
Also, for the category matches on the search_results.html template, you can create another new global with this code and just replace:
Code:
my $total = $tags->{link_hits};Code:
my $total = $tags->{cat_hits};I hope that works for you.
Sean