aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-13 00:43:44 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-13 00:43:44 -0700
commite79cb38217a51fb9142d3ba3c0763c9742b28f64 (patch)
tree7a3cdf72677dbdad3f73b620e37c77c06c90e5c7
parent03664327ce8569b863946882771bbbf08b30d7ad (diff)
downloadvolse-hubzilla-e79cb38217a51fb9142d3ba3c0763c9742b28f64.tar.gz
volse-hubzilla-e79cb38217a51fb9142d3ba3c0763c9742b28f64.tar.bz2
volse-hubzilla-e79cb38217a51fb9142d3ba3c0763c9742b28f64.zip
fix regression in profile query
-rw-r--r--mod/profile.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/mod/profile.php b/mod/profile.php
index 5e1f5dfdc..2356f913e 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -186,7 +186,8 @@ function profile_content(&$a, $update = false) {
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND NOT `item`.`type` IN ( 'remote', 'net-comment') AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` != 'remote')
$sql_extra ",
intval($a->profile['uid'])
@@ -195,14 +196,14 @@ function profile_content(&$a, $update = false) {
if(count($r))
$a->set_pager_total($r[0]['total']);
-
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`,
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND NOT `item`.`type` IN ( 'remote', 'net-comment') AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` != 'remote')
$sql_extra
ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
intval($a->profile['uid']),