Removed legacy usage of the "tag" field

This commit is contained in:
Michael 2020-05-05 19:54:25 +00:00
parent f7a45e4153
commit 980de37047
3 changed files with 24 additions and 5 deletions

View file

@ -339,6 +339,23 @@ class Tag
return DBA::selectToArray('tag-view', ['type', 'name', 'url'], $condition);
}
/**
* Return a string with all tags and mentions
*
* @param integer $uri_id
* @return string tags and mentions
*/
public static function tagTextFromItemId(int $uri_id)
{
$tag_list = [];
$tags = self::getByURIId($uri_id);
foreach ($tags as $tag) {
$tag_list[] = self::TAG_CHARACTER[$tag['type']] . '[url=' . $tag['url'] . ']' . $tag['name'] . '[/url]';
}
return implode(',', $tag_list);
}
/**
* Sorts an item's tags into mentions, hashtags and other tags. Generate personalized URLs by user and modify the
* provided item's body with them.