Update functions and calls

Change function names, calls and use dba functions.
This commit is contained in:
Adam Magness
2018-01-10 12:05:20 -05:00
parent 55ee9a1c72
commit dc175b8e12
5 changed files with 24 additions and 24 deletions

View File

@@ -10,6 +10,7 @@ use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Term;
use Friendica\Util\Map;
require_once "include/friendica_smarty.php";
@@ -1895,9 +1896,8 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
return true;
}
function file_tag_save_file($uid, $item, $file) {
require_once "include/files.php";
function file_tag_save_file($uid, $item, $file)
{
if (! intval($uid)) {
return false;
}
@@ -1915,7 +1915,7 @@ function file_tag_save_file($uid, $item, $file) {
);
}
create_files_from_item($item);
Term::createFromItem($item);
$saved = PConfig::get($uid, 'system', 'filetags');
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
@@ -1955,7 +1955,7 @@ function file_tag_unsave_file($uid, $item, $file, $cat = false) {
intval($uid)
);
create_files_from_item($item);
Term::createFromItem($item);
$r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d",
dbesc($file),