Just a note to anyone using span pages, since I put these globals on the forum, I realised that there is a toolbar function that you can use already built into Links.
So you could write this global more simply as (I think):
sub {
my $top_category=shift;
my $tags=shift;
my $nh = $IN->param('nh')||1;
($nh =~ /\d+/) || ($nh=1);
my $page=$IN->param('p');
my $maxhits = $tags->{maxhits}||10;
($maxhits =~ /\d+/) || ($maxhits=10);
my $category = $DB->table('Category')->get($top_category);
my $db=$DB->table('Links','CatLinks','Category');
my $cond = GT::SQL::Condition->new('isNew', '=', 'Yes', 'Full_Name', 'like', $category->{Full_Name} . '%');
my $numhits = $db->count ( $cond );
my $url = $CFG->{db_cgi_url} . "/" . $IN->url( query_string => 1, absolute => 0 );
my $toolbar = $DB->html($db, $IN)->toolbar( $nh, $maxhits, $numhits, $url);
return {span=>$toolbar,total=>$numhits};
}
So you could write this global more simply as (I think):
sub {
my $top_category=shift;
my $tags=shift;
my $nh = $IN->param('nh')||1;
($nh =~ /\d+/) || ($nh=1);
my $page=$IN->param('p');
my $maxhits = $tags->{maxhits}||10;
($maxhits =~ /\d+/) || ($maxhits=10);
my $category = $DB->table('Category')->get($top_category);
my $db=$DB->table('Links','CatLinks','Category');
my $cond = GT::SQL::Condition->new('isNew', '=', 'Yes', 'Full_Name', 'like', $category->{Full_Name} . '%');
my $numhits = $db->count ( $cond );
my $url = $CFG->{db_cgi_url} . "/" . $IN->url( query_string => 1, absolute => 0 );
my $toolbar = $DB->html($db, $IN)->toolbar( $nh, $maxhits, $numhits, $url);
return {span=>$toolbar,total=>$numhits};
}