$view) { $pages = ceil($total / $view); } else { $pages = FALSE; } if ($pages) { $nppage = NP_3." "; if ($pages > 10) { $current = ($from/$view)+1; for($c = 0; $c <= 2; $c++) { $nppage .= ($view * $c == $from ? "[".($c + 1)."] " : "".($c + 1)." "); } if ($current >= 3 && $current <= 5) { for($c = 3; $c <= $current; $c++) { $nppage .= ($view * $c == $from ? "[".($c+1)."] " : "".($c + 1)." "); } } else if($current >= 6 && $current <= ($pages-5)) { $nppage .= " ... "; for($c = ($current-2); $c <= $current; $c++) { $nppage .= ($view * $c == $from ? "[".($c+1)."] " : "".($c + 1)." "); } } $nppage .= " ... "; if (($current + 5) > $pages && $current != $pages) { $tmp = ($current-2); } else { $tmp = $pages-3; } for($c = $tmp; $c <= ($pages-1); $c++) { $nppage .= ($view * $c == $from ? "[".($c + 1)."] " : "".($c + 1)." "); } } else { for($c = 0; $c < $pages; $c++) { if ($view * $c == $from ? $nppage .= "[".($c + 1)."] " : $nppage .= "".($c + 1)." "); } } $text = "