]> git.mxchange.org Git - friendica.git/blobdiff - mod/search.php
Merge commit 'mike/master'
[friendica.git] / mod / search.php
index 7605e9ae264f646ec3066df5d37347e373984cd4..a6a4b613fcb5b87a3cff55dce47f24e2f5ddc516 100644 (file)
@@ -9,6 +9,9 @@ function search_post(&$a) {
 
 function search_content(&$a) {
 
+       if(x($_SESSION,'theme'))
+               unset($_SESSION['theme']);
+
        $o = '<div id="live-search"></div>' . "\r\n";
 
        $o .= '<h3>' . t('Search') . '</h3>';
@@ -78,6 +81,7 @@ function search_content(&$a) {
 
                foreach($r as $item) {
 
+                       $total       = 0;
                        $comment     = '';
                        $owner_url   = '';
                        $owner_photo = '';
@@ -88,6 +92,8 @@ function search_content(&$a) {
                                && ($item['id'] != $item['parent']))
                                continue;
 
+                       $total ++;
+
                        $profile_name   = ((strlen($item['author-name']))   ? $item['author-name']   : $item['name']);
                        $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
                        $profile_link   = ((strlen($item['author-link']))   ? $item['author-link']   : $item['url']);
@@ -127,6 +133,13 @@ function search_content(&$a) {
                }
        }
 
+
+       if(! $r[0]['total']) {
+               notice('No results.');
+               return $o;
+       }
+
+
        $o .= paginate($a);
 
        return $o;