- $termhash = array_shift($parts);
- $termurl = implode(":", $parts);
-
- if (!empty($item["tag"])) {
- $item["tag"] .= ",";
- } else {
- $item["tag"] = "";
- }
-
- $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::EXCLUSIVE_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::IMPLICIT_MENTION;
- }
-
- 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]);
+ $termurl = array_pop($parts);
+ $termurl = array_pop($parts) . $termurl;
+ Tag::store($item['uri-id'], Tag::IMPLICIT_MENTION, $term, $termurl);