- Patch #78364 by chx: remove pager cruft.

5.x
Dries Buytaert 2006-08-16 19:52:37 +00:00
parent 3ace12caf8
commit b31b892900
1 changed files with 4 additions and 12 deletions

View File

@ -69,18 +69,10 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = NULL) {
$pager_page_array = explode(',', $page);
// We calculate the total of pages as ceil(items / limit).
if (count($args)) {
$pager_total_items[$element] = db_result(db_query($count_query, $args));
$pager_total[$element] = ceil($pager_total_items[$element] / $limit);
$pager_page_array[$element] = max(0, min((int)$pager_page_array[$element], ((int)$pager_total[$element]) - 1));
return db_query_range($query, $args, $pager_page_array[$element] * $limit, $limit);
}
else {
$pager_total_items[$element] = db_result(db_query($count_query));
$pager_total[$element] = ceil($pager_total_items[$element] / $limit);
$pager_page_array[$element] = max(0, min((int)$pager_page_array[$element], ((int)$pager_total[$element]) - 1));
return db_query_range($query, $pager_page_array[$element] * $limit, $limit);
}
$pager_total_items[$element] = db_result(db_query($count_query, $args));
$pager_total[$element] = ceil($pager_total_items[$element] / $limit);
$pager_page_array[$element] = max(0, min((int)$pager_page_array[$element], ((int)$pager_total[$element]) - 1));
return db_query_range($query, $args, $pager_page_array[$element] * $limit, $limit);
}
/**