Use predefined field lists

This commit is contained in:
Michael 2018-06-17 06:27:52 +00:00
commit 0280a46ab4
9 changed files with 54 additions and 40 deletions

View file

@ -349,7 +349,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
$condition = ["`item`.`parent-uri` = (SELECT `parent-uri` FROM `item` WHERE `id` = ?)
AND `item`.`uid` IN (0, ?) " . $sql_extra, $item_id, local_user()];
$params = ['order' => ['uid', 'parent' => true, 'gravity', 'id']];
$r = Item::select(local_user(), [], $condition, $params);
$r = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
if (!DBM::is_result($r)) {
notice(L10n::t('Item not found.') . EOL);

View file

@ -455,7 +455,7 @@ function networkFlatView(App $a, $update = 0)
}
$params = ['order' => ['id' => true], 'limit' => [$a->pager['start'], $a->pager['itemspage']]];
$result = Item::select(local_user(), [], $condition, $params);
$result = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
$items = dba::inArray($result);
$condition = ['unseen' => true, 'uid' => local_user()];

View file

@ -79,7 +79,7 @@ function notes_content(App $a, $update = false)
dba::close($r);
$condition = ['uid' => local_user(), 'parent' => $parents_arr];
$result = Item::select(local_user(), [], $condition);
$result = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition);
if (DBM::is_result($result)) {
$items = conv_sort(dba::inArray($result), 'commented');
$o .= conversation($a, $items, 'notes', $update);

View file

@ -338,7 +338,7 @@ function profile_content(App $a, $update = 0)
}
$condition = ['uid' => $a->profile['profile_uid'], 'parent' => $parents_arr];
$result = Item::select($a->profile['profile_uid'], [], $condition);
$result = Item::select($a->profile['profile_uid'], Item::DISPLAY_FIELDLIST, $condition);
$items = conv_sort(dba::inArray($result), 'created');
} else {
$items = [];

View file

@ -211,7 +211,7 @@ function search_content(App $a) {
}
dba::close($terms);
$items = Item::select(local_user(), [], ['id' => array_reverse($itemids)]);
$items = Item::select(local_user(), Item::DISPLAY_FIELDLIST, ['id' => array_reverse($itemids)]);
$r = dba::inArray($items);
} else {
logger("Start fulltext search for '".$search."'", LOGGER_DEBUG);
@ -221,7 +221,7 @@ function search_content(App $a) {
local_user(), $search];
$params = ['order' => ['id' => true],
'limit' => [$a->pager['start'], $a->pager['itemspage']]];
$items = Item::select(local_user(), [], $condition, $params);
$items = Item::select(local_user(), Item::DISPLAY_FIELDLIST, $condition, $params);
$r = dba::inArray($items);
}