aboutsummaryrefslogtreecommitdiffstats
path: root/mod/network.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-09-08 05:37:14 -0700
committerfabrixxm <fabrix.xm@gmail.com>2011-09-08 05:37:14 -0700
commit68c23f6c86e2f2e24548b179f00b5bcd5ab8ba87 (patch)
treee3f3dcf6d278d913206f74eb4d3bfeb13fb02a3c /mod/network.php
parent0bd10ae01a564d0c3a700e1d9baae34c68abb881 (diff)
parentad7c111c7c0388678c6479ce9a282ce18a291c29 (diff)
downloadvolse-hubzilla-68c23f6c86e2f2e24548b179f00b5bcd5ab8ba87.tar.gz
volse-hubzilla-68c23f6c86e2f2e24548b179f00b5bcd5ab8ba87.tar.bz2
volse-hubzilla-68c23f6c86e2f2e24548b179f00b5bcd5ab8ba87.zip
Merge pull request #171 from fabrixxm/master
fix to network page conversations sort
Diffstat (limited to 'mod/network.php')
-rw-r--r--mod/network.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/mod/network.php b/mod/network.php
index 7d2f48d0c..6684889e3 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -320,7 +320,8 @@ function network_content(&$a, $update = 0) {
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
, (SELECT `_com`.`parent`,max(`_com`.`created`) as `created`
FROM `item` AS `_com`
- WHERE `_com`.`uid`=%d AND `_com`.`parent`!=`id`
+ WHERE `_com`.`uid`=%d AND
+ (`_com`.`parent`!=`_com`.`id` OR `_com`.`id` NOT IN (SELECT `__com`.`parent` FROM `item` as `__com` WHERE `__com`.`parent`!=`__com`.`id`))
GROUP BY `_com`.`parent` ORDER BY `created` DESC) AS `com`
WHERE `item`.`id`=`com`.`parent` AND
`item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
@@ -333,7 +334,6 @@ function network_content(&$a, $update = 0) {
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
-
// Then fetch all the children of the parents that are on this page
$parents_arr = array();
@@ -351,7 +351,8 @@ function network_content(&$a, $update = 0) {
FROM `item`, `contact`,
(SELECT `_com`.`parent`,max(`_com`.`created`) as `created`
FROM `item` AS `_com`
- WHERE `_com`.`uid`=%d AND `_com`.`parent`!=`id`
+ WHERE `_com`.`uid`=%d AND
+ (`_com`.`parent`!=`_com`.`id` OR `_com`.`id` NOT IN (SELECT `__com`.`parent` FROM `item` as `__com` WHERE `__com`.`parent`!=`__com`.`id`))
GROUP BY `_com`.`parent` ORDER BY `created` DESC) AS `com`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`id` = `item`.`contact-id`