Skip to content

Commit 874733d

Browse files
committed
In search show the full result count instead of capped at 10.
1 parent 333d13a commit 874733d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

interface/web/dashboard/ajax_get_json.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,13 @@ function _search($module, $section, $additional_sql = '', $params = ''){
194194
if(is_array($results) && !empty($results)){
195195
$lng_file = '../'.$module.'/lib/lang/'.$_SESSION['s']['language'].'_'.$section.'.lng';
196196
if(is_file($lng_file)) include $lng_file;
197+
198+
// Get the real result count, without LIMIT.
199+
$sql_real_rows = preg_replace(array('/\*/', "/ LIMIT.*$/"), array('COUNT(*) as c', ''), $sql);
200+
$result_count = $app->db->queryOneRecord($sql_real_rows, $db_table);
201+
197202
$result_array['cheader'] = array('title' => $category_title,
198-
'total' => count($results),
203+
'total' => $result_count['c'],
199204
'limit' => count($results)
200205
);
201206
foreach($results as $result){

0 commit comments

Comments
 (0)