- $parents_str = implode(', ', $parents_arr);
-
- $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
- `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`,
- `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
- `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`.`moderated` = 0 AND `item`.`deleted` = 0
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
- AND `item`.`parent` IN ( %s )
- $sql_extra
- ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ",
- intval(local_user()),
- dbesc($parents_str)
- );
-
- if(count($r)) {
- $items = conv_sort($r,"`commented`");
-
- $o .= conversation($a,$items,'notes',$update);