mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
Rename Model\Term methods
This commit is contained in:
parent
ef77a772e5
commit
2a5431a59e
6 changed files with 25 additions and 25 deletions
|
@ -1901,7 +1901,7 @@ function file_tag_save_file($uid, $item, $file)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Term::insertFromItemFileById($item);
|
Term::insertFromFileFieldByItemId($item);
|
||||||
|
|
||||||
$saved = PConfig::get($uid, 'system', 'filetags');
|
$saved = PConfig::get($uid, 'system', 'filetags');
|
||||||
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
|
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
|
||||||
|
@ -1940,7 +1940,7 @@ function file_tag_unsave_file($uid, $item, $file, $cat = false)
|
||||||
intval($uid)
|
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",
|
$r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d",
|
||||||
dbesc($file),
|
dbesc($file),
|
||||||
|
|
|
@ -295,7 +295,7 @@ function photos_post(App $a)
|
||||||
dbesc($rr['parent-uri']),
|
dbesc($rr['parent-uri']),
|
||||||
intval($page_owner_uid)
|
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);
|
delete_thread_uri($rr['parent-uri'], $page_owner_uid);
|
||||||
|
|
||||||
$drop_id = intval($rr['id']);
|
$drop_id = intval($rr['id']);
|
||||||
|
@ -369,7 +369,7 @@ function photos_post(App $a)
|
||||||
dbesc($i[0]['uri']),
|
dbesc($i[0]['uri']),
|
||||||
intval($page_owner_uid)
|
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);
|
delete_thread_uri($i[0]['uri'], $page_owner_uid);
|
||||||
|
|
||||||
$url = System::baseUrl();
|
$url = System::baseUrl();
|
||||||
|
@ -654,7 +654,7 @@ function photos_post(App $a)
|
||||||
intval($item_id),
|
intval($item_id),
|
||||||
intval($page_owner_uid)
|
intval($page_owner_uid)
|
||||||
);
|
);
|
||||||
Term::insertFromItemId($item_id);
|
Term::insertFromTagFieldByItemId($item_id);
|
||||||
update_thread($item_id);
|
update_thread($item_id);
|
||||||
|
|
||||||
$best = 0;
|
$best = 0;
|
||||||
|
|
|
@ -176,7 +176,7 @@ function videos_post(App $a) {
|
||||||
dbesc($i[0]['uri']),
|
dbesc($i[0]['uri']),
|
||||||
intval(local_user())
|
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());
|
delete_thread_uri($i[0]['uri'], local_user());
|
||||||
|
|
||||||
$url = System::baseUrl();
|
$url = System::baseUrl();
|
||||||
|
|
|
@ -69,8 +69,8 @@ class Item extends BaseObject
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Term::insertFromItemId($item['id']);
|
Term::insertFromTagFieldByItemId($item['id']);
|
||||||
Term::insertFromItemFileById($item['id']);
|
Term::insertFromFileFieldByItemId($item['id']);
|
||||||
update_thread($item['id']);
|
update_thread($item['id']);
|
||||||
|
|
||||||
Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $item['id']);
|
Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $item['id']);
|
||||||
|
@ -151,8 +151,8 @@ class Item extends BaseObject
|
||||||
'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow()],
|
'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow()],
|
||||||
['id' => $item['id']]);
|
['id' => $item['id']]);
|
||||||
|
|
||||||
Term::insertFromItemId($item['id']);
|
Term::insertFromTagFieldByItemId($item['id']);
|
||||||
Term::insertFromItemFileById($item['id']);
|
Term::insertFromFileFieldByItemId($item['id']);
|
||||||
delete_thread($item['id'], $item['parent-uri']);
|
delete_thread($item['id'], $item['parent-uri']);
|
||||||
|
|
||||||
// If it's the parent of a comment thread, kill all the kids
|
// If it's the parent of a comment thread, kill all the kids
|
||||||
|
@ -790,8 +790,8 @@ class Item extends BaseObject
|
||||||
* Due to deadlock issues with the "term" table we are doing these steps after the commit.
|
* 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.
|
* This is not perfect - but a workable solution until we found the reason for the problem.
|
||||||
*/
|
*/
|
||||||
Term::insertFromItemId($current_post);
|
Term::insertFromTagFieldByItemId($current_post);
|
||||||
Term::insertFromItemFileById($current_post);
|
Term::insertFromFileFieldByItemId($current_post);
|
||||||
|
|
||||||
if ($arr['parent-uri'] === $arr['uri']) {
|
if ($arr['parent-uri'] === $arr['uri']) {
|
||||||
self::addShadow($current_post);
|
self::addShadow($current_post);
|
||||||
|
|
|
@ -13,7 +13,7 @@ require_once 'include/dba.php';
|
||||||
|
|
||||||
class Term
|
class Term
|
||||||
{
|
{
|
||||||
public static function insertFromItemId($itemid)
|
public static function insertFromTagFieldByItemId($itemid)
|
||||||
{
|
{
|
||||||
$profile_base = System::baseUrl();
|
$profile_base = System::baseUrl();
|
||||||
$profile_data = parse_url($profile_base);
|
$profile_data = parse_url($profile_base);
|
||||||
|
@ -122,13 +122,13 @@ class Term
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function insertFromItemUri($itemuri, $uid)
|
public static function insertFromTagFieldByItemUri($itemuri, $uid)
|
||||||
{
|
{
|
||||||
$messages = dba::select('item', ['id'], ['uri' => $itemuri, 'uid' => $uid]);
|
$messages = dba::select('item', ['id'], ['uri' => $itemuri, 'uid' => $uid]);
|
||||||
|
|
||||||
if (DBM::is_result($messages)) {
|
if (DBM::is_result($messages)) {
|
||||||
while ($message = dba::fetch($messages)) {
|
while ($message = dba::fetch($messages)) {
|
||||||
self::insertFromItemId($message['id']);
|
self::insertFromTagFieldByItemId($message['id']);
|
||||||
}
|
}
|
||||||
dba::close($messages);
|
dba::close($messages);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ class Term
|
||||||
* @param integer $itemid item id
|
* @param integer $itemid item id
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function insertFromItemFileById($itemid)
|
public static function insertFromFileFieldByItemId($itemid)
|
||||||
{
|
{
|
||||||
$message = dba::selectFirst('item', ['uid', 'deleted', 'file'], ['id' => $itemid]);
|
$message = dba::selectFirst('item', ['uid', 'deleted', 'file'], ['id' => $itemid]);
|
||||||
if (!DBM::is_result($message)) {
|
if (!DBM::is_result($message)) {
|
||||||
|
@ -187,13 +187,13 @@ class Term
|
||||||
* @param integer $uid uid
|
* @param integer $uid uid
|
||||||
* @return void
|
* @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));
|
$messages = q("SELECT `id` FROM `item` WHERE uri ='%s' AND uid=%d", dbesc($itemuri), intval($uid));
|
||||||
|
|
||||||
if (count($messages)) {
|
if (count($messages)) {
|
||||||
foreach ($messages as $message) {
|
foreach ($messages as $message) {
|
||||||
self::insertFromItemFileById($message["id"]);
|
self::insertFromFileFieldByItemId($message["id"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2091,7 +2091,7 @@ class DFRN
|
||||||
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
|
$condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
|
||||||
dba::update('item', $fields, $condition);
|
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"]);
|
update_thread_uri($item["uri"], $importer["importer_uid"]);
|
||||||
|
|
||||||
$changed = true;
|
$changed = true;
|
||||||
|
@ -2335,7 +2335,7 @@ class DFRN
|
||||||
dbesc($r[0]["tag"] . (strlen($r[0]["tag"]) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'),
|
dbesc($r[0]["tag"] . (strlen($r[0]["tag"]) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'),
|
||||||
intval($r[0]["id"])
|
intval($r[0]["id"])
|
||||||
);
|
);
|
||||||
Term::insertFromItemId($r[0]["id"]);
|
Term::insertFromTagFieldByItemId($r[0]["id"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2823,7 +2823,7 @@ class DFRN
|
||||||
dbesc(implode(',', $newtags)),
|
dbesc(implode(',', $newtags)),
|
||||||
intval($i[0]["id"])
|
intval($i[0]["id"])
|
||||||
);
|
);
|
||||||
Term::insertFromItemId($i[0]["id"]);
|
Term::insertFromTagFieldByItemId($i[0]["id"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2839,8 +2839,8 @@ class DFRN
|
||||||
dbesc($uri),
|
dbesc($uri),
|
||||||
intval($importer["uid"])
|
intval($importer["uid"])
|
||||||
);
|
);
|
||||||
Term::insertFromItemUri($uri, $importer["uid"]);
|
Term::insertFromTagFieldByItemUri($uri, $importer["uid"]);
|
||||||
Term::insertFromItemFileByUri($uri, $importer["uid"]);
|
Term::insertFromFileFieldByItemUri($uri, $importer["uid"]);
|
||||||
update_thread_uri($uri, $importer["uid"]);
|
update_thread_uri($uri, $importer["uid"]);
|
||||||
} else {
|
} else {
|
||||||
$r = q(
|
$r = q(
|
||||||
|
@ -2852,8 +2852,8 @@ class DFRN
|
||||||
dbesc($uri),
|
dbesc($uri),
|
||||||
intval($importer["uid"])
|
intval($importer["uid"])
|
||||||
);
|
);
|
||||||
Term::insertFromItemUri($uri, $importer["uid"]);
|
Term::insertFromTagFieldByItemUri($uri, $importer["uid"]);
|
||||||
Term::insertFromItemFileByUri($uri, $importer["uid"]);
|
Term::insertFromFileFieldByItemUri($uri, $importer["uid"]);
|
||||||
update_thread_uri($uri, $importer["importer_uid"]);
|
update_thread_uri($uri, $importer["importer_uid"]);
|
||||||
|
|
||||||
// if this is a relayed delete, propagate it to other recipients
|
// if this is a relayed delete, propagate it to other recipients
|
||||||
|
|
Loading…
Reference in a new issue