function names changed
This commit is contained in:
parent
6d4962a571
commit
3b2ae5c4a9
6 changed files with 10 additions and 10 deletions
|
@ -526,7 +526,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
|
||||||
$profile_name = $item['author-link'];
|
$profile_name = $item['author-link'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$tags = Tag::populateTagsFromItem($item);
|
$tags = Tag::populateFromItem($item);
|
||||||
|
|
||||||
$author = ['uid' => 0, 'id' => $item['author-id'],
|
$author = ['uid' => 0, 'id' => $item['author-id'],
|
||||||
'network' => $item['author-network'], 'url' => $item['author-link']];
|
'network' => $item['author-network'], 'url' => $item['author-link']];
|
||||||
|
|
|
@ -3563,7 +3563,7 @@ class Item
|
||||||
return $ev;
|
return $ev;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tags = Tag::populateTagsFromItem($item);
|
$tags = Tag::populateFromItem($item);
|
||||||
|
|
||||||
$item['tags'] = $tags['tags'];
|
$item['tags'] = $tags['tags'];
|
||||||
$item['hashtags'] = $tags['hashtags'];
|
$item['hashtags'] = $tags['hashtags'];
|
||||||
|
|
|
@ -316,7 +316,7 @@ class Tag
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public static function ArrayFromURIId(int $uri_id, array $type = [self::HASHTAG, self::MENTION, self::IMPLICIT_MENTION, self::EXCLUSIVE_MENTION])
|
public static function getByURIId(int $uri_id, array $type = [self::HASHTAG, self::MENTION, self::IMPLICIT_MENTION, self::EXCLUSIVE_MENTION])
|
||||||
{
|
{
|
||||||
$condition = ['uri-id' => $uri_id, 'type' => $type];
|
$condition = ['uri-id' => $uri_id, 'type' => $type];
|
||||||
$tags = DBA::select('tag-view', ['type', 'name', 'url'], $condition);
|
$tags = DBA::select('tag-view', ['type', 'name', 'url'], $condition);
|
||||||
|
@ -333,7 +333,7 @@ class Tag
|
||||||
return $tag_list;
|
return $tag_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sorts an item's tags into mentions, hashtags and other tags. Generate personalized URLs by user and modify the
|
* 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.
|
* provided item's body with them.
|
||||||
*
|
*
|
||||||
|
@ -342,7 +342,7 @@ class Tag
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
*/
|
*/
|
||||||
public static function populateTagsFromItem(&$item)
|
public static function populateFromItem(&$item)
|
||||||
{
|
{
|
||||||
$return = [
|
$return = [
|
||||||
'tags' => [],
|
'tags' => [],
|
||||||
|
|
|
@ -390,7 +390,7 @@ class Post
|
||||||
$buttons["like"] = false;
|
$buttons["like"] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tags = Tag::populateTagsFromItem($item);
|
$tags = Tag::populateFromItem($item);
|
||||||
|
|
||||||
$ago = Temporal::getRelativeDate($item['created']);
|
$ago = Temporal::getRelativeDate($item['created']);
|
||||||
$ago_received = Temporal::getRelativeDate($item['received']);
|
$ago_received = Temporal::getRelativeDate($item['received']);
|
||||||
|
@ -872,7 +872,7 @@ class Post
|
||||||
$text = '';
|
$text = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$terms = Tag::ArrayFromURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
$terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
||||||
foreach ($terms as $term) {
|
foreach ($terms as $term) {
|
||||||
$profile = Contact::getDetailsByURL($term['url']);
|
$profile = Contact::getDetailsByURL($term['url']);
|
||||||
if (!empty($profile['addr']) && ((($profile['contact-type'] ?? '') ?: Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
|
if (!empty($profile['addr']) && ((($profile['contact-type'] ?? '') ?: Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
|
||||||
|
|
|
@ -1015,7 +1015,7 @@ class Processor
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent_terms = Tag::ArrayFromURIId($parent['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
$parent_terms = Tag::getByURIId($parent['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
||||||
|
|
||||||
$parent_author = Contact::getDetailsByURL($parent['author-link'], 0);
|
$parent_author = Contact::getDetailsByURL($parent['author-link'], 0);
|
||||||
|
|
||||||
|
|
|
@ -407,7 +407,7 @@ class Transmitter
|
||||||
$actor_profile = APContact::getByURL($item['author-link']);
|
$actor_profile = APContact::getByURL($item['author-link']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$terms = Tag::ArrayFromURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
$terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
||||||
|
|
||||||
if ($item['private'] != Item::PRIVATE) {
|
if ($item['private'] != Item::PRIVATE) {
|
||||||
// Directly mention the original author upon a quoted reshare.
|
// Directly mention the original author upon a quoted reshare.
|
||||||
|
@ -1009,7 +1009,7 @@ class Transmitter
|
||||||
{
|
{
|
||||||
$tags = [];
|
$tags = [];
|
||||||
|
|
||||||
$terms = Tag::ArrayFromURIId($item['uri-id'], [Tag::HASHTAG, Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
$terms = Tag::getByURIId($item['uri-id'], [Tag::HASHTAG, Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
|
||||||
foreach ($terms as $term) {
|
foreach ($terms as $term) {
|
||||||
if ($term['type'] == Tag::HASHTAG) {
|
if ($term['type'] == Tag::HASHTAG) {
|
||||||
$url = DI::baseUrl() . '/search?tag=' . urlencode($term['term']);
|
$url = DI::baseUrl() . '/search?tag=' . urlencode($term['term']);
|
||||||
|
|
Loading…
Reference in a new issue