-- ------------------------------------------
-- Friendica 2021.03-dev (Red Hot Poker)
--- DB_UPDATE_VERSION 1393
+-- DB_UPDATE_VERSION 1394
-- ------------------------------------------
`item`.`id` AS `id`,
`item`.`id` AS `item_id`,
`item`.`uid` AS `uid`,
- `item`.`uid` AS `internal-uid`,
`item`.`parent` AS `parent`,
`item`.`uri` AS `uri`,
`item`.`uri-id` AS `uri-id`,
- `item`.`uri-id` AS `internal-uri-id`,
`item`.`parent-uri` AS `parent-uri`,
`item`.`parent-uri-id` AS `parent-uri-id`,
`item`.`thr-parent` AS `thr-parent`,
`item`.`network` AS `network`,
`item`.`vid` AS `vid`,
`item`.`psid` AS `psid`,
- `item`.`attach` AS `attach`,
- (SELECT COUNT(*) FROM `post-category` WHERE `post-category`.`uri-id` = `item`.`uri-id`) AS `internal-file-count`,
- NULL AS `file`,
IF (`item`.`vid` IS NULL, '', `verb`.`name`) AS `verb`,
`item-content`.`title` AS `title`,
`item-content`.`content-warning` AS `content-warning`,
`thread`.`iid` AS `iid`,
`item`.`id` AS `item_id`,
`thread`.`uid` AS `uid`,
- `item`.`uid` AS `internal-uid`,
`item`.`parent` AS `parent`,
`item`.`uri` AS `uri`,
`item`.`uri-id` AS `uri-id`,
- `item`.`uri-id` AS `internal-uri-id`,
`item`.`parent-uri` AS `parent-uri`,
`item`.`parent-uri-id` AS `parent-uri-id`,
`item`.`thr-parent` AS `thr-parent`,
`thread`.`network` AS `network`,
`item`.`vid` AS `vid`,
`item`.`psid` AS `psid`,
- `item`.`attach` AS `attach`,
- (SELECT COUNT(*) FROM `post-category` WHERE `post-category`.`uri-id` = `item`.`uri-id`) AS `internal-file-count`,
- NULL AS `file`,
IF (`item`.`vid` IS NULL, '', `verb`.`name`) AS `verb`,
`item-content`.`title` AS `title`,
`item-content`.`content-warning` AS `content-warning`,
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
-use Friendica\Model\FileTag;
-use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Util\Crypto;
}
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
- 'type', 'body', 'title', 'file', 'wall', 'post-type', 'guid'];
+ 'type', 'body', 'title', 'uri-id', 'wall', 'post-type', 'guid'];
$item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
'$jotnets' => $jotnets,
'$title' => $item['title'],
'$placeholdertitle' => DI::l10n()->t('Set title'),
- '$category' => FileTag::fileToList($item['file'], 'category'),
+ '$category' => Post\Category::getCSVByURIId($item['uri-id'], local_user(), Post\Category::CATEGORY),
'$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
'$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
$verb = $orig_post['verb'];
$objecttype = $orig_post['object-type'];
$app = $orig_post['app'];
- $categories = $orig_post['file'] ?? '';
+ $categories = Post\Category::getTextByURIId($orig_post['uri-id'], $orig_post['uid']);
$title = trim($_REQUEST['title'] ?? '');
$body = trim($body);
$private = $orig_post['private'];
$filedas = FileTag::fileToArray($categories);
}
- // save old and new categories, so we can determine what needs to be deleted from pconfig
- $categories_old = $categories;
$categories = FileTag::listToFile(trim($_REQUEST['category'] ?? ''), 'category');
- $categories_new = $categories;
if (!empty($filedas) && is_array($filedas)) {
// append the fileas stuff to the new categories list
Item::update($fields, ['id' => $post_id]);
- // update filetags in pconfig
- FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category');
-
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
Tag::createImplicitMentions($datarray['uri-id'], $datarray['thr-parent-id']);
}
- // update filetags in pconfig
- FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category');
-
// These notifications are sent if someone else is commenting other your wall
if ($contact_record != $author) {
if ($toplevel_item_id) {
use Friendica\Database\DBA;
use Friendica\Model\Contact;
-use Friendica\Model\FileTag;
use Friendica\Model\Tag;
+use Friendica\Model\Post;
/**
* A content helper class for displaying items
$folders = [];
$first = true;
- foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
+ foreach (Post\Category::getArrayByURIId($item['uri-id'], $item['uid'], Post\Category::CATEGORY) as $savedFolderName) {
if (!empty($item['author-link'])) {
$url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName);
} else {
}
if (local_user() == $item['uid']) {
- foreach (FileTag::fileToArray($item['file'] ?? '') as $savedFolderName) {
+ foreach (Post\Category::getArrayByURIId($item['uri-id'], $item['uid'], Post\Category::FILE) as $savedFolderName) {
$folders[] = [
'name' => $savedFolderName,
'url' => "#",
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
-use Friendica\Model\FileTag;
use Friendica\Model\Group;
use Friendica\Model\Item;
+use Friendica\Model\Post;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
return '';
}
- $saved = DI::pConfig()->get(local_user(), 'system', 'filetags');
- if (!strlen($saved)) {
- return;
- }
-
$terms = [];
- foreach (FileTag::fileToArray($saved) as $savedFolderName) {
+ foreach (Post\Category::getArray(local_user(), Post\Category::FILE) as $savedFolderName) {
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
}
-
- usort($terms, function ($a, $b) {
- return strcmp($a['name'], $b['name']);
- });
return self::filter(
'file',
return '';
}
- $saved = DI::pConfig()->get($uid, 'system', 'filetags');
- if (!strlen($saved)) {
- return;
- }
-
$terms = array();
- foreach (FileTag::fileToArray($saved, 'category') as $savedFolderName) {
+ foreach (Post\Category::getArray(local_user(), Post\Category::CATEGORY) as $savedFolderName) {
$terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName];
}
namespace Friendica\Model;
use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model\Post\Category;
/**
* This class handles FileTag related functions
*
* @return string The URL encoded string.
*/
- public static function encode($s)
+ private static function encode($s)
{
return str_replace(['<', '>', '[', ']'], ['%3c', '%3e', '%5b', '%5d'], $s);
}
*
* @return string The decoded string.
*/
- public static function decode($s)
+ private static function decode($s)
{
return str_replace(['%3c', '%3e', '%5b', '%5d'], ['<', '>', '[', ']'], $s);
}
- /**
- * Query files for tag
- *
- * @param string $table The table to be queired.
- * @param string $s The search term
- * @param string $type Optional file type.
- *
- * @return string Query string.
- */
- public static function fileQuery($table, $s, $type = 'file')
- {
- if ($type == 'file') {
- $str = preg_quote('[' . str_replace('%', '%%', self::encode($s)) . ']');
- } else {
- $str = preg_quote('<' . str_replace('%', '%%', self::encode($s)) . '>');
- }
-
- return " AND " . (($table) ? DBA::escape($table) . '.' : '') . "file regexp '" . DBA::escape($str) . "' ";
- }
-
/**
* Get file tags from array
*
return self::arrayToFile($list_array, $type);
}
- /**
- * Get list from file tags
- *
- * ex. given <music><video>[friends], return music,video or friends
- * @param string $file File tags
- * @param string $type Optional file type.
- *
- * @return string Comma delimited list of tag names.
- * @deprecated since 2019.06 use fileToArray() instead
- */
- public static function fileToList(string $file, $type = 'file')
- {
- return implode(',', self::fileToArray($file, $type));
- }
-
- /**
- * Update file tags in PConfig
- *
- * @param int $uid Unique Identity.
- * @param string $file_old Categories previously associated with an item
- * @param string $file_new New list of categories for an item
- * @param string $type Optional file type.
- *
- * @return boolean A value indicating success or failure.
- * @throws \Exception
- */
- public static function updatePconfig(int $uid, string $file_old, string $file_new, string $type = 'file')
- {
- if (!intval($uid)) {
- return false;
- } elseif ($file_old == $file_new) {
- return true;
- }
-
- $saved = DI::pConfig()->get($uid, 'system', 'filetags');
-
- if (strlen($saved)) {
- if ($type == 'file') {
- $lbracket = '[';
- $rbracket = ']';
- $termtype = Category::FILE;
- } else {
- $lbracket = '<';
- $rbracket = '>';
- $termtype = Category::CATEGORY;
- }
-
- $filetags_updated = $saved;
-
- // check for new tags to be added as filetags in pconfig
- $new_tags = [];
- foreach (self::fileToArray($file_new, $type) as $tag) {
- if (!stristr($saved, $lbracket . self::encode($tag) . $rbracket)) {
- $new_tags[] = $tag;
- }
- }
-
- $filetags_updated .= self::arrayToFile($new_tags, $type);
-
- // check for deleted tags to be removed from filetags in pconfig
- $deleted_tags = [];
- foreach (self::fileToArray($file_old, $type) as $tag) {
- if (!stristr($file_new, $lbracket . self::encode($tag) . $rbracket)) {
- $deleted_tags[] = $tag;
- }
- }
-
- foreach ($deleted_tags as $key => $tag) {
- if (DBA::exists('category-view', ['name' => $tag, 'type' => $termtype, 'uid' => $uid])) {
- unset($deleted_tags[$key]);
- } else {
- $filetags_updated = str_replace($lbracket . self::encode($tag) . $rbracket, '', $filetags_updated);
- }
- }
-
- if ($saved != $filetags_updated) {
- DI::pConfig()->set($uid, 'system', 'filetags', $filetags_updated);
- }
-
- return true;
- } elseif (strlen($file_new)) {
- DI::pConfig()->set($uid, 'system', 'filetags', $file_new);
- }
-
- return true;
- }
-
/**
* Add tag to file
*
return false;
}
- $item = Post::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
+ $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => $uid]);
if (DBA::isResult($item)) {
- if (!stristr($item['file'], '[' . self::encode($file) . ']')) {
- $fields = ['file' => $item['file'] . '[' . self::encode($file) . ']'];
- Item::update($fields, ['id' => $item_id]);
- }
-
- $saved = DI::pConfig()->get($uid, 'system', 'filetags');
+ $stored_file = Post\Category::getTextByURIId($item['uri-id'], $uid);
- if (!strlen($saved) || !stristr($saved, '[' . self::encode($file) . ']')) {
- DI::pConfig()->set($uid, 'system', 'filetags', $saved . '[' . self::encode($file) . ']');
+ if (!stristr($stored_file, '[' . self::encode($file) . ']')) {
+ Post\Category::storeTextByURIId($item['uri-id'], $uid, $stored_file . '[' . self::encode($file) . ']');
}
}
if ($cat == true) {
$pattern = '<' . self::encode($file) . '>';
- $termtype = Category::CATEGORY;
} else {
$pattern = '[' . self::encode($file) . ']';
- $termtype = Category::FILE;
}
- $item = Post::selectFirst(['file'], ['id' => $item_id, 'uid' => $uid]);
-
+ $item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => $uid]);
if (!DBA::isResult($item)) {
return false;
}
- $fields = ['file' => str_replace($pattern, '', $item['file'])];
-
- Item::update($fields, ['id' => $item_id]);
+ $file = Post\Category::getTextByURIId($item['uri-id'], $uid);
- if (!DBA::exists('category-view', ['name' => $file, 'type' => $termtype, 'uid' => $uid])) {
- $saved = DI::pConfig()->get($uid, 'system', 'filetags');
- DI::pConfig()->set($uid, 'system', 'filetags', str_replace($pattern, '', $saved));
- }
+ Post\Category::storeTextByURIId($item['uri-id'], $uid, str_replace($pattern, '', $file));
return true;
}
const DISPLAY_FIELDLIST = [
'uid', 'id', 'parent', 'uri-id', 'uri', 'thr-parent', 'parent-uri', 'guid', 'network', 'gravity',
'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink',
- 'wall', 'private', 'starred', 'origin', 'title', 'body', 'file', 'language',
+ 'wall', 'private', 'starred', 'origin', 'title', 'body', 'language',
'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object',
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'item_id',
'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network',
'contact-id', 'type', 'wall', 'gravity', 'extid', 'psid',
'created', 'edited', 'commented', 'received', 'changed', 'verb',
'postopts', 'plink', 'resource-id', 'event-id', 'inform',
- 'file', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'post-type',
+ 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'post-type',
'private', 'pubmail', 'moderated', 'visible', 'starred', 'bookmark',
'unseen', 'deleted', 'origin', 'forum_mode', 'mention', 'global', 'network',
'title', 'content-warning', 'body', 'location', 'coord', 'app',
// We cannot simply expand the condition to check for origin entries
// The condition needn't to be a simple array but could be a complex condition.
// And we have to execute this query before the update to ensure to fetch the same data.
- $items = DBA::select('item', ['id', 'origin', 'uri', 'uri-id', 'uid', 'file'], $condition);
+ $items = DBA::select('item', ['id', 'origin', 'uri', 'uri-id', 'uid'], $condition);
$content_fields = [];
foreach (array_merge(self::CONTENT_FIELDLIST, self::MIXED_CONTENT_FIELDLIST) as $field) {
if (isset($fields[$field])) {
$content_fields[$field] = $fields[$field];
- if (in_array($field, self::CONTENT_FIELDLIST)) {
- unset($fields[$field]);
- } else {
- $fields[$field] = null;
- }
+ unset($fields[$field]);
}
}
$clear_fields = ['bookmark', 'type', 'author-name', 'author-avatar', 'author-link', 'owner-name', 'owner-avatar', 'owner-link', 'postopts', 'inform'];
foreach ($clear_fields as $field) {
- if (array_key_exists($field, $fields)) {
- $fields[$field] = null;
- }
+ unset($fields[$field]);
}
if (array_key_exists('file', $fields)) {
$files = $fields['file'];
- $fields['file'] = null;
+ unset($fields['file']);
} else {
$files = null;
}
if (!is_null($files)) {
Post\Category::storeTextByURIId($item['uri-id'], $item['uid'], $files);
- if (!empty($item['file'])) {
- DBA::update('item', ['file' => ''], ['id' => $item['id']]);
- }
}
if (!empty($fields['attach'])) {
Logger::info('Mark item for deletion by id', ['id' => $item_id, 'callstack' => System::callstack()]);
// locate item to be deleted
$fields = ['id', 'uri', 'uri-id', 'uid', 'parent', 'parent-uri', 'origin',
- 'deleted', 'file', 'resource-id', 'event-id',
+ 'deleted', 'resource-id', 'event-id',
'verb', 'object-type', 'object', 'target', 'contact-id', 'psid', 'gravity'];
$item = Post::selectFirst($fields, ['id' => $item_id]);
if (!DBA::isResult($item)) {
}
// clean up categories and tags so they don't end up as orphans
-
- $matches = [];
- $cnt = preg_match_all('/<(.*?)>/', $item['file'], $matches, PREG_SET_ORDER);
-
- if ($cnt) {
- foreach ($matches as $mtch) {
- FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],true);
- }
- }
-
- $matches = [];
-
- $cnt = preg_match_all('/\[(.*?)\]/', $item['file'], $matches, PREG_SET_ORDER);
-
- if ($cnt) {
- foreach ($matches as $mtch) {
- FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],false);
- }
- }
+ Post\Category::deleteByURIId($item['uri-id'], $item['uid']);
/*
* If item is a link to a photo resource, nuke all the associated photos
$condition[0] .= " AND `received` < UTC_TIMESTAMP() - INTERVAL ? DAY";
$condition[] = $days;
- $items = Post::select(['file', 'resource-id', 'starred', 'type', 'id', 'post-type'], $condition);
+ $items = Post::select(['resource-id', 'starred', 'type', 'id', 'post-type', 'uid', 'uri-id'], $condition);
if (!DBA::isResult($items)) {
return;
while ($item = Post::fetch($items)) {
// don't expire filed items
-
- if (strpos($item['file'], '[') !== false) {
+ if (DBA::exists('post-category', ['uri-id' => $item['uri-id'], 'uid' => $item['uid'], 'type' => Post\Category::FILE])) {
continue;
}
}
}
- 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;
}
}
}
- $selected = array_merge($selected, ['internal-uri-id', 'internal-uid', 'internal-file-count']);
$selected = array_unique($selected);
return DBA::select($view, $selected, $condition, $params);
$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`
namespace Friendica\Model\Post;
use Friendica\Database\DBA;
-use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\Tag;
const CATEGORY = 3;
const FILE = 5;
+ /**
+ * Delete all categories and files from a given uri-id and user
+ *
+ * @param int $uri_id
+ * @param int $uid
+ * @return boolean success
+ * @throws \Exception
+ */
+ public static function deleteByURIId(int $uri_id, int $uid)
+ {
+ return DBA::delete('post-category', ['uri-id' => $uri_id, 'uid' => $uid]);
+ }
+
/**
* Generates the legacy item.file field string from an item ID.
* Includes only file and category terms.
*
- * @param int $item_id
+ * @param int $uri_id
+ * @param int $uid
* @return string
* @throws \Exception
*/
return $file_text;
}
+ /**
+ * Generates an array of files or categories of a given uri-id
+ *
+ * @param int $uid
+ * @param int $type
+ * @return array
+ * @throws \Exception
+ */
+ public static function getArray(int $uid, int $type)
+ {
+ $tags = DBA::selectToArray('category-view', ['name'], ['uid' => $uid, 'type' => $type],
+ ['group_by' => ['name'], 'order' => ['name']]);
+ if (empty($tags)) {
+ return [];
+ }
+
+ return array_column($tags, 'name');
+ }
+
+ /**
+ * Generates an array of files or categories of a given uri-id
+ *
+ * @param int $uri_id
+ * @param int $uid
+ * @param int $type
+ * @return array
+ * @throws \Exception
+ */
+ public static function getArrayByURIId(int $uri_id, int $uid, int $type = self::CATEGORY)
+ {
+ $tags = DBA::selectToArray('category-view', ['type', 'name'], ['uri-id' => $uri_id, 'uid' => $uid, 'type' => $type]);
+ if (empty($tags)) {
+ return [];
+ }
+
+ return array_column($tags, 'name');
+ }
+
+ /**
+ * Generates a comma separated list of files or categories
+ *
+ * @param int $uri_id
+ * @param int $uid
+ * @param int $type
+ * @return string
+ * @throws \Exception
+ */
+ public static function getCSVByURIId(int $uri_id, int $uid, int $type)
+ {
+ return implode(',', self::getArrayByURIId($uri_id, $uid, $type));
+ }
+
/**
* Inserts new terms for the provided item ID based on the legacy item.file field BBCode content.
* Deletes all previous file terms for the same item ID.
}
// return filer dialog
- $filetags = DI::pConfig()->get(local_user(), 'system', 'filetags', '');
- $filetags = Model\FileTag::fileToArray($filetags);
+ $filetags = Model\Post\Category::getArray(local_user(), Model\Post\Category::FILE);
$tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
echo Renderer::replaceMacros($tpl, [
}
$condition = ['uri' => $uri, 'uid' => $importer["importer_uid"]];
- $item = Post::selectFirst(['id', 'parent', 'contact-id', 'file', 'deleted', 'gravity'], $condition);
+ $item = Post::selectFirst(['id', 'parent', 'contact-id', 'uri-id', 'deleted', 'gravity'], $condition);
if (!DBA::isResult($item)) {
Logger::log("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " wasn't found.", Logger::DEBUG);
return;
}
- if (strstr($item['file'], '[')) {
- Logger::log("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " is filed. So it won't be deleted.", Logger::DEBUG);
+ if (DBA::exists('post-category', ['uri-id' => $item['uri-id'], 'uid' => $importer['importer_uid'], 'type' => Post\Category::FILE])) {
+ Logger::notice("Item is filed. It won't be deleted.", ['uri' => $uri, 'uri-id' => $item['uri_id'], 'uid' => $importer["importer_uid"]]);
return;
}
}
// Fetch items that are about to be deleted
- $fields = ['uid', 'id', 'parent', 'author-link', 'file'];
+ $fields = ['uid', 'id', 'parent', 'author-link', 'uri-id'];
// When we receive a public retraction, we delete every item that we find.
if ($importer['uid'] == 0) {
}
while ($item = Post::fetch($r)) {
- if (strstr($item['file'], '[')) {
+ if (DBA::exists('post-category', ['uri-id' => $item['uri-id'], 'uid' => $item['uid'], 'type' => Post\Category::FILE])) {
Logger::log("Target guid " . $target_guid . " for user " . $item['uid'] . " is filed. So it won't be deleted.", Logger::DEBUG);
continue;
}
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1393);
+ define('DB_UPDATE_VERSION', 1394);
}
return [
"id" => ["item", "id"],
"item_id" => ["item", "id"],
"uid" => ["item", "uid"],
- "internal-uid" => ["item", "uid"],
"parent" => ["item", "parent"],
"uri" => ["item", "uri"],
"uri-id" => ["item", "uri-id"],
- "internal-uri-id" => ["item", "uri-id"],
"parent-uri" => ["item", "parent-uri"],
"parent-uri-id" => ["item", "parent-uri-id"],
"thr-parent" => ["item", "thr-parent"],
"network" => ["item", "network"],
"vid" => ["item", "vid"],
"psid" => ["item", "psid"],
- "attach" => ["item", "attach"],
- "internal-file-count" => "(SELECT COUNT(*) FROM `post-category` WHERE `post-category`.`uri-id` = `item`.`uri-id`)",
- "file" => "NULL",
"verb" => "IF (`item`.`vid` IS NULL, '', `verb`.`name`)",
"title" => ["item-content", "title"],
"content-warning" => ["item-content", "content-warning"],
"iid" => ["thread", "iid"],
"item_id" => ["item", "id"],
"uid" => ["thread", "uid"],
- "internal-uid" => ["item", "uid"],
"parent" => ["item", "parent"],
"uri" => ["item", "uri"],
"uri-id" => ["item", "uri-id"],
- "internal-uri-id" => ["item", "uri-id"],
"parent-uri" => ["item", "parent-uri"],
"parent-uri-id" => ["item", "parent-uri-id"],
"thr-parent" => ["item", "thr-parent"],
"network" => ["thread", "network"],
"vid" => ["item", "vid"],
"psid" => ["item", "psid"],
- "attach" => ["item", "attach"],
- "internal-file-count" => "(SELECT COUNT(*) FROM `post-category` WHERE `post-category`.`uri-id` = `item`.`uri-id`)",
- "file" => "NULL",
"verb" => "IF (`item`.`vid` IS NULL, '', `verb`.`name`)",
"title" => ["item-content", "title"],
"content-warning" => ["item-content", "content-warning"],