This edit seems to work perfectly for <%next_url%>, however there is some problem with <%prev_url%> :(, it Shows the title, however without the URL / link :(
Here is the output for <%prev_url%>
<a href="">My Test Listing </a>
--------------------------------------------------------
Global that I am using:
my $this_link_id = $_[0];
my $db = $DB->table ('Links','CatLinks');
my $cat_id = $db->select ( ['CategoryID'], { LinkID => $this_link_id } )->fetchrow;
# Figure out the next/prev links.
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( ['Links.ID','Links.Title'] => { CategoryID => $cat_id }, VIEWABLE);
my ($next, $prev, $next_title, $prev_title);
while (my ($id,$title) = $sth->fetchrow) {
if ($id == $this_link_id) {
($next,$next_title) = $sth->fetchrow_array;
last;
}
else {
$prev = $id;
$prev_title = $title;
}
}
my ($next_url, $prev_url);
if ($next) {
my $next_link = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $next );
$next_url = qq~<a href="$next_link">$next_title</a>~;
}
if ($prev) {
my $prev_link = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $prev );
$prev_url = qq~<a href="$prev_url">$prev_title</a>~;
}
return { next_url => $next_url, prev_url => $prev_url };
}
I am calling global using (Global name = prev_next1):
1.prev_url : <%if prev_url%> <%prev_url%> <%endif%>
<br><br>
2 next_url: <%if next_url%><%next_url%> <%endif%>
<br><br>
Vishal
-------------------------------------------------------
Here is the output for <%prev_url%>
<a href="">My Test Listing </a>
--------------------------------------------------------
Global that I am using:
Code:
sub { my $this_link_id = $_[0];
my $db = $DB->table ('Links','CatLinks');
my $cat_id = $db->select ( ['CategoryID'], { LinkID => $this_link_id } )->fetchrow;
# Figure out the next/prev links.
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( ['Links.ID','Links.Title'] => { CategoryID => $cat_id }, VIEWABLE);
my ($next, $prev, $next_title, $prev_title);
while (my ($id,$title) = $sth->fetchrow) {
if ($id == $this_link_id) {
($next,$next_title) = $sth->fetchrow_array;
last;
}
else {
$prev = $id;
$prev_title = $title;
}
}
my ($next_url, $prev_url);
if ($next) {
my $next_link = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $next );
$next_url = qq~<a href="$next_link">$next_title</a>~;
}
if ($prev) {
my $prev_link = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $prev );
$prev_url = qq~<a href="$prev_url">$prev_title</a>~;
}
return { next_url => $next_url, prev_url => $prev_url };
}
I am calling global using (Global name = prev_next1):
Code:
<%prev_next1($ID)%> 1.prev_url : <%if prev_url%> <%prev_url%> <%endif%>
<br><br>
2 next_url: <%if next_url%><%next_url%> <%endif%>
<br><br>
Vishal
-------------------------------------------------------