function showContent()
{
if (Event::handle('StartShowAllContent', array($this))) {
- $nl = new ThreadedNoticeList($this->notice, $this);
+
+ $profile = null;
+
+ $current_user = common_current_user();
+
+ if (!empty($current_user)) {
+ $profile = $current_user->getProfile();
+ }
+
+ $nl = new ThreadedNoticeList($this->notice, $this, $profile);
$cnt = $nl->show();
*/
class ConversationAction extends Action
{
- var $id = null;
- var $page = null;
- var $notices = null;
+ var $id = null;
+ var $page = null;
+ var $notices = null;
+ var $userProfile = null;
const MAX_NOTICES = 500;
$cur = common_current_user();
if (empty($cur)) {
- $profile = null;
+ $this->userProfile = null;
} else {
- $profile = $cur->getProfile();
+ $this->userProfile = $cur->getProfile();
}
- $stream = new ConversationNoticeStream($this->id, $profile);
+ $stream = new ConversationNoticeStream($this->id, $this->userProfile);
- $this->notices = $stream->getNotices(0, self::MAX_NOTICES, null, null);
+ $this->notices = $stream->getNotices(0, self::MAX_NOTICES);
return true;
}
*/
function showContent()
{
- $tnl = new ThreadedNoticeList($this->notices, $this);
+ $tnl = new ThreadedNoticeList($this->notices, $this, $this->userProfile);
$cnt = $tnl->show();
}
*/
function showContent()
{
- $ct = new FullThreadedNoticeList($this->notices, $this);
+ $ct = new FullThreadedNoticeList($this->notices, $this, $this->userProfile);
$cnt = $ct->show();
}
{
function newListItem($notice)
{
- return new FullThreadedNoticeListItem($notice, $this->out);
+ return new FullThreadedNoticeListItem($notice, $this->out, $this->userProfile);
}
}
common_set_returnto($this->selfUrl());
- $this->notice = Notice::publicStream(($this->page-1)*NOTICES_PER_PAGE,
- NOTICES_PER_PAGE + 1);
+ $profile = null;
+
+ $user = common_current_user();
+
+ if (!empty($user)) {
+ $profile = $user->getProfile();
+ }
+
+ $stream = new PublicNoticeStream($profile);
+
+ $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+ NOTICES_PER_PAGE + 1);
if (!$this->notice) {
// TRANS: Server error displayed when a public timeline cannot be retrieved.
{
/** page we're viewing. */
var $page = null;
+ var $userProfile = null;
+ var $notice = null;
/**
* Is this page read-only?
return false;
}
+ $cur = common_current_user();
+
+ $this->userProfile = (empty($cur)) ? null : $cur->getProfile();
+
+ $stream = new GroupNoticeStream($this->group, $this->userProfile);
+
+ $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+ NOTICES_PER_PAGE + 1);
+
common_set_returnto($this->selfUrl());
return true;
*/
function showGroupNotices()
{
- $notice = $this->group->getNotices(($this->page-1)*NOTICES_PER_PAGE,
- NOTICES_PER_PAGE + 1);
-
- $nl = new ThreadedNoticeList($notice, $this);
+ $nl = new ThreadedNoticeList($notice, $this, $this->userProfile);
$cnt = $nl->show();
$this->pagination($this->page > 1,
*/
class ThreadedNoticeList extends NoticeList
{
+ protected $userProfile;
+
+ function __construct($notice, $out=null, $profile=null)
+ {
+ parent::__construct($notice, $out);
+ $this->userProfile = $profile;
+ }
+
/**
* show the list of notices
*
*/
function newListItem($notice)
{
- return new ThreadedNoticeListItem($notice, $this->out);
+ return new ThreadedNoticeListItem($notice, $this->out, $this->userProfile);
}
}
*/
class ThreadedNoticeListItem extends NoticeListItem
{
+ protected $userProfile = null;
+
+ function __construct($notice, $out=null, $profile=null)
+ {
+ parent::__construct($notice, $out);
+ $this->userProfile = $profile;
+ }
+
function initialItems()
{
return 3;
{
$max = $this->initialItems();
if (!$this->repeat) {
- $notice = Notice::conversationStream($this->notice->conversation, 0, $max + 2);
+ $stream = new ConversationNoticeStream($this->notice->conversation, $this->userProfile);
+ $notice = $stream->getNotices(0, $max + 2);
$notices = array();
$cnt = 0;
$moreCutoff = null;