X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fconversation.php;h=6b5d8d54d9cc088e4ab96ed9854682968396115d;hb=6dcded4129cebf2e492499cd258bf14a6e25eff9;hp=d3fc5b6a9c31d124056619d6a2a0d5c771f8ae10;hpb=bde571728d5471feeb1d6ae0647b5f09346e6d5c;p=quix0rs-gnu-social.git diff --git a/actions/conversation.php b/actions/conversation.php index d3fc5b6a9c..6b5d8d54d9 100644 --- a/actions/conversation.php +++ b/actions/conversation.php @@ -31,6 +31,9 @@ if (!defined('LACONICA')) { exit(1); } +// XXX: not sure how to do paging yet, +// so set a 60-notice limit + require_once INSTALLDIR.'/lib/noticelist.php'; /** @@ -63,6 +66,7 @@ class ConversationAction extends Action if (empty($this->id)) { return false; } + $this->id = $this->id+0; $this->page = $this->trimmed('page'); if (empty($this->page)) { $this->page = 1; @@ -106,27 +110,17 @@ class ConversationAction extends Action function showContent() { - // FIXME this needs to be a tree, not a list - - $qry = 'SELECT * FROM notice WHERE conversation = %s '; - - $offset = ($this->page-1) * NOTICES_PER_PAGE; - $limit = NOTICES_PER_PAGE + 1; - - $txt = sprintf($qry, $this->id); - - $notices = Notice::getStream($txt, - 'notice:conversation:'.$this->id, - $offset, $limit); + $notices = Notice::conversationStream($this->id, null, null); $ct = new ConversationTree($notices, $this); $cnt = $ct->show(); - - $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, - $this->page, 'conversation', array('id' => $this->id)); } + function isReadOnly() + { + return true; + } } /** @@ -153,6 +147,25 @@ class ConversationTree extends NoticeList */ function show() + { + $cnt = $this->_buildTree(); + + $this->out->elementStart('div', array('id' =>'notices_primary')); + $this->out->element('h2', null, _('Notices')); + $this->out->elementStart('ol', array('class' => 'notices xoxo')); + + if (array_key_exists('root', $this->tree)) { + $rootid = $this->tree['root'][0]; + $this->showNoticePlus($rootid); + } + + $this->out->elementEnd('ol'); + $this->out->elementEnd('div'); + + return $cnt; + } + + function _buildTree() { $cnt = 0; @@ -177,18 +190,6 @@ class ConversationTree extends NoticeList } } - $this->out->elementStart('div', array('id' =>'notices_primary')); - $this->out->element('h2', null, _('Notices')); - $this->out->elementStart('ol', array('class' => 'notices xoxo')); - - if (array_key_exists('root', $this->tree)) { - $rootid = $this->tree['root'][0]; - $this->showNoticePlus($rootid); - } - - $this->out->elementEnd('ol'); - $this->out->elementEnd('div'); - return $cnt; }