Skip to content
Snippets Groups Projects
Commit 874733d5 authored by Helmo's avatar Helmo
Browse files

In search show the full result count instead of capped at 10.

parent 333d13a9
No related branches found
No related tags found
No related merge requests found
Pipeline #6628 passed
......@@ -194,8 +194,13 @@ function _search($module, $section, $additional_sql = '', $params = ''){
if(is_array($results) && !empty($results)){
$lng_file = '../'.$module.'/lib/lang/'.$_SESSION['s']['language'].'_'.$section.'.lng';
if(is_file($lng_file)) include $lng_file;
// Get the real result count, without LIMIT.
$sql_real_rows = preg_replace(array('/\*/', "/ LIMIT.*$/"), array('COUNT(*) as c', ''), $sql);
$result_count = $app->db->queryOneRecord($sql_real_rows, $db_table);
$result_array['cheader'] = array('title' => $category_title,
'total' => count($results),
'total' => $result_count['c'],
'limit' => count($results)
);
foreach($results as $result){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment