aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Directory.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Directory.php')
-rw-r--r--Zotlabs/Module/Directory.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php
index 2958e80dc..13353c108 100644
--- a/Zotlabs/Module/Directory.php
+++ b/Zotlabs/Module/Directory.php
@@ -151,7 +151,7 @@ class Directory extends Controller {
$url = '';
- if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
+ if(in_array($dirmode, [DIRECTORY_MODE_PRIMARY, DIRECTORY_MODE_SECONDARY, DIRECTORY_MODE_STANDALONE])) {
$url = z_root() . '/dirsearch';
if (is_site_admin()) {
$directory_admin = true;
@@ -191,7 +191,10 @@ class Directory extends Controller {
if(get_config('system','disable_directory_keywords'))
$kw = 0;
- $query = $url . '?f=&kw=' . $kw . (($safe_mode != 1) ? '&safe=' . $safe_mode : '');
+ if (intval($safe_mode) === 0 && $directory_admin)
+ $safe_mode = -1;
+
+ $query = $url . '?f=&kw=' . $kw . (($safe_mode < 1) ? '&safe=' . $safe_mode : '');
if($token)
$query .= '&t=' . $token;
@@ -296,10 +299,11 @@ class Directory extends Controller {
$hometown = ((x($profile,'hometown') == 1) ? html2plain($profile['hometown']) : False);
$about = ((x($profile,'about') == 1) ? zidify_links(bbcode($profile['about'], ['tryoembed' => false])) : False);
- if ($about && $safe_mode) {
- $about = html2plain($about);
+ if ($about && $safe_mode > 0) {
+ $about = strip_tags($about, '<br>');
}
+
$keywords = ((x($profile,'keywords')) ? $profile['keywords'] : '');
@@ -351,11 +355,15 @@ class Directory extends Controller {
'gender' => $gender,
'pdesc' => $pdesc,
'pdesc_label' => t('Description:'),
- 'censor' => (($directory_admin) ? 'dircensor/' . $rr['hash'] : ''),
- 'censor_label' => (($rr['censored']) ? t('Uncensor') : t('Censor')),
+ 'censor' => (($directory_admin) ? 'dircensor/' . $rr['hash'] . '?severity=' . ((intval($rr['censored']) > 0) ? 0 : 1) : ''),
+ 'censor_label' => t('Unsafe'),
+ 'censor_class' => ((intval($rr['censored']) === 1) ? 'active' : ''),
+ 'censor_2' => (($directory_admin) ? 'dircensor/' . $rr['hash'] . '?severity=' . ((intval($rr['censored']) > 1) ? 0 : 2) : ''),
+ 'censor_2_label' => t('Spam'),
+ 'censor_2_class' => ((intval($rr['censored']) > 1) ? 'active' : ''),
'marital' => $marital,
'homepage' => $homepage,
- 'homepageurl' => (($safe_mode) ? $homepageurl : linkify($homepageurl)),
+ 'homepageurl' => (($safe_mode > 0) ? $homepageurl : linkify($homepageurl)),
'hometown' => $hometown,
'hometown_label' => t('Hometown:'),
'about' => $about,
@@ -436,7 +444,8 @@ class Directory extends Controller {
'$reverse' => t('Reverse Alphabetic'),
'$date' => t('Newest to Oldest'),
'$reversedate' => t('Oldest to Newest'),
- '$suggest' => $suggest ? '&suggest=1' : ''
+ '$suggest' => $suggest ? '&suggest=1' : '',
+ '$directory_admin' => $directory_admin
));