- /*if(count($x) && !$x[0]['blocktags'] && (! stristr($r[0]['tag'], ']' . $term . '['))) {
- q("update item set tag = '%s' where id = %d",
- dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . App::get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'),
- intval($r[0]['id'])
+ if (DBA::isResult($x) && !$x[0]['blocktags'] && $t[0]['tcount'] == 0){
+ q("INSERT INTO term (`oid`, `otype`, `type`, `term`, `url`, `uid`) VALUE (%d, %d, %d, '%s', '%s', %d)",
+ intval($original_item['id']),
+ $term_objtype,
+ TERM_HASHTAG,
+ DBA::escape($term),
+ DBA::escape(System::baseUrl() . '/search?tag=' . $term),
+ intval($owner_uid)