$page = 1;
}
- $notice = $user->noticesWithFriends(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+ list($cnt, $notice) = $user->noticesWithFriends(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
- # XXX: revisit constant scope
-
- $cnt = $notice->find();
-
if ($cnt > 0) {
common_element_start('ul', array('id' => 'notices'));
for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
$user = $this->user;
- $notice = $user->noticesWithFriends(0, $limit);
+ list($cnt, $notice) = $user->noticesWithFriends(0, $limit);
- # XXX: revisit constant scope
-
- $cnt = $notice->find();
-
while ($notice->fetch()) {
$notices[] = clone($notice);
}
$link = common_local_url('all', array('nickname' => $user->nickname));
$subtitle = sprintf(_("Updates from %s and friends on %s!"), $user->nickname, $sitename);
- $notice->$user->noticesWithFriends(($page-1)*20, $count);
-
- $cnt = $notice->find();
+ list($cnt, $notice) = $user->noticesWithFriends(($page-1)*20, $count);
switch($apidata['content-type']) {
case 'xml':
$notice = new Notice();
- $notice->query('SELECT notice.* ' .
- 'FROM notice JOIN subscription on notice.profile_id = subscription.subscribed ' .
- 'WHERE subscription.subscriber = ' . $this->id . ' ' .
- 'ORDER BY created DESC, notice.id DESC ' .
- 'LIMIT ' . $offset . ', ' . $limit);
+ $cnt = $notice->query('SELECT notice.* ' .
+ 'FROM notice JOIN subscription on notice.profile_id = subscription.subscribed ' .
+ 'WHERE subscription.subscriber = ' . $this->id . ' ' .
+ 'ORDER BY created DESC, notice.id DESC ' .
+ 'LIMIT ' . $offset . ', ' . $limit);
- return $notice;
+ return array($cnt, $notice);
}
}