- $r = q(
- "SELECT `notify`.*, `item`.`visible`, `item`.`deleted`
- FROM `notify` LEFT JOIN `item` ON `item`.`id` = `notify`.`iid`
- WHERE `notify`.`uid` = %d AND `notify`.`msg` != ''
- AND NOT (`notify`.`type` IN (%d, %d))
- AND $seensql `notify`.`seen` ORDER BY `notify`.`date` $order LIMIT %d, 50",
- intval($uid),
- intval(Type::INTRO),
- intval(Type::MAIL),
- intval($offset)
- );
+ $r = DBA::toArray(DBA::p(
+ "SELECT `notify`.*, `post`.`visible`, `post`.`deleted`
+ FROM `notify` LEFT JOIN `post` ON `post`.`uri-id` = `notify`.`uri-id`
+ WHERE `notify`.`uid` = ? AND `notify`.`msg` != ''
+ AND NOT (`notify`.`type` IN (?, ?))
+ AND $seensql `notify`.`seen` ORDER BY `notify`.`date` $order LIMIT ?, 50",
+ $uid,
+ Notification\Type::INTRO,
+ Notification\Type::MAIL,
+ $offset
+ ));