- $reply->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
-
- $cnt = $reply->find();
-
- if ($cnt > 0) {
- common_element_start('ul', array('id' => 'replies'));
- for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
- if ($reply->fetch()) {
- $notice = new Notice();
- $notice->id = $reply->notice_id;
- $result = $notice->find(true);
- if (!$result) {
- continue;
- }
- $this->show_reply($notice, $reply->replied_id);
- } else {
- // shouldn't happen!
+ $notice = $user->getReplies(($page-1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+
+ $cnt = 0;
+
+ if ($notice) {
+ common_element_start('ul', array('id' => 'notices'));
+ while ($notice->fetch()) {
+ $cnt++;
+ if ($cnt > NOTICES_PER_PAGE) {