Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Count Links with a global

Quote Reply
Count Links with a global
Hi all, to show the count of links i use some moifications in build.pm
Example
1. Title Description
2. Title Description

# Get the links.
*** my $counter = $offset; # CountLinks
my $results = $sth->fetchall_hashref;
$link_db->add_reviews ($results);
foreach my $link (@$results) {
*** $counter++; # +1
*** $link->{CNT} = $counter; # pass to tag CNT
$link->{Category_Template} = $category->{Category_Template} if ($category->{Category_Template});
$display{links} .= Links::SiteHTML::display ('link', $link);
push @{$display{links_loop}}, $link;
}

...



Maybe there is still aglobal for that build in links or another solution without changing the script?
Quote Reply
Re: [Robert] Count Links with a global In reply to
You need a couple of globals I think - one to get the right number to start from at the top of the page if you are spanning pages. I think that Ivan has posted a solution a couple of times.

Edit: Here's one thread:

http://www.gossamer-threads.com/...i?post=231297#231297

Last edited by:

afinlr: Sep 9, 2003, 4:29 PM
Quote Reply
Re: [afinlr] Count Links with a global In reply to
Thank you.
Just did it by my own now in the script itself.

It should be easy when using loops in the templates, i remember that too late.