fix local directory search
authorrabuzarus <rabuzarus@t-online.de>
Sat, 3 Mar 2018 13:06:42 +0000 (14:06 +0100)
committerrabuzarus <rabuzarus@t-online.de>
Sat, 3 Mar 2018 13:06:42 +0000 (14:06 +0100)
mod/directory.php

index d7d9ad8a6e8a19bbc7438b5164404bdb1e5a6dda..c2548b4de7066fc34e0239fca8b1924a39f5e853 100644 (file)
@@ -86,7 +86,7 @@ function directory_content(App $a) {
 
        $limit = intval($a->pager['start']).",".intval($a->pager['itemspage']);
 
-       $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`,
+       $r = dba::p("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` , `user`.`page-flags`,
                        `contact`.`addr`, `contact`.`url` AS profile_url FROM `profile`
                        LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                        LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
@@ -100,7 +100,7 @@ function directory_content(App $a) {
                        $photo = 'photo';
                }
 
-               foreach ($r as $rr) {
+               while ($rr = dba::fetch($r)) {
 
                        $itemurl= '';
 
@@ -187,6 +187,7 @@ function directory_content(App $a) {
 
                        $entries[] = $arr['entry'];
                }
+               dba::close($r);
 
                $tpl = get_markup_template('directory_header.tpl');