return '';
}
- $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`.`self`, `contact`.`writable`,
- `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
- FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
- AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
- WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted`
- AND NOT `item`.`moderated`
+ $r = q(item_query()." AND `item`.`uid` = %d
AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `id` = %d)
$sql_extra
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC",
intval($item_id)
);
+
if(!$r && local_user()) {
// Check if this is another person's link to a post that we have
$r = q("SELECT `item`.uri FROM `item`
if($r) {
$item_uri = $r[0]['uri'];
- $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`.`self`, `contact`.`writable`,
- `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
- FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
- AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
- WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted`
- AND NOT `item`.`moderated`
+ $r = q(item_query()." AND `item`.`uid` = %d
AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `uri` = '%s' AND uid = %d)
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
intval(local_user()),
}
}
-
if($r) {
if((local_user()) && (local_user() == $a->profile['uid'])) {