I'm using a global to list a user's links on a new page. I call it and pass a username into it like shown:
my $user = $_[0];
my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;
my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('link', $hit);
}
return $back;
}I would like to use the built-in paging features to split the results up into pages. I have added the JavaScript and other code from the category page but the global needs some work to use the paging as well (I presume I need to use a loop of some sort but that is a foreign concept to me at the moment).
I've searched the forum and the help but there I can't find much information on using this feature in custom pages. Any pointers on this would be appreciated!
Code:
sub { my $user = $_[0];
my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;
my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= Links::SiteHTML::display('link', $hit);
}
return $back;
}
I've searched the forum and the help but there I can't find much information on using this feature in custom pages. Any pointers on this would be appreciated!