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

Re: [vacationrentals] span pages

Quote Reply
Re: [vacationrentals] span pages In reply to
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};
}
Subject Author Views Date
Thread span pages vacationrentals 3121 Mar 11, 2004, 9:15 AM
Post Re: [vacationrentals] span pages
afinlr 3032 Mar 11, 2004, 9:38 AM
Thread Re: [vacationrentals] span pages
afinlr 3053 Mar 11, 2004, 9:47 AM
Thread Re: [afinlr] span pages
Andy 3044 Mar 11, 2004, 9:55 AM
Thread Re: [Andy] span pages
afinlr 3039 Mar 11, 2004, 10:14 AM
Post Re: [afinlr] span pages
Andy 3030 Mar 11, 2004, 10:17 AM
Post Re: [afinlr] span pages
vacationrentals 2997 Mar 12, 2004, 6:37 AM