 |
 |
 |
 |
 |
| Author |
Message |
DarkSlim

Joined: 06 Aug 2009 Posts: 286 Location: IL |
|
Prev - Next links for page break in Full Story! [HowTo] |
|
There was a question (from DistantJ) about making Prev and Next links
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) :
 |  |
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:
 |  |
//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:
 |  |
$output = str_replace('{pages}', $pages, $output);
|
After Add:
 |  |
$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
_________________ Portfolio: www.Yaniv.tk
Some of my Plugins and Mods and more in the CuteNewsRU Index!
Donations Accepted, Thank you
Last edited by DarkSlim on Tue Nov 10, 2009 4:53 pm; edited 1 time in total |
|
| Mon Nov 02, 2009 5:21 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
DarkSlim

Joined: 06 Aug 2009 Posts: 286 Location: IL |
|
|
| Tue Nov 10, 2009 4:52 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
 |
 |
|