]> git.mxchange.org Git - friendica.git/blobdiff - mod/search.php
Merge pull request #3949 from annando/further-information
[friendica.git] / mod / search.php
index 1d28fe141ac6a15642176ee3f6f473579eae43c7..984167fd78dc8367342519076c89c3f1f987dfc2 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\Cache;
+use Friendica\Core\Config;
+use Friendica\Database\DBM;
 
 require_once("include/bbcode.php");
 require_once('include/security.php');
@@ -18,7 +21,7 @@ function search_saved_searches() {
                intval(local_user())
        );
 
-       if (dbm::is_result($r)) {
+       if (DBM::is_result($r)) {
                $saved = array();
                foreach ($r as $rr) {
                        $saved[] = array(
@@ -56,7 +59,7 @@ function search_init(App $a) {
                                intval(local_user()),
                                dbesc($search)
                        );
-                       if (!dbm::is_result($r)) {
+                       if (!DBM::is_result($r)) {
                                dba::insert('search', array('uid' => local_user(), 'term' => $search));
                        }
                }
@@ -85,12 +88,12 @@ function search_post(App $a) {
 
 function search_content(App $a) {
 
-       if (get_config('system','block_public') && !local_user() && !remote_user()) {
+       if (Config::get('system','block_public') && !local_user() && !remote_user()) {
                notice(t('Public access denied.') . EOL);
                return;
        }
 
-       if (get_config('system','local_search') && !local_user() && !remote_user()) {
+       if (Config::get('system','local_search') && !local_user() && !remote_user()) {
                http_status_exit(403,
                                array("title" => t("Public access denied."),
                                        "description" => t("Only logged in users are permitted to perform a search.")));
@@ -99,15 +102,15 @@ function search_content(App $a) {
                //return;
        }
 
-       if (get_config('system','permit_crawling') && !local_user() && !remote_user()) {
+       if (Config::get('system','permit_crawling') && !local_user() && !remote_user()) {
                // Default values:
                // 10 requests are "free", after the 11th only a call per minute is allowed
 
-               $free_crawls = intval(get_config('system','free_crawls'));
+               $free_crawls = intval(Config::get('system','free_crawls'));
                if ($free_crawls == 0)
                        $free_crawls = 10;
 
-               $crawl_permit_period = intval(get_config('system','crawl_permit_period'));
+               $crawl_permit_period = intval(Config::get('system','crawl_permit_period'));
                if ($crawl_permit_period == 0)
                        $crawl_permit_period = 10;
 
@@ -176,7 +179,7 @@ function search_content(App $a) {
        if (! $search)
                return $o;
 
-       if (get_config('system','only_tag_search'))
+       if (Config::get('system','only_tag_search'))
                $tag = true;
 
        // Here is the way permissions work in the search module...
@@ -211,7 +214,7 @@ function search_content(App $a) {
                                intval($a->pager['start']), intval($a->pager['itemspage']));
        }
 
-       if (! dbm::is_result($r)) {
+       if (! DBM::is_result($r)) {
                info( t('No results.') . EOL);
                return $o;
        }