diff --git a/functions.inc.php b/functions.inc.php index 022cd754..3305e9e2 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -201,6 +201,10 @@ function remove_from_uri($param = "") { return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"])); } +function print_page($page) { + echo " " . ($page == $_GET["page"] ? $page + 1 : '' . ($page + 1) . ""); +} + function get_file($key) { if (isset($_POST["files"][$key])) { $length = strlen($_POST["files"][$key]); diff --git a/select.inc.php b/select.inc.php index f373e818..dc139c34 100644 --- a/select.inc.php +++ b/select.inc.php @@ -236,11 +236,8 @@ function add_row(field) { echo "\n"; echo "
\n"; echo "\n"; - if (intval($limit) && $result->num_rows >= $limit && ($found_rows = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")))) > $limit) { + if (intval($limit) && ($found_rows = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")))) > $limit) { $max_page = floor(($found_rows - 1) / $limit); - function print_page($page) { - echo " " . ($page == $_GET["page"] ? $page + 1 : '' . ($page + 1) . ""); - } echo "
" . lang('Page') . ":"; print_page(0); if ($_GET["page"] > 3) {