Neroo Posted July 30, 2013 Share Posted July 30, 2013 http://pastebin.com/D8rFkzrs Basically writing a forum for my website and I'm sorting the forums into pages (10 topics per page), but I only want a maximum of 10 pages to show. (eg: Pages: 1 2 3 4 5 6 7 8 9 10) Anybody know how to do this? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/280649-php-page-ordering-help-please/ Share on other sites More sharing options...
jcbones Posted July 30, 2013 Share Posted July 30, 2013 (edited) Yes, add to: $pages = ceil($posts_topic/$posts_per_page); Adding this line under it: $pages = ($pages <= 10) ? $pages : 10; This should limit the number of pages to 10 maximum, but if you only have 8, then 8 will be shown. Edited July 30, 2013 by jcbones Quote Link to comment https://forums.phpfreaks.com/topic/280649-php-page-ordering-help-please/#findComment-1442733 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.