X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fsearch.php;h=396b50738efd0869adbf42fea044cb6a6d800e8e;hb=3ca3157e53d9a37f5fee6ef6c459d61b453cca72;hp=f7ce75905a80b23c6616baf39da485d2da594423;hpb=d284f8017cefb79571fe51c4ae3f85b9b4e517c9;p=friendica.git
diff --git a/mod/search.php b/mod/search.php
index f7ce75905a..396b50738e 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -1,5 +1,60 @@
';
+ $o .= '
' . t('Saved Searches') . '
' . "\r\n";
+ $o .= '' . "\r\n";
+ }
+
+ return $o;
+
+}
+
+
+function search_init(&$a) {
+
+ $search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
+
+ if(local_user()) {
+ if(x($_GET,'save') && $search) {
+ $r = q("select * from `search` where `uid` = %d and `term` = '%s' limit 1",
+ intval(local_user()),
+ dbesc($search)
+ );
+ if(! count($r)) {
+ q("insert into `search` ( `uid`,`term` ) values ( %d, '%s') ",
+ intval(local_user()),
+ dbesc($search)
+ );
+ }
+ }
+ if(x($_GET,'remove') && $search) {
+ q("delete from `search` where `uid` = %d and `term` = '%s' limit 1",
+ intval(local_user()),
+ dbesc($search)
+ );
+ }
+
+ $a->page['aside'] .= search_saved_searches();
+
+ }
+
+
+}
+
+
function search_post(&$a) {
if(x($_POST,'search'))
@@ -32,7 +87,7 @@ function search_content(&$a) {
else
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
- $o .= search($search);
+ $o .= search($search,'search-box','/search',((local_user()) ? true : false));
if(! $search)
return $o;
@@ -88,12 +143,11 @@ function search_content(&$a) {
);
-
+ $o .= 'Search results for: ' . $search . '
';
$o .= conversation($a,$r,'search',false);
$o .= paginate($a);
- $o .= cc_license();
return $o;
}