mirror of
https://github.com/friendica/friendica
synced 2025-04-26 06:30:11 +00:00
We now store the tags in two separate tables
This commit is contained in:
parent
d3f4e4d629
commit
db657b0149
8 changed files with 121 additions and 98 deletions
|
@ -2464,26 +2464,7 @@ class DFRN
|
|||
|
||||
$item["tag"] .= $termhash . "[url=" . $termurl . "]" . $term . "[/url]";
|
||||
|
||||
// Store the hashtag/mention
|
||||
$fields = ['uri-id' => $item['uri-id'], 'name' => substr($term, 0, 64)];
|
||||
|
||||
if ($termhash == Term::TAG_CHARACTER[Term::MENTION]) {
|
||||
$fields['type'] = Term::MENTION;
|
||||
} elseif ($termhash == Term::TAG_CHARACTER[Term::EXCLUSIVE_MENTION]) {
|
||||
$fields['type'] = Term::EXCLUSIVE_MENTION;
|
||||
} elseif ($termhash == Term::TAG_CHARACTER[Term::IMPLICIT_MENTION]) {
|
||||
$fields['type'] = Term::IMPLICIT_MENTION;
|
||||
} elseif ($termhash == Term::TAG_CHARACTER[Term::HASHTAG]) {
|
||||
$fields['type'] = Term::HASHTAG;
|
||||
}
|
||||
|
||||
if (!empty($termurl)) {
|
||||
$fields['url'] = $termurl;
|
||||
}
|
||||
|
||||
DBA::insert('tag', $fields, true);
|
||||
|
||||
Logger::info('Stored tag/mention', ['uri-id' => $item['uri-id'], 'tag' => $term, 'url' => $termurl, 'hash' => $termhash, 'fields' => $fields]);
|
||||
Tag::storeByHash($item['uri-id'], $termhash, $term, $termurl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue