]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/all.php
try to fix updating in profile
[quix0rs-gnu-social.git] / actions / all.php
index 452232929089abbbcf7cf6175f565f77c7332818..7cd1f5beba9a9146c23eb62f0986c42de0e87447 100644 (file)
@@ -19,6 +19,8 @@
 
 if (!defined('LACONICA')) { exit(1); }
 
+require_once(INSTALLDIR.'/actions/showstream.php');
+
 class AllAction extends ShowstreamAction {
 
        // XXX: push this up to a common function.
@@ -28,15 +30,15 @@ class AllAction extends ShowstreamAction {
                $notice = DB_DataObject::factory('notice');
                
                # XXX: chokety and bad
-               
-               $notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = {$profile->id})', 'OR');
-               $notice->whereAdd('profile_id = {$profile->id}', 'OR');
+
+               $notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = '.$profile->id.' and subscribed = notice.profile_id)', 'OR');
+               $notice->whereAdd('profile_id = ' . $profile->id, 'OR');
                
                $notice->orderBy('created DESC');
                
                $page = $this->arg('page') || 1;
                
-               $notice->limit((($page-1)*NOTICES_PER_PAGE) + 1, NOTICES_PER_PAGE);
+               $notice->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE);
                
                $notice->find();
                
@@ -46,6 +48,7 @@ class AllAction extends ShowstreamAction {
                        $this->show_notice($notice);
                }
                
+               # XXX: show a link for the next page
                common_element_end('div');
        }
 }