return $tag_text;
}
+ public static function fileTextFromItemId($itemid)
+ {
+ $file_text = '';
+ $condition = ['otype' => TERM_OBJ_POST, 'oid' => $itemid, 'type' => [TERM_FILE, TERM_CATEGORY]];
+ $tags = dba::select('term', [], $condition);
+ while ($tag = dba::fetch($tags)) {
+ $file_text .= '[' . $tag['term'] . ']';
+ }
+ return $file_text;
+ }
+
public static function insertFromTagFieldByItemId($itemid, $tags)
{
$profile_base = System::baseUrl();
* @param integer $itemid item id
* @return void
*/
- public static function insertFromFileFieldByItemId($itemid)
+ public static function insertFromFileFieldByItemId($itemid, $files)
{
- $message = Item::selectFirst(['uid', 'deleted', 'file'], ['id' => $itemid]);
+ $message = Item::selectFirst(['uid', 'deleted'], ['id' => $itemid]);
if (!DBM::is_result($message)) {
return;
}
return;
}
+ $message['file'] = $files;
+
if (preg_match_all("/\[(.*?)\]/ism", $message["file"], $files)) {
foreach ($files[1] as $file) {
dba::insert('term', [