diff options
author | root <root@diekershoff.homeunix.net> | 2011-01-03 09:27:13 +0100 |
---|---|---|
committer | root <root@diekershoff.homeunix.net> | 2011-01-03 09:27:13 +0100 |
commit | f3005918aff04fc435d0f526bf235bd95468294c (patch) | |
tree | f334d76dbd89093d8448e13e62f8b094159e576c /mod/directory.php | |
parent | 0b4a6f8eaca0d1396e7e944cd4735a573bd1d111 (diff) | |
parent | d92659560b8edd0594b587103b43ad5bd5012639 (diff) | |
download | volse-hubzilla-f3005918aff04fc435d0f526bf235bd95468294c.tar.gz volse-hubzilla-f3005918aff04fc435d0f526bf235bd95468294c.tar.bz2 volse-hubzilla-f3005918aff04fc435d0f526bf235bd95468294c.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'mod/directory.php')
-rw-r--r-- | mod/directory.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mod/directory.php b/mod/directory.php index 062aae516..b0cee76cb 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -39,14 +39,16 @@ function directory_content(&$a) { $search = dbesc($search); $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : ""); + $publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " ); - $r = q("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `publish` = 1 AND `user`.`blocked` = 0 $sql_extra "); + + $r = 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 "); if(count($r)) $a->set_pager_total($r[0]['total']); - $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `publish` = 1 AND `user`.`blocked` = 0 $sql_extra ORDER BY `name` ASC LIMIT %d , %d ", + $r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`, `user`.`timezone` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ORDER BY `name` ASC LIMIT %d , %d ", intval($a->pager['start']), intval($a->pager['itemspage']) ); |