aboutsummaryrefslogtreecommitdiffstats
path: root/mod/search.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-03 05:54:40 -0700
committerFriendika <info@friendika.com>2011-07-03 05:54:40 -0700
commitbef68a8c7fe021bd6effc3e4bad62dbd1d229e87 (patch)
treece5dabecb7de7f036c4a66af4eecb686f40e7f10 /mod/search.php
parent3538dc15cc98cc8bba378357e6802ef48b378e0e (diff)
downloadvolse-hubzilla-bef68a8c7fe021bd6effc3e4bad62dbd1d229e87.tar.gz
volse-hubzilla-bef68a8c7fe021bd6effc3e4bad62dbd1d229e87.tar.bz2
volse-hubzilla-bef68a8c7fe021bd6effc3e4bad62dbd1d229e87.zip
posts from hidden walls not allowed in search results
Diffstat (limited to 'mod/search.php')
-rw-r--r--mod/search.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/mod/search.php b/mod/search.php
index bb33fb11d..c20d1274e 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -48,11 +48,11 @@ function search_content(&$a) {
$search_alg = $s_regx;
$r = q("SELECT COUNT(*) AS `total`
- FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `profile` ON `profile`.`uid` = `item`.`uid`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' )
+ AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `profile`.`hidewall` = 0)
OR `item`.`uid` = %d )
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `profile`.`is-default` = 1
$search_alg ",
intval(local_user()),
dbesc($search)
@@ -70,13 +70,14 @@ function search_content(&$a) {
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
- `user`.`nickname`
+ `user`.`nickname`, `profile`.`hidewall`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
- LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
+ LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
+ LEFT JOIN `profile` ON `profile`.`uid` = `item`.`uid`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' )
+ AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `profile`.`hidewall` = 0 )
OR `item`.`uid` = %d )
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `profile`.`is-default` = 1
$search_alg
ORDER BY `parent` DESC ",
intval(local_user()),