X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fnotes.php;h=da8352966e721e3f2c7698dc51668efa33db5967;hb=db0b848ae30983b394847a5597c3f7c7332cfe7c;hp=608d01cf8c63fbf1ed718788ab0eba5f5ffd3db6;hpb=c39e0dcf2a97a850c8a2cb39a05651075c295e18;p=friendica.git diff --git a/mod/notes.php b/mod/notes.php index 608d01cf8c..da8352966e 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -61,30 +61,20 @@ function notes_content(App $a, $update = false) $condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT, 'wall' => false, 'contact-id'=> $a->contact['id']]; - $a->set_pager_itemspage(40); + $a->setPagerItemsPage(40); $params = ['order' => ['created' => true], 'limit' => [$a->pager['start'], $a->pager['itemspage']]]; - $r = Item::selectForUser(local_user(), ['id'], $condition, $params); + $r = Item::selectThreadForUser(local_user(), ['uri'], $condition, $params); $count = 0; if (DBA::isResult($r)) { - $count = count($r); - $parents_arr = []; + $notes = DBA::toArray($r); - while ($rr = Item::fetch($r)) { - $parents_arr[] = $rr['id']; - } - DBA::close($r); + $count = count($notes); - $condition = ['uid' => local_user(), 'parent' => $parents_arr]; - $result = Item::selectForUser(local_user(), [], $condition); - - if (DBA::isResult($result)) { - $items = conv_sort(Item::inArray($result), 'commented'); - $o .= conversation($a, $items, 'notes', $update); - } + $o .= conversation($a, $notes, 'notes', $update); } $o .= alt_pager($a, $count);