Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [RWhite] <%next%> <%prev%> - detailed page

Quote Reply
Re: [RWhite] <%next%> <%prev%> - detailed page In reply to
Oops, I've just spotted a mistake Blush - 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
Subject Author Views Date
Thread <%next%> <%prev%> - detailed page RWhite 5625 Oct 25, 2002, 10:56 AM
Post Re: [RWhite] <%next%> <%prev%> - detailed page
VishalT 5515 Oct 25, 2002, 12:57 PM
Post Re: [RWhite] <%next%> <%prev%> - detailed page
Jonze 5516 Oct 25, 2002, 2:04 PM
Thread Re: [RWhite] <%next%> <%prev%> - detailed page
afinlr 5535 Oct 25, 2002, 3:07 PM
Thread Post deleted by RWhite
RWhite 5510 Oct 25, 2002, 5:30 PM
Thread Re: [RWhite] <%next%> <%prev%> - detailed page
RWhite 5430 Oct 25, 2002, 5:43 PM
Thread Re: [RWhite] <%next%> <%prev%> - detailed page
afinlr 5481 Oct 25, 2002, 6:07 PM
Thread Re: [afinlr] <%next%> <%prev%> - detailed page
RWhite 5542 Oct 25, 2002, 7:25 PM
Post Re: [RWhite] <%next%> <%prev%> - detailed page
afinlr 5416 Oct 26, 2002, 5:15 AM
Thread Re: [RWhite] <%next%> <%prev%> - detailed page
afinlr 5464 Oct 26, 2002, 5:45 AM
Thread Re: [afinlr] <%next%> <%prev%> - detailed page
RWhite 5466 Oct 26, 2002, 9:34 AM
Thread Re: [RWhite] <%next%> <%prev%> - detailed page
afinlr 5457 Oct 26, 2002, 10:05 AM
Post Re: [afinlr] <%next%> <%prev%> - detailed page
RWhite 5417 Oct 30, 2002, 11:41 AM