Replace legacy file/category handling

This commit is contained in:
Michael 2021-01-21 07:16:41 +00:00
parent 0668b2dfd5
commit d2ea3eabfb
14 changed files with 103 additions and 253 deletions

View file

@ -63,22 +63,6 @@ class Post
}
}
if (!array_key_exists('verb', $row) || in_array($row['verb'], ['', Activity::POST, Activity::SHARE])) {
// Build the file string out of the term entries
if (array_key_exists('file', $row)) {
if ($row['internal-file-count'] > 0) {
$row['file'] = Post\Category::getTextByURIId($row['internal-uri-id'], $row['internal-uid']);
} else {
$row['file'] = '';
}
}
}
// Remove internal fields
unset($row['internal-file-count']);
unset($row['internal-uri-id']);
unset($row['internal-uid']);
return $row;
}
@ -213,7 +197,6 @@ class Post
}
}
$selected = array_merge($selected, ['internal-uri-id', 'internal-uid', 'internal-file-count']);
$selected = array_unique($selected);
return DBA::select($view, $selected, $condition, $params);
@ -267,8 +250,6 @@ class Post
$selected = Item::DISPLAY_FIELDLIST;
}
$selected = array_unique(array_merge($selected, ['internal-uri-id', 'internal-uid', 'internal-file-count']));
$condition = DBA::mergeConditions($condition,
["`visible` AND NOT `deleted` AND NOT `moderated`
AND NOT `author-blocked` AND NOT `owner-blocked`