]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #4541 from rabuzarus/20180303_-_fix_directory_search
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 3 Mar 2018 19:13:51 +0000 (14:13 -0500)
committerGitHub <noreply@github.com>
Sat, 3 Mar 2018 19:13:51 +0000 (14:13 -0500)
fix page counter in directory module

mod/directory.php

index b8b0482127172fd38b4e178aa41a7f147cf4b9d6..5f3605ebffb01162a8a0abfb2a078ea76c46579b 100644 (file)
@@ -81,12 +81,12 @@ function directory_content(App $a)
        $publish = ((Config::get('system', 'publish_all')) ? '' : " AND `publish` = 1 " );
 
 
-       $total = q("SELECT COUNT(*) AS `total` FROM `profile`
-                       LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
-                       WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra "
+       $cnt = dba::select_first("SELECT COUNT(*) AS `total` FROM `profile`
+                               LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
+                               WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra "
        );
-       if (DBM::is_result($total)) {
-               $a->set_pager_total($total[0]['total']);
+       if (DBM::is_result($cnt)) {
+               $a->set_pager_total($cnt['total']);
        }
 
        $order = " ORDER BY `name` ASC ";