]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Improved the margins of the headers
[friendica.git] / include / api.php
index 2d3c31af0c3f7a32209d702d2d8dd315d619541e..4d714e583f0d2fb395a47433fb353539c3d38b43 100644 (file)
                                $_REQUEST['body'] = html2bbcode($txt);
                        }
 
-               }
-               else
+               } else
                        $_REQUEST['body'] = requestdata('status');
 
                $_REQUEST['title'] = requestdata('title');
                        }
 
                        $_REQUEST['type'] = 'wall';
-                       if(x($_FILES,'media')) {
-                               // upload the image if we have one
-                               $_REQUEST['hush']='yeah'; //tell wall_upload function to return img info instead of echo
-                               require_once('mod/wall_upload.php');
-                               $media = wall_upload_post($a);
-                               if(strlen($media)>0)
-                                       $_REQUEST['body'] .= "\n\n".$media;
-                       }
+               }
+
+               if(x($_FILES,'media')) {
+                       // upload the image if we have one
+                       $_REQUEST['hush']='yeah'; //tell wall_upload function to return img info instead of echo
+                       require_once('mod/wall_upload.php');
+                       $media = wall_upload_post($a);
+                       if(strlen($media)>0)
+                               $_REQUEST['body'] .= "\n\n".$media;
                }
 
                // set this so that the item_post() function is quiet and doesn't redirect or emit json
                // get last public wall message
                $lastwall = q("SELECT `item`.*, `i`.`contact-id` as `reply_uid`, `i`.`author-link` AS `item-author`
                                FROM `item`, `item` as `i`
-                               WHERE `item`.`contact-id` = %d
+                               WHERE `item`.`contact-id` = %d AND `item`.`uid` = %d
                                        AND ((`item`.`author-link` IN ('%s', '%s')) OR (`item`.`owner-link` IN ('%s', '%s')))
                                        AND `i`.`id` = `item`.`parent`
                                        AND `item`.`type`!='activity'
                                ORDER BY `item`.`created` DESC
                                LIMIT 1",
                                intval($user_info['cid']),
+                               intval(api_user()),
                                dbesc($user_info['url']),
                                dbesc(normalise_link($user_info['url'])),
                                dbesc($user_info['url']),