Oops, I've just spotted a mistake - Heading1 is a column in my Links table which you don't need in the code. (This is the problem with testing things on your own site which is not standard). Try changing it to this:
sub {
my $args=shift;
#my $cat_id = $IN->param('catID');
my $db = $DB->table ('Category','CatLinks');
my $cat_id = $db->select ( { 'CatLinks.LinkID' => $args->{ID} }, ['Category.ID'] )->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' ] );
my ($next, $prev);
while (my ($id) = $sth->fetchrow_array) {
if ($id == $args->{ID}) {
($next) = $sth->fetchrow_array;
last;
}
else {
$prev = $id;
}
}
my ($next_url, $prev_url);
if ($next) {
$next_url = "$CFG->{db_cgi_url}/page.cgi?p=quicklook&ID=$next";;
}
if ($prev) {
$prev_url = "$CFG->{db_cgi_url}/page.cgi?p=quicklook&ID=$prev";;
}
return {next_url => $next_url, prev_url => $prev_url};
}
Sorry about that. Hope it works this time.
By the way, you don't need detailed pages turned on if you're not using the static detailed pages - I just thought that might be an easy fix to get this working. If you're going to keep using your dynamic pages you should just be able to use this global. I'm not sure what the difference is between 2.05 and the current version of links but I would be surprised if that's the problem - hopefully it should work now?
Laura.
The UK High Street
sub {
my $args=shift;
#my $cat_id = $IN->param('catID');
my $db = $DB->table ('Category','CatLinks');
my $cat_id = $db->select ( { 'CatLinks.LinkID' => $args->{ID} }, ['Category.ID'] )->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' ] );
my ($next, $prev);
while (my ($id) = $sth->fetchrow_array) {
if ($id == $args->{ID}) {
($next) = $sth->fetchrow_array;
last;
}
else {
$prev = $id;
}
}
my ($next_url, $prev_url);
if ($next) {
$next_url = "$CFG->{db_cgi_url}/page.cgi?p=quicklook&ID=$next";;
}
if ($prev) {
$prev_url = "$CFG->{db_cgi_url}/page.cgi?p=quicklook&ID=$prev";;
}
return {next_url => $next_url, prev_url => $prev_url};
}
Sorry about that. Hope it works this time.
By the way, you don't need detailed pages turned on if you're not using the static detailed pages - I just thought that might be an easy fix to get this working. If you're going to keep using your dynamic pages you should just be able to use this global. I'm not sure what the difference is between 2.05 and the current version of links but I would be surprised if that's the problem - hopefully it should work now?
Laura.
The UK High Street