diff options
Diffstat (limited to 'includes/pager.inc')
-rw-r--r-- | includes/pager.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/pager.inc b/includes/pager.inc index 6f5a38773..c31693ec4 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -287,6 +287,7 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = "") { // count the total number of records in this query: if ($count_query == "") { $pager_total[$element] = db_result(db_query(preg_replace(array("/SELECT.*FROM/i", "/ORDER BY .*/"), array("SELECT COUNT(*) FROM", ""), $query))); + } else { $pager_total[$element] = db_result(db_query($count_query)); @@ -296,6 +297,7 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = "") { $pager_from_array = explode(",", $from); return db_query_range($query, (int)$pager_from_array[$element], (int)$limit); + } function pager_link($from_new, $attributes = array()) { @@ -329,4 +331,4 @@ function pager_load_array($value, $element, $old_array) { return $new_array; } -?> +?>
\ No newline at end of file |