Hi stevenlyons,
in my example i've put the code into a
separat content-part at the bottom of each article.
{BROWSE:PREV:previous book:
x} | {BROWSE:NEXT:next book:
y}
In the first article i set x = 0 and y = 1 , to set the previous-limit here
In the last article i set x = 1 and y = 0 , to set the next-limit here
In all other cases i set x = 1 and y = 1 , previous and next is allowed
OK, i know: thats not the perfect solution.
If i ADD a new article, which is set at the top of the list by phpwcms, i must change the sequence "by hand", so that my "old 1. article" becomes the FIRST again.
That's only a workaround, but i am an absolute newbee in PHP and have no better solution. The php-freaks inside this forum, will have a better one, i'm shure.
-------
A few minutes ago, i'v made a little tryout, to spare the contentparts with the
code in each article.
I have put the following code into my template:
----------------------------------------------------------------------------------
<div>{BROWSE:PREV:backward:
{PHP:script/backward_check.php}} | {BROWSE:NEXT:forward:
{PHP:script/forward_check.php}}</div>
----------------------------------------------------------------------------------
Inside the two scripts i have a code simmilar to:
----------------------------------------------------------------------------------
<?php
//* xxx = structure-ID | string between '...' = exchange for {PHP:script/backward_check.php} |
//* example: case xx: echo '0'; break; <= if you want to disable the action
//* example: case xx: echo '1'; break; <= if you want to enable the action
switch($GLOBALS['content']['cat_id']) {
case 11: echo '0'; break;
case 17: echo '0'; break;
default: echo '1';
}
?>
----------------------------------------------------------------------------------
It works verry well on my localhost, but the change by hand of the 1. article, wenn adding a new, remains
kind regards