aboutsummaryrefslogtreecommitdiffstats
path: root/mod/search.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-05 23:23:43 -0700
committerFriendika <info@friendika.com>2011-07-05 23:23:43 -0700
commit84d12c3e08ae4b6fe228ce881b0c1570175d1667 (patch)
treebb8f4ccca207ff6c226cf79f4ce348c5bc8d9df9 /mod/search.php
parentc221d5ea597040c27a8918f9c08629e979a6e273 (diff)
downloadvolse-hubzilla-84d12c3e08ae4b6fe228ce881b0c1570175d1667.tar.gz
volse-hubzilla-84d12c3e08ae4b6fe228ce881b0c1570175d1667.tar.bz2
volse-hubzilla-84d12c3e08ae4b6fe228ce881b0c1570175d1667.zip
move hidewall to user table - queries are getting too complicated and servers falling over
Diffstat (limited to 'mod/search.php')
-rw-r--r--mod/search.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/mod/search.php b/mod/search.php
index d6ab1bb60..9b465c0e5 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` LEFT JOIN `profile` ON `profile`.`uid` = `item`.`uid`
+ FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`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 `profile`.`hidewall` = 0)
+ AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `user`.`hidewall` = 0)
OR `item`.`uid` = %d )
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `profile`.`is-default` = 1
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$search_alg ",
intval(local_user()),
dbesc($search)
@@ -70,14 +70,13 @@ 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`, `profile`.`hidewall`
+ `user`.`nickname`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
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 `profile`.`hidewall` = 0 )
+ AND (( `wall` = 1 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `user`.`hidewall` = 0 )
OR `item`.`uid` = %d )
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `profile`.`is-default` = 1
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$search_alg
ORDER BY `received` DESC LIMIT %d , %d ",
intval(local_user()),