1) { $paginate .= "
"; // Previous if ($page > 1){ $paginate.= "previous"; }else{ $paginate.= "previous"; } // Pages if ($lastpage < 7 + ($stages * 2)) // Not enough pages to breaking it up { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page){ $paginate.= "$counter"; }else{ $paginate.= "$counter";} } } elseif($lastpage > 5 + ($stages * 2)) // Enough pages to hide a few? { // Beginning only hide later pages if($page < 1 + ($stages * 2)) { for ($counter = 1; $counter < 4 + ($stages * 2); $counter++) { if ($counter == $page){ $paginate.= "$counter"; }else{ $paginate.= "$counter";} } $paginate.= "..."; $paginate.= "$LastPagem1"; $paginate.= "$lastpage"; } // Middle hide some front and some back elseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2)) { $paginate.= "1"; $paginate.= "2"; $paginate.= "..."; for ($counter = $page - $stages; $counter <= $page + $stages; $counter++) { if ($counter == $page){ $paginate.= "$counter"; }else{ $paginate.= "$counter";} } $paginate.= "..."; $paginate.= "$LastPagem1"; $paginate.= "$lastpage"; } // End only hide early pages else { $paginate.= "1"; $paginate.= "2"; $paginate.= "..."; for ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page){ $paginate.= "$counter"; }else{ $paginate.= "$counter";} } } } // Next if ($page < $counter - 1){ $paginate.= "next"; }else{ $paginate.= "next"; } $paginate.= "
"; } // pagination // echo $paginate; ?>
500) { // $post = substr($post,0,500)." ... ."; } echo "

$title1

"; echo "
"; echo "

$post1

"; echo "
"; ?>
"; echo $paginate; echo "
"; echo "
"; echo ""; include "bawah.php"; ?>