]> git.mxchange.org Git - friendica.git/commitdiff
list network page (parent items) by creation date thx:fabrix
authorFriendika <info@friendika.com>
Wed, 19 Jan 2011 03:41:30 +0000 (19:41 -0800)
committerFriendika <info@friendika.com>
Wed, 19 Jan 2011 03:41:30 +0000 (19:41 -0800)
mod/network.php

index 5073b8a61d28269a11b3462a26c534d7d20b9254..c761af81041db633b262921c04ee4c94c13b4777 100644 (file)
@@ -134,11 +134,14 @@ function network_content(&$a, $update = 0) {
                `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
                `contact`.`network`, `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`
+               FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent`=`p`.`id`) as `parentitem`,
+             `contact` 
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+               AND `contact`.`id` = `item`.`contact-id`
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+               AND `item`.`parent` = `parentitem`.`id`
                $sql_extra
-               ORDER BY `parent` DESC, `gravity` ASC, `created` ASC LIMIT %d ,%d ",
+               ORDER BY `parentitem`.`created`  DESC, `item`.`gravity` ASC, `item`.`created` ASC LIMIT %d ,%d ",
                intval($_SESSION['uid']),
                intval($a->pager['start']),
                intval($a->pager['itemspage'])