$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND `wall` = 1
+ AND ( `wall` = 1 OR `contact`.`uid` = %d )
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND MATCH (`item`.`body`) AGAINST ( '%s' IN BOOLEAN MODE )
$sql_extra ",
+ intval(local_user()),
dbesc($search)
);
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
- AND `wall` = 1
+ AND ( `wall` = 1 OR `contact`.`uid` = %d )
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND MATCH (`item`.`body`) AGAINST ( '%s' IN BOOLEAN MODE )
$sql_extra
ORDER BY `parent` DESC ",
+ intval(local_user()),
dbesc($search)
);