From 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 24 Mar 2024 09:58:21 +0000 Subject: Deprecate *_config() functions in core. --- Zotlabs/Module/Dirsearch.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module/Dirsearch.php') diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index a5c3f41c0..a90c2104a 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -2,6 +2,7 @@ namespace Zotlabs\Module; use App; +use Zotlabs\Lib\Config; use Zotlabs\Web\Controller; class Dirsearch extends Controller { @@ -17,7 +18,7 @@ class Dirsearch extends Controller { // logger('request: ' . print_r($_REQUEST,true)); - $dirmode = intval(get_config('system','directory_mode')); + $dirmode = intval(Config::Get('system','directory_mode')); if($dirmode == DIRECTORY_MODE_NORMAL) { $ret['message'] = t('This site is not a directory server'); @@ -26,7 +27,7 @@ class Dirsearch extends Controller { $access_token = $_REQUEST['t'] ?? ''; - $token = get_config('system','realm_token'); + $token = Config::Get('system','realm_token'); if($token && $access_token != $token) { $ret['message'] = t('This directory server requires an access token'); json_return_and_die($ret); @@ -79,7 +80,7 @@ class Dirsearch extends Controller { $forums = ((array_key_exists('pubforums',$_REQUEST)) ? intval($_REQUEST['pubforums']) : 0); - if(get_config('system','disable_directory_keywords')) + if(Config::Get('system','disable_directory_keywords')) $kw = 0; -- cgit v1.2.3 From f85d2d3423fdb6a140e0df5f2df751ac9183a2f7 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 26 Mar 2024 14:48:16 +0000 Subject: reduce default directory result set --- Zotlabs/Module/Dirsearch.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module/Dirsearch.php') diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index a90c2104a..d27b195e4 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -154,9 +154,13 @@ class Dirsearch extends Controller { } - $perpage = $_REQUEST['n'] ?? 60; - $page = ((isset($_REQUEST['p']) && $_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0); - $startrec = (($page+1) * $perpage) - $perpage; + $perpage = $_REQUEST['n'] ?? 30; + if ($perpage > 30) { + $perpage = 30; + } + + $page = ((isset($_REQUEST['p']) && $_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0); + $startrec = (($page+1) * $perpage) - $perpage; $limit = $_REQUEST['limit'] ?? 0; $return_total = $_REQUEST['return_total'] ?? 0; -- cgit v1.2.3