X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsearch.php;h=a6a4b613fcb5b87a3cff55dce47f24e2f5ddc516;hb=9e746b504fd0f1367cce6353ac51f71327d8fb75;hp=bd7a7b35d0697f9fc8d9a3c068c81e11fc50219e;hpb=9f606be54093b934081eb32f6d1a66f4d9fa9268;p=friendica.git
diff --git a/mod/search.php b/mod/search.php
index bd7a7b35d0..a6a4b613fc 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -1,13 +1,25 @@
data['search'] = $_POST['search'];
+}
+
+
function search_content(&$a) {
+ if(x($_SESSION,'theme'))
+ unset($_SESSION['theme']);
+
$o = '
' . "\r\n";
$o .= '' . t('Search') . '
';
- $search = ((x($_GET,'search')) ? $_GET['search'] : '');
+ if(x($a->data,'search'))
+ $search = notags(trim($a->data['search']));
+ else
+ $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
$o .= search($search);
@@ -69,6 +81,7 @@ function search_content(&$a) {
foreach($r as $item) {
+ $total = 0;
$comment = '';
$owner_url = '';
$owner_photo = '';
@@ -79,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']);
@@ -107,7 +122,7 @@ function search_content(&$a) {
'$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,
@@ -117,6 +132,16 @@ function search_content(&$a) {
}
}
+
+
+ if(! $r[0]['total']) {
+ notice('No results.');
+ return $o;
+ }
+
+
+ $o .= paginate($a);
+
return $o;
}