From 19bd6fded4e0ac41c4baa7638997b470e7705f03 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 11 Apr 2011 11:18:12 -0400 Subject: [PATCH] pass user profile to ThreadedNoticeList in PublicAction --- actions/public.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/actions/public.php b/actions/public.php index 84306e1fcc..100f8d1194 100644 --- a/actions/public.php +++ b/actions/public.php @@ -59,6 +59,7 @@ class PublicAction extends Action var $page = null; var $notice; + var $userProfile = null; function isReadOnly($args) { @@ -85,15 +86,9 @@ class PublicAction extends Action common_set_returnto($this->selfUrl()); - $profile = null; - - $user = common_current_user(); + $this->userProfile = Profile::current(); - if (!empty($user)) { - $profile = $user->getProfile(); - } - - $stream = new PublicNoticeStream($profile); + $stream = new PublicNoticeStream($this->userProfile); $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); @@ -213,7 +208,7 @@ class PublicAction extends Action */ function showContent() { - $nl = new ThreadedNoticeList($this->notice, $this); + $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile); $cnt = $nl->show(); -- 2.39.5