]> git.mxchange.org Git - friendica.git/blobdiff - mod/search.php
added more notifier logging
[friendica.git] / mod / search.php
index d05b3d4e28681f1f501c0ff3f51f3d0605db033f..78a4a3d53f61de99c70a668ee85eaaaff0ddceef 100644 (file)
@@ -7,7 +7,7 @@ function search_content(&$a) {
 
        $o .= '<h3>' . t('Search') . '</h3>';
 
-       $search = ((x($_GET,'search')) ? $_GET['search'] : '');
+       $search = ((x($_GET,'search')) ? rawurldecode($_GET['search']) : '');
 
        $o .= search($search);
 
@@ -27,10 +27,11 @@ function search_content(&$a) {
        $r = q("SELECT COUNT(*) AS `total`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
-               AND `wall` = 1
+               AND ( `wall` = 1 OR `contact`.`uid` = %d )
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                AND MATCH (`item`.`body`) AGAINST ( '%s' IN BOOLEAN MODE )
                $sql_extra ",
+               intval(local_user()),
                dbesc($search)
        );
 
@@ -50,11 +51,12 @@ function search_content(&$a) {
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                LEFT JOIN `user` ON `user`.`uid` = `item`.`uid` 
                WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0
-               AND `wall` = 1
+               AND ( `wall` = 1 OR `contact`.`uid` = %d )
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                AND MATCH (`item`.`body`) AGAINST ( '%s' IN BOOLEAN MODE )
                $sql_extra
                ORDER BY `parent` DESC ",
+               intval(local_user()),
                dbesc($search)
        );
 
@@ -92,18 +94,20 @@ function search_content(&$a) {
                        }
 
                        $drop = replace_macros($droptpl,array('$id' => $item['id']));
+                       $lock = '<div class="wall-item-lock"></div>';
 
                        $o .= replace_macros($tpl,array(
                                '$id' => $item['item_id'],
                                '$profile_url' => $profile_link,
                                '$name' => $profile_name,
                                '$sparkle' => $sparkle,
+                               '$lock' => $lock,
                                '$thumb' => $profile_avatar,
                                '$title' => $item['title'],
                                '$body' => bbcode($item['body']),
                                '$ago' => relative_date($item['created']),
                                '$location' => $location,
-                               '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
+                               '$indent' => '',
                                '$owner_url' => $owner_url,
                                '$owner_photo' => $owner_photo,
                                '$owner_name' => $owner_name,
@@ -113,6 +117,9 @@ function search_content(&$a) {
 
                }
        }
+
+       $o .= paginate($a);
+
        return $o;
 }