We did a modification to mod.weblog.php to effect this change in behaviour.
The usage becomes:
{exp:weblog:next_entry restrict_category="yes"}
<p>Next entry: <a href="{path="news/comments"}">{title}</a></p>
{/exp:weblog:next_entry}
{exp:weblog:prev_entry restrict_category="yes"}
<p>Previous entry: <a href="{path="news/comments"}">{title}</a></p>
{/exp:weblog:prev_entry}
This is the diff patch:
*** mod.weblog.php2006-01-24 12:08:27.000000000 +0000
--- mod.weblog.php.ORIG2006-01-23 16:40:01.000000000 +0000
***************
*** 4652,4670 ****
{
$qstring = $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
}
-
- $CAT_FROM="";
- $CAT_WHERE="";
-
- if ($TMPL->fetch_param('restrict_category') == "yes") {
- $CAT_FROM=", exp_category_posts AS c1, exp_category_posts AS c2";
- $CAT_WHERE="AND t1.entry_id = c1.entry_id AND t2.entry_id = c2.entry_id AND c1.cat_id = c2.cat_id";
- }
$sql = "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs $CAT_FROM
! WHERE t1.weblog_id = exp_weblogs.weblog_id $CAT_WHERE";
!
if (is_numeric($qstring))
{
--- 4652,4661 ----
{
$qstring = $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
}
$sql = "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs
! WHERE t1.weblog_id = exp_weblogs.weblog_id ";
if (is_numeric($qstring))
{
***************
*** 4790,4807 ****
$qstring = $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
}
! $CAT_FROM="";
! $CAT_WHERE="";
!
! if ($TMPL->fetch_param('restrict_category') == "yes") {
! $CAT_FROM=", exp_category_posts AS c1, exp_category_posts AS c2";
! $CAT_WHERE="AND t1.entry_id = c1.entry_id AND t2.entry_id = c2.entry_id AND c1.cat_id = c2.cat_id";
! }
!
! $sql = "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs $CAT_FROM
! WHERE t1.weblog_id = exp_weblogs.weblog_id $CAT_WHERE";
!
if (is_numeric($qstring))
{
--- 4781,4789 ----
$qstring = $FNS->remove_double_slashes(str_replace($match['0'], '', $qstring));
}
! $sql = "SELECT t1.entry_id, t1.title, t1.url_title
! FROM exp_weblog_titles t1, exp_weblog_titles t2, exp_weblogs
! WHERE t1.weblog_id = exp_weblogs.weblog_id ";
if (is_numeric($qstring))
{
***************
*** 5384,5387 ****
}
// END CLASS
! ?>
--- 5366,5369 ----
}
// END CLASS
! ?>
\ No newline at end of file