summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-07 01:43:58 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-07 01:43:58 -0400
commit8d3ec9c92076e172e5871e3603c143333d73ac3c (patch)
tree987471d0d11cec6e46d8520494eb63ea4985eba0 /actions
parentf6303475aa512ce96759c9f39b7a4b7d2e6fb7f9 (diff)
twiddle a few bits to make replies work correctly
darcs-hash:20080707054358-84dde-916977a2af4f792e0dc9e02a9f5344ec60911319.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/newnotice.php2
-rw-r--r--actions/replies.php27
2 files changed, 15 insertions, 14 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 607f4b087..0045d6c74 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -75,8 +75,8 @@ class NewnoticeAction extends Action {
}
common_save_replies($notice);
-
common_broadcast_notice($notice);
+
$returnto = $this->trimmed('returnto');
if ($returnto) {
$url = common_local_url($returnto,
diff --git a/actions/replies.php b/actions/replies.php
index 14f19cd76..29d01c4c9 100644
--- a/actions/replies.php
+++ b/actions/replies.php
@@ -44,7 +44,7 @@ class RepliesAction extends StreamAction {
# Looks like we're good; show the header
- common_show_header($profile->nickname . _t(" and friends"),
+ common_show_header(_t("Replies to ") . $profile->nickname,
array($this, 'show_header'), $user,
array($this, 'show_top'));
@@ -55,23 +55,21 @@ class RepliesAction extends StreamAction {
function show_header($user) {
common_element('link', array('rel' => 'alternate',
- 'href' => common_local_url('allrss', array('nickname' =>
- $user->nickname)),
+ 'href' => common_local_url('repliesrss', array('nickname' =>
+ $user->nickname)),
'type' => 'application/rss+xml',
- 'title' => _t('Feed for friends of ') . $user->nickname));
+ 'title' => _t('Feed for replies to ') . $user->nickname));
}
function show_top($user) {
- $cur = common_current_user();
-
$this->views_menu();
}
function show_replies($profile) {
- $reply = DB_DataObject::factory('reply');
+ $reply = new Reply();
- $reply->user_id = $profile->id;
+ $reply->profile_id = $profile->id;
$reply->orderBy('created DESC');
@@ -83,11 +81,14 @@ class RepliesAction extends StreamAction {
if ($cnt > 0) {
common_element_start('ul', array('id' => 'replies'));
- for ($i = 0; $i < min($cnt, REPLIES_PER_PAGE); $i++) {
+ for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
if ($reply->fetch()) {
- $notice = DB_DataObject::factory('notice');
- $notice->id = $reply->notice_id;
- $notice->find(1);
+ $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!
@@ -97,7 +98,7 @@ class RepliesAction extends StreamAction {
common_element_end('ul');
}
- common_pagination($page > 1, $cnt > REPLIES_PER_PAGE,
+ common_pagination($page > 1, $cnt > NOTICES_PER_PAGE,
$page, 'all', array('nickname' => $profile->nickname));
}
}