]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/public.php
Twitter integration - Add and remove Twitter accnt now working
[quix0rs-gnu-social.git] / actions / public.php
index 98e570e80b5b3bc3394e029859263d553e024cb4..f99215dadbdd8aec3759aa37ac53d7d67e9d9b28 100644 (file)
@@ -59,11 +59,13 @@ class PublicAction extends StreamAction {
 
        function show_notices($page) {
 
-               $notice = DB_DataObject::factory('notice');
+               $notice = new Notice();
 
-               # FIXME: bad performance
+               # XXX: sub-optimal
 
-               $notice->whereAdd('EXISTS (SELECT user.id from user where user.id = notice.profile_id)');
+               if (common_config('public', 'localonly')) {
+                       $notice->is_local = 1;
+               }
 
                $notice->orderBy('created DESC, notice.id DESC');
 
@@ -75,7 +77,8 @@ class PublicAction extends StreamAction {
 
                if ($cnt > 0) {
                        common_element_start('ul', array('id' => 'notices'));
-                       for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
+            $iMax = min($cnt, NOTICES_PER_PAGE);
+                       for ($i = 0; $i < $iMax; $i++) {
                                if ($notice->fetch()) {
                                        $this->show_notice($notice);
                                } else {