Merge pull request #8585 from annando/legacy-tag

Removed legacy usage of the "tag" field
This commit is contained in:
Hypolite Petovan 2020-05-05 18:10:22 -04:00 committed by GitHub
commit f4083f6031
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 getCSVByURIId(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.