ted_chou12 Posted September 23, 2007 Share Posted September 23, 2007 Hello, I wish someone to check this for me: <?php //Page Range sorting: if ($page <= 5 && $totalpages >= 11) {$pagelowerlim = 1;$pageupperlim = 11;} elseif ($page <= 5 && $totalpages < 11) {$pagelowerlim = 1;$pageupperlim = $totalpages;} elseif ($page > 5 && 1 > ($totalpages - 10)) {$pagelowerlim = 1;$pageupperlim = $totalpages;} elseif ($page > 5 && $page < ($totalpages - 4)) {$pagelowerlim = $page - 5;$pageupperlim = $page + 5;} else {$pagelowerlim = $totalpages - 10;$pageupperlim = $totalpages;} ?> This code is suppose to give a range of 10 with the current page the median, down by 5 and up by 5: so the page links would look like 1 2 3 4 5 6 7 8 9 10 11 other examples: 1 2 3 4 5 6 7 8 9 10 11 if there are 15 pages: 5 6 7 8 9 10 11 12 13 14 15 The basic rules are: there are always 11 numbers. if the page is less than 6, the limit is always 11, and the min is 1. if the page is less than 5 away from the total page number, the upper limit is the total page number, and the lower limit is 10 away from the limit. Sorry to confuse you, but I had tried my best to explain it, please check for the validity, and improve it for more aligancy if possible. Thanks, Ted. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 23, 2007 Share Posted September 23, 2007 I get what it's supposed to do but why didn't you just test it yourself? What is the problem? And wtf is "aligancy"? Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 23, 2007 Share Posted September 23, 2007 And wtf is "aligancy"? It might be what crocodiles wish they had, but more likely it's an alternate for 'elegant' Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted September 23, 2007 Author Share Posted September 23, 2007 sorry. i misspelled it... but i guess u could still have guessed by the context couldn't u? Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 23, 2007 Share Posted September 23, 2007 Obviously not...You know, Firefox 2 has a built-in spelling checker. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.