mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:00:16 +00:00
The notes are now fetching their content from a central function
This commit is contained in:
parent
5a171c0afd
commit
1fb5925073
2 changed files with 3 additions and 15 deletions
|
@ -491,6 +491,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($mode === 'notes') {
|
} elseif ($mode === 'notes') {
|
||||||
|
$items = conversation_add_children($items, false, $order, $uid);
|
||||||
$profile_owner = local_user();
|
$profile_owner = local_user();
|
||||||
|
|
||||||
if (!$update) {
|
if (!$update) {
|
||||||
|
|
|
@ -65,26 +65,13 @@ function notes_content(App $a, $update = false)
|
||||||
|
|
||||||
$params = ['order' => ['created' => true],
|
$params = ['order' => ['created' => true],
|
||||||
'limit' => [$a->pager['start'], $a->pager['itemspage']]];
|
'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;
|
$count = 0;
|
||||||
|
|
||||||
if (DBA::isResult($r)) {
|
if (DBA::isResult($r)) {
|
||||||
$count = count($r);
|
$count = count($r);
|
||||||
$parents_arr = [];
|
$o .= conversation($a, DBA::toArray($r), 'notes', $update);
|
||||||
|
|
||||||
while ($rr = Item::fetch($r)) {
|
|
||||||
$parents_arr[] = $rr['id'];
|
|
||||||
}
|
|
||||||
DBA::close($r);
|
|
||||||
|
|
||||||
$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 .= alt_pager($a, $count);
|
$o .= alt_pager($a, $count);
|
||||||
|
|
Loading…
Reference in a new issue