]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
conversation code changes
authorEvan Prodromou <evan@controlyourself.ca>
Tue, 30 Jun 2009 15:50:16 +0000 (11:50 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Tue, 30 Jun 2009 15:50:16 +0000 (11:50 -0400)
actions/conversation.php
classes/Notice.php

index 654a670f54ca6113ddcc31ad34503c29cfdf1791..79197da2d0a8484c0dcffebba673bae4b9acd0d0 100644 (file)
@@ -107,17 +107,11 @@ class ConversationAction extends Action
 
     function showContent()
     {
-        $offset = ($this->page-1) * NOTICES_PER_PAGE;
-        $limit  = NOTICES_PER_PAGE + 1;
-
-        $notices = Notice::conversationStream($this->id, $offset, $limit);
+        $notices = Notice::conversationStream($this->id);
 
         $ct = new ConversationTree($notices, $this);
 
         $cnt = $ct->show();
-
-        $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
-                          $this->page, 'conversation', array('id' => $this->id));
     }
 }
 
@@ -148,6 +142,25 @@ class ConversationTree extends NoticeList
     {
         $cnt = 0;
 
+        $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()
+    {
         $this->tree  = array();
         $this->table = array();
 
@@ -168,20 +181,6 @@ class ConversationTree extends NoticeList
                 $this->tree[$notice->reply_to] = array($notice->id);
             }
         }
-
-        $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;
     }
 
     /**
index 502cc57b81812cc5ed29d89b255c22012d90118a..2ba2f31b1a62f47202f45caece88121b9f0a14e3 100644 (file)
@@ -795,7 +795,7 @@ class Notice extends Memcached_DataObject
         $notice->selectAdd(); // clears it
         $notice->selectAdd('id');
 
-        $notice->whereAdd('conversation = '.$id);
+        $notice->conversation = $id;
 
         $notice->orderBy('id DESC');