]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Even more SQL improvements.
[friendica.git] / mod / item.php
index 451fcb48c445902f3348daf95850924cfa439b20..7d8492bb21e48c68784147eb5ceef1281c5d5fd6 100644 (file)
@@ -20,6 +20,7 @@ require_once('include/enotify.php');
 require_once('include/email.php');
 require_once('library/langdet/Text/LanguageDetect.php');
 require_once('include/tags.php');
+require_once('include/files.php');
 require_once('include/threads.php');
 
 function item_post(&$a) {
@@ -695,18 +696,17 @@ function item_post(&$a) {
 
 
        if($orig_post) {
-               $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `attach` = '%s', `file` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d",
+               $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `attach` = '%s', `file` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d",
                        dbesc($datarray['title']),
                        dbesc($datarray['body']),
                        dbesc($datarray['tag']),
                        dbesc($datarray['attach']),
                        dbesc($datarray['file']),
                        dbesc(datetime_convert()),
+                       dbesc(datetime_convert()),
                        intval($post_id),
                        intval($profile_uid)
                );
-               create_tags_from_itemuri($post_id, $profile_uid);
-               update_thread_uri($post_id, $profile_uid);
 
                // update filetags in pconfig
                 file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
@@ -773,7 +773,6 @@ function item_post(&$a) {
        if(count($r)) {
                $post_id = $r[0]['id'];
                logger('mod_item: saved item ' . $post_id);
-               create_tags_from_item($post_id);
                add_thread($post_id);
 
                // update filetags in pconfig
@@ -871,7 +870,6 @@ function item_post(&$a) {
                        dbesc(datetime_convert()),
                        intval($post_id)
                );
-               update_thread($post_id);
 
                // photo comments turn the corresponding item visible to the profile wall
                // This way we don't see every picture in your new photo album posted to your wall at once.
@@ -939,6 +937,10 @@ function item_post(&$a) {
                }
        }
 
+       create_tags_from_item($post_id);
+       create_files_from_item($post_id);
+       update_thread($post_id);
+
        // This is a real juggling act on shared hosting services which kill your processes
        // e.g. dreamhost. We used to start delivery to our native delivery agents in the background
        // and then run our plugin delivery from the foreground. We're now doing plugin delivery first,
@@ -946,7 +948,7 @@ function item_post(&$a) {
        // likely to get killed off. If you end up looking at an /item URL and a blank page,
        // it's very likely the delivery got killed before all your friends could be notified.
        // Currently the only realistic fixes are to use a reliable server - which precludes shared hosting,
-       // or cut back on plugins which do remote deliveries.  
+       // or cut back on plugins which do remote deliveries.
 
        proc_run('php', "include/notifier.php", $notify_type, "$post_id");