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

Re: [dwh] Next Prev - Title

Quote Reply
Re: [dwh] Next Prev - Title In reply to
OK this code worked for me:

Code:
sub {
my $args=shift;
my $db = $DB->table ('Category','CatLinks');
my ($cat_id,$full_name) = $db->select ( { 'CatLinks.LinkID' => $args->{ID} }, ['Category.ID', 'Category.Name'] )->fetchrow_array;
my $catlnk_db = $DB->table ('Links', 'CatLinks');
$catlnk_db->select_options ("ORDER BY $CFG->{build_sort_order_category}") if ($CFG->{build_sort_order_category});
my $sth = $catlnk_db->select ( { CategoryID => $cat_id, isValidated => 'Yes' }, [ 'Links.ID' ,'Links.Title'] );
my ($next,$prev,$next_title,$prev_title) ; while (my ($id,$title) = $sth->fetchrow_array) {
if ($id == $args->{ID}) {
($next,$next_title) = $sth->fetchrow_array;
last;
} else {
$prev = $id;
$prev_title=$title;
}
} my ($next_url, $prev_url);
if ($next) {
$next_url = qq~<a href="$CFG->{build_root_url}/Detailed/$next.html">$next_title</a>~;
}
if ($prev) {
$prev_url = qq~<a href="$CFG->{build_root_url}/Detailed/$prev.html">$prev_title</a>~;
}
return {next_url => $next_url, prev_url => $prev_url};
}
Subject Author Views Date
Thread; hot thread Next Prev - Title BLOOD 10633 Oct 25, 2003, 4:06 AM
Thread; hot thread Re: [BLOOD] Next Prev - Title
afinlr 10390 Oct 25, 2003, 7:33 AM
Thread; hot thread Re: [afinlr] Next Prev - Title
dwh 10284 Jul 14, 2004, 5:59 PM
Thread; hot thread Re: [dwh] Next Prev - Title
afinlr 10285 Jul 15, 2004, 9:00 AM
Thread; hot thread Re: [afinlr] Next Prev - Title
dwh 10310 Aug 14, 2004, 4:12 AM
Thread; hot thread Re: [dwh] Next Prev - Title
afinlr 10294 Aug 14, 2004, 4:17 AM
Thread; hot thread Re: [afinlr] Next Prev - Title
dwh 10250 Aug 14, 2004, 4:33 AM
Thread; hot thread Re: [dwh] Next Prev - Title
dwh 10278 Aug 14, 2004, 4:45 AM
Thread; hot thread Re: [dwh] Next Prev - Title
dwh 10263 Aug 14, 2004, 4:57 AM
Thread; hot thread Re: [dwh] Next Prev - Title
afinlr 10261 Aug 14, 2004, 5:00 AM
Thread; hot thread Re: [afinlr] Next Prev - Title
dwh 10229 Aug 14, 2004, 5:14 AM
Thread; hot thread Re: [dwh] Next Prev - Title
afinlr 10222 Aug 14, 2004, 5:26 AM
Thread; hot thread Re: [afinlr] Next Prev - Title
VishalT 9954 Jul 20, 2009, 5:55 PM
Thread; hot thread Re: [SWDevil.Com] Next Prev - Title
afinlr 9945 Jul 21, 2009, 2:36 AM
Thread; hot thread Re: [afinlr] Next Prev - Title
VishalT 9932 Jul 21, 2009, 6:25 AM
Thread; hot thread Re: [SWDevil.Com] Next Prev - Title
afinlr 9900 Jul 21, 2009, 1:46 PM
Post; hot thread Re: [afinlr] Next Prev - Title
VishalT 9868 Jul 21, 2009, 11:42 PM
Post; hot thread Re: [dwh] Next Prev - Title
dwh 10195 Aug 14, 2004, 5:26 AM
Post; hot thread Re: [dwh] Next Prev - Title
afinlr 10245 Aug 14, 2004, 5:07 AM