]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
UNDO: use DB_DataObject join
authorEvan Prodromou <evan@prodromou.name>
Mon, 7 Jul 2008 07:05:45 +0000 (03:05 -0400)
committerEvan Prodromou <evan@prodromou.name>
Mon, 7 Jul 2008 07:05:45 +0000 (03:05 -0400)
darcs-hash:20080707070545-84dde-8034bf485a182ac86295c9a7831cfabac3cb2b55.gz

actions/replies.php

index 9b9da8cbe603a52a01d09d10d9f1f0db23a5c5b1..ce12b4d9f8ce2ebc198d4519edefa5d49f83a3b9 100644 (file)
@@ -68,20 +68,27 @@ class RepliesAction extends StreamAction {
        function show_replies($profile) {
 
                $reply = new Reply();
-               $notice = new Notice();
 
                $reply->profile_id = $profile->id;
+
                $reply->orderBy('modified DESC');
+
                $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+
                $reply->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
-               $reply->joinAdd($notice, 'INNER', NULL, 'notice_id');
-               
+
                $cnt = $reply->find();
 
                if ($cnt > 0) {
                        common_element_start('ul', array('id' => 'notices'));
                        for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
                                if ($reply->fetch()) {
+                                       $notice = new Notice();
+                                       $notice->id = $reply->notice_id;
+                                       $result = $notice->find(true);
+                                       if (!$result) {
+                                               continue;
+                                       }
                                        $this->show_notice($notice, $reply->replied_id);
                                } else {
                                        // shouldn't happen!