diff options
author | Mario Vavti <mario@mariovavti.com> | 2023-05-03 18:13:47 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2023-05-03 18:13:47 +0200 |
commit | 57e2910477e81dfb9d8cf40334c013581d509617 (patch) | |
tree | 5c9d6c8b0b46ee737893150482fd72b5d7ab8e1c /Zotlabs/Lib | |
parent | ffbaa7e4dcda787897263c6cc4d13671f1fc6ed6 (diff) | |
download | volse-hubzilla-57e2910477e81dfb9d8cf40334c013581d509617.tar.gz volse-hubzilla-57e2910477e81dfb9d8cf40334c013581d509617.tar.bz2 volse-hubzilla-57e2910477e81dfb9d8cf40334c013581d509617.zip |
flag new xtags with the xchan flag
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Libzotdir.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php index 8e729f7e6..58138850c 100644 --- a/Zotlabs/Lib/Libzotdir.php +++ b/Zotlabs/Lib/Libzotdir.php @@ -521,6 +521,7 @@ class Libzotdir { $clean = array(); if (array_key_exists('keywords', $profile) and is_array($profile['keywords'])) { self::import_directory_keywords($hash,$profile['keywords']); + foreach ($profile['keywords'] as $kw) { if (in_array($kw, $clean)) { continue; @@ -649,6 +650,10 @@ class Libzotdir { dbesc($hash) ); + $xchan = q("select xchan_censored from xchan where xchan_hash = '%s'", + dbesc($hash) + ); + if($r) { foreach($r as $rr) $existing[] = $rr['xtag_term']; @@ -674,9 +679,10 @@ class Libzotdir { } foreach($clean as $x) { if(! in_array($x, $existing)) { - $r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', 0 )", + $r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', %d )", dbesc($hash), - dbesc($x) + dbesc($x), + intval($xchan[0]['xchan_censored']) ); } } |