in full story (when dividing the post to pages using 'pagebreak' or 'nextpage' as it is also called)
Here is a way to do it:
Open inc/show.news.php
Find (it may look a bit different since I modified it (as I wrote here here) :
- Code: Select all
if ($page_count > 1){
$output = str_replace('[page-link]', '', $output);
$output = str_replace('[/page-link]', '', $output);
for ($i = 1; $i < $page_count + 1; $i++){
if (($page and $page == $i) or ($allow_full_story and !$page and $i == 1)){
$pages .= ' <b>'.$i.'</b> ';
} else {
$pages .= ' <a href="'.$PHP_SELF.'?id='.$row[id].'&page='.$i.'">'.$i.'</a> ';
}
}
Under Add:
- Code: Select all
//DarkSlim's code for next/prev links in full story
if(isset($page)){
if ($page != $page_count){
$nextc = $page + 1;
$nextpage .= '<a href="'.$PHP_SELF.'?id='.$row[id].'&page='.$nextc.'">NEXT</a>';
}
if ($page != '1'){
$prevc = $page - 1;
$prevpage .= '<a href="'.$PHP_SELF.'?id='.$row[id].'&page='.$prevc.'">PREV</a>';
}
} else {
$nextc = '2';
$nextpage .= '<a href="'.$PHP_SELF.'?id='.$row[id].'&page='.$nextc.'">NEXT</a>';
}
* You can change the words NEXT and PREV for whatever you like
You can replace them with image buttons too (html syntax)
Then, Find:
- Code: Select all
$output = str_replace('{pages}', $pages, $output);
After Add:
- Code: Select all
$output = str_replace('{nextpages}', $nextpage, $output);
$output = str_replace('{prevpages}', $prevpage, $output);
That's it! edit your template and instead of just {pages} use the new tags!
Like this for example:
[page-link]{prevpages}({pages}){nextpages}[/page-link]
Use it as you like, hope this helps.
Edit: I fixed a bug in the code when you first enter the post and the $page variable is not yet set
Now it works perfectly (if you have any other questions or suggestions i'de love to hear)
DarkSlim
