);
}
- Term::insertFromItemFileById($item);
+ Term::insertFromFileFieldByItemId($item);
$saved = PConfig::get($uid, 'system', 'filetags');
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
intval($uid)
);
- Term::insertFromItemFileById($item);
+ Term::insertFromFileFieldByItemId($item);
$r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d",
dbesc($file),
dbesc($rr['parent-uri']),
intval($page_owner_uid)
);
- Term::insertFromItemUri($rr['parent-uri'], $page_owner_uid);
+ Term::insertFromTagFieldByItemUri($rr['parent-uri'], $page_owner_uid);
delete_thread_uri($rr['parent-uri'], $page_owner_uid);
$drop_id = intval($rr['id']);
dbesc($i[0]['uri']),
intval($page_owner_uid)
);
- Term::insertFromItemUri($i[0]['uri'], $page_owner_uid);
+ Term::insertFromTagFieldByItemUri($i[0]['uri'], $page_owner_uid);
delete_thread_uri($i[0]['uri'], $page_owner_uid);
$url = System::baseUrl();
intval($item_id),
intval($page_owner_uid)
);
- Term::insertFromItemId($item_id);
+ Term::insertFromTagFieldByItemId($item_id);
update_thread($item_id);
$best = 0;
dbesc($i[0]['uri']),
intval(local_user())
);
- Term::insertFromItemUri($i[0]['uri'], local_user());
+ Term::insertFromTagFieldByItemUri($i[0]['uri'], local_user());
delete_thread_uri($i[0]['uri'], local_user());
$url = System::baseUrl();
continue;
}
- Term::insertFromItemId($item['id']);
- Term::insertFromItemFileById($item['id']);
+ Term::insertFromTagFieldByItemId($item['id']);
+ Term::insertFromFileFieldByItemId($item['id']);
update_thread($item['id']);
Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $item['id']);
'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow()],
['id' => $item['id']]);
- Term::insertFromItemId($item['id']);
- Term::insertFromItemFileById($item['id']);
+ Term::insertFromTagFieldByItemId($item['id']);
+ Term::insertFromFileFieldByItemId($item['id']);
delete_thread($item['id'], $item['parent-uri']);
// If it's the parent of a comment thread, kill all the kids
* Due to deadlock issues with the "term" table we are doing these steps after the commit.
* This is not perfect - but a workable solution until we found the reason for the problem.
*/
- Term::insertFromItemId($current_post);
- Term::insertFromItemFileById($current_post);
+ Term::insertFromTagFieldByItemId($current_post);
+ Term::insertFromFileFieldByItemId($current_post);
if ($arr['parent-uri'] === $arr['uri']) {
self::addShadow($current_post);
class Term
{
- public static function insertFromItemId($itemid)
+ public static function insertFromTagFieldByItemId($itemid)
{
$profile_base = System::baseUrl();
$profile_data = parse_url($profile_base);
}
}
- public static function insertFromItemUri($itemuri, $uid)
+ public static function insertFromTagFieldByItemUri($itemuri, $uid)
{
$messages = dba::select('item', ['id'], ['uri' => $itemuri, 'uid' => $uid]);
if (DBM::is_result($messages)) {
while ($message = dba::fetch($messages)) {
- self::insertFromItemId($message['id']);
+ self::insertFromTagFieldByItemId($message['id']);
}
dba::close($messages);
}
* @param integer $itemid item id
* @return void
*/
- public static function insertFromItemFileById($itemid)
+ public static function insertFromFileFieldByItemId($itemid)
{
$message = dba::selectFirst('item', ['uid', 'deleted', 'file'], ['id' => $itemid]);
if (!DBM::is_result($message)) {
* @param integer $uid uid
* @return void
*/
- public static function insertFromItemFileByUri($itemuri, $uid)
+ public static function insertFromFileFieldByItemUri($itemuri, $uid)
{
$messages = q("SELECT `id` FROM `item` WHERE uri ='%s' AND uid=%d", dbesc($itemuri), intval($uid));
if (count($messages)) {
foreach ($messages as $message) {
- self::insertFromItemFileById($message["id"]);
+ self::insertFromFileFieldByItemId($message["id"]);
}
}
}
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
dba::update('item', $fields, $condition);
- Term::insertFromItemUri($item["uri"], $importer["importer_uid"]);
+ Term::insertFromTagFieldByItemUri($item["uri"], $importer["importer_uid"]);
update_thread_uri($item["uri"], $importer["importer_uid"]);
$changed = true;
dbesc($r[0]["tag"] . (strlen($r[0]["tag"]) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'),
intval($r[0]["id"])
);
- Term::insertFromItemId($r[0]["id"]);
+ Term::insertFromTagFieldByItemId($r[0]["id"]);
}
}
}
dbesc(implode(',', $newtags)),
intval($i[0]["id"])
);
- Term::insertFromItemId($i[0]["id"]);
+ Term::insertFromTagFieldByItemId($i[0]["id"]);
}
}
}
dbesc($uri),
intval($importer["uid"])
);
- Term::insertFromItemUri($uri, $importer["uid"]);
- Term::insertFromItemFileByUri($uri, $importer["uid"]);
+ Term::insertFromTagFieldByItemUri($uri, $importer["uid"]);
+ Term::insertFromFileFieldByItemUri($uri, $importer["uid"]);
update_thread_uri($uri, $importer["uid"]);
} else {
$r = q(
dbesc($uri),
intval($importer["uid"])
);
- Term::insertFromItemUri($uri, $importer["uid"]);
- Term::insertFromItemFileByUri($uri, $importer["uid"]);
+ Term::insertFromTagFieldByItemUri($uri, $importer["uid"]);
+ Term::insertFromFileFieldByItemUri($uri, $importer["uid"]);
update_thread_uri($uri, $importer["importer_uid"]);
// if this is a relayed delete, propagate it to other recipients