From: Michael Vogel Date: Thu, 20 Mar 2014 17:51:13 +0000 (+0100) Subject: Adding functions for the file- and category handling X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a03014a47c69e9bbda2cdc991bc7b49481bdbe7d;p=friendica.git Adding functions for the file- and category handling --- diff --git a/include/files.php b/include/files.php new file mode 100644 index 0000000000..b3bd7690fe --- /dev/null +++ b/include/files.php @@ -0,0 +1,50 @@ +/ism", $message["file"], $files)) + foreach ($files[1] as $file) + $r = q("INSERT INTO `term` (`uid`, `oid`, `otype`, `type`, `term`) VALUES (%d, %d, %d, %d, '%s')", + intval($message["uid"]), intval($itemid), intval(TERM_OBJ_POST), intval(TERM_CATEGORY), dbesc($file)); +} + +function create_files_from_itemuri($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) + create_files_from_item($message["id"]); + } +} + +function update_files_for_items() { + $messages = q("SELECT `id` FROM `item` where file !=''"); + + foreach ($messages as $message) { + echo $message["id"]."\n"; + create_files_from_item($message["id"]); + } +} +?> diff --git a/mod/network.php b/mod/network.php index 5b2908f0e9..e10e7b7880 100644 --- a/mod/network.php +++ b/mod/network.php @@ -1,9 +1,4 @@