almightyegg Posted June 24, 2007 Share Posted June 24, 2007 I have a message board page that displays one page of one forums' messages using pagination. It all works really well unless there are no messages in which case nothing below the bit in the pagination code that echoes 'first prev [1] [2] ... next last' is shown. Below this section I have the form to add a thread and some links, but they aren't shown because of this problem in the script. This means that the first message in each forum can only be put in from PhpMyAdmin or by a script I make specifically for it. <? echo "<center>"; if($page > 1){ $prev = ($page - 1); echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=1'>First</a> "; echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$prev'>Prev</a> "; } for($i = ($page - 2); $i <= ($page + 2); $i++){ if (($i >= 1) && ($i <= $total_pages)) { echo ($page == $i) ? "[$i] " : "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$i'>$i</a> "; } } if($page < $total_pages){ $next = ($page + 1); echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$next'>Next</a> "; echo "<a href='{$_SERVER['PHP_SELF']}?f=$f&page=$total_pages'>Last</a>"; } echo "</center>"; ?> Nothing below that is shown and it echoes no errors... Quote Link to comment Share on other sites More sharing options...
almightyegg Posted June 27, 2007 Author Share Posted June 27, 2007 Any ideas??? ??? 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.