]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show both empty and full notice search results inside event wrapper
authorEvan Prodromou <evan@status.net>
Tue, 12 Apr 2011 18:29:12 +0000 (14:29 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 12 Apr 2011 18:29:12 +0000 (14:29 -0400)
actions/noticesearch.php

index 257a925835677ab7cff287bb891dc111b3711dcd..d4fc884f4bb2865bb6707222185476e1570e30e9 100644 (file)
@@ -132,19 +132,19 @@ class NoticesearchAction extends SearchAction
      */
     function showResults($q, $page)
     {
-        if ($this->notice->N === 0) {
-            $this->showEmptyResults($q, $page);
-        }
-
         if (Event::handle('StartNoticeSearchShowResults', array($this, $q, $this->notice))) {
-            $terms = preg_split('/[\s,]+/', $q);
-            $nl = new SearchNoticeList($this->notice, $this, $terms);
-            $cnt = $nl->show();
-            $this->pagination($page > 1,
-                              $cnt > NOTICES_PER_PAGE,
-                              $page,
-                              'noticesearch',
-                              array('q' => $q));
+            if ($this->notice->N === 0) {
+                $this->showEmptyResults($q, $page);
+            } else {
+                $terms = preg_split('/[\s,]+/', $q);
+                $nl = new SearchNoticeList($this->notice, $this, $terms);
+                $cnt = $nl->show();
+                $this->pagination($page > 1,
+                                  $cnt > NOTICES_PER_PAGE,
+                                  $page,
+                                  'noticesearch',
+                                  array('q' => $q));
+            }
             Event::handle('EndNoticeSearchShowResults', array($this, $q, $this->notice));
         }
     }