Gossamer Forum
Home : Products : Gossamer Links : Discussions :

current link number

(Page 2 of 2)
> >
Quote Reply
Re: [afinlr] current link number In reply to
afinlr,

Could you please post the entire global. Many thanks for helping out, was trying to get this to work about a month ago.
Quote Reply
Re: [afinlr] current link number In reply to
Works great

ThanksWink
Quote Reply
Re: [rascal] current link number In reply to
Code:
sub {
my $tags = shift;
my $total = $tags->{total};
my $high = $CFG->{build_links_per_page};
my $low = 1;
my $page = $tags->{paging}->{current_page};

if ($page > 1) {
$low = (($page - 1) * $high) + 1;
} else {
$page = 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";

}

> >