- $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`