--- category.php Tue Nov 21 17:40:24 2006 +++ category-CHANGED.php Fri Nov 24 23:21:39 2006 @@ -296,7 +296,11 @@ // be moved up and down beyond the paging border if ($totalcount > $perpage) { $atfirstpage = ($page == 0); - $atlastpage = (($page + 1) == ceil($totalcount / $perpage)); + if ($perpage > 0) { + $atlastpage = (($page + 1) == ceil($totalcount / $perpage)); + } else { + $atlastpage = true; + } } else { $atfirstpage = true; $atlastpage = true;