X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fapi.php;h=305a86ca13e7148de24210c2515ea675a1ffd9f0;hb=1dda70d144bf86c6c83ed6fbbe2c438a7e1aac4a;hp=a494e3cdd9ea23f704f91d7ae8a457e36371cbdf;hpb=ec90a9e6ad1b2d424f7c72410d4a5a6cec2aad9b;p=friendica.git
diff --git a/include/api.php b/include/api.php
index a494e3cdd9..305a86ca13 100644
--- a/include/api.php
+++ b/include/api.php
@@ -1524,15 +1524,21 @@
if ($max_id > 0)
$sql_extra = ' AND `item`.`id` <= '.intval($max_id);
+ // Not sure why this query was so complicated. We should keep it here for a while,
+ // just to make sure that we really don't need it.
+ // FROM `item` INNER JOIN (SELECT `uri`,`parent` FROM `item` WHERE `id` = %d) AS `temp1`
+ // ON (`item`.`thr-parent` = `temp1`.`uri` AND `item`.`parent` = `temp1`.`parent`)
+
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
- FROM `item` INNER JOIN (SELECT `uri`,`parent` FROM `item` WHERE `id` = %d) AS `temp1`
- ON (`item`.`thr-parent` = `temp1`.`uri` AND `item`.`parent` = `temp1`.`parent`), `contact`
- WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
- AND `item`.`uid` = %d AND `item`.`verb` = '%s' AND `contact`.`id` = `item`.`contact-id`
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ FROM `item`
+ INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ WHERE `item`.`parent` = %d AND `item`.`visible`
+ AND NOT `item`.`moderated` AND NOT `item`.`deleted`
+ AND `item`.`uid` = %d AND `item`.`verb` = '%s'
+ AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
AND `item`.`id`>%d $sql_extra
ORDER BY `item`.`id` DESC LIMIT %d ,%d",
intval($id), intval(api_user()),
@@ -2059,6 +2065,16 @@
$statushtml = trim(bbcode($body, false, false));
+ $search = array("
", "
", "", + "
", "\n", + "\n