diff options
author | Mario Vavti <mario@mariovavti.com> | 2023-04-26 12:50:37 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2023-04-26 12:50:37 +0200 |
commit | f851c272fa5cc95f11bfaa0b5399028c6d91247e (patch) | |
tree | e345f95a8e4dae0650ebd606722227ab59ef7421 /Zotlabs/Module/Dirsearch.php | |
parent | 09fde2f83904b3cff477bfedb466c894f06b2f32 (diff) | |
download | volse-hubzilla-f851c272fa5cc95f11bfaa0b5399028c6d91247e.tar.gz volse-hubzilla-f851c272fa5cc95f11bfaa0b5399028c6d91247e.tar.bz2 volse-hubzilla-f851c272fa5cc95f11bfaa0b5399028c6d91247e.zip |
enable dir admins to flag or hide entries
Diffstat (limited to 'Zotlabs/Module/Dirsearch.php')
-rw-r--r-- | Zotlabs/Module/Dirsearch.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index 45cb48c11..62bf99b67 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -25,7 +25,6 @@ class Dirsearch extends Controller { json_return_and_die($ret); } - $access_token = $_REQUEST['t'] ?? ''; $token = get_config('system','realm_token'); @@ -42,7 +41,6 @@ class Dirsearch extends Controller { $sql_extra = ''; - $tables = array('name','address','locale','region','postcode','country','gender','marital','sexual','keywords'); if(isset($_REQUEST['query']) && $_REQUEST['query']) { @@ -85,9 +83,7 @@ class Dirsearch extends Controller { // by default use a safe search - $safe = ((x($_REQUEST,'safe'))); // ? intval($_REQUEST['safe']) : 1 ); - if ($safe === false) - $safe = 1; + $safe = $_REQUEST['safe'] ?? 1; if(array_key_exists('sync',$_REQUEST)) { if($_REQUEST['sync']) @@ -177,9 +173,15 @@ class Dirsearch extends Controller { $sql_extra .= " and xchan_addr like '%%" . \App::get_hostname() . "' "; } - $safesql = (($safe > 0) ? " and xchan_censored = 0 and xchan_selfcensored = 0 " : ''); + $safesql = ''; + if($safe > 0) + $safesql = " and xchan_censored = 0 and xchan_selfcensored = 0 "; + + if($safe < 1) + $safesql = " and xchan_censored < 2 and xchan_selfcensored < 2 "; + if($safe < 0) - $safesql = " and ( xchan_censored = 1 OR xchan_selfcensored = 1 ) "; + $safesql = " and xchan_censored < 3 and xchan_selfcensored < 2 "; if($forums) $safesql .= " and xchan_pubforum = " . ((intval($forums)) ? '1 ' : '0 '); |