From bd9dd4b0c9d8e8df353140ae07834ba77123dc67 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Tue, 9 May 2023 19:48:25 +1000 Subject: [PATCH] feature toggle for nomadic ids in profile --- Code/Lib/Libprofile.php | 6 ++++-- Code/Module/Settings/Channel.php | 4 ++++ view/tpl/settings.tpl | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Code/Lib/Libprofile.php b/Code/Lib/Libprofile.php index 0ceb686dd..00738bff6 100644 --- a/Code/Lib/Libprofile.php +++ b/Code/Lib/Libprofile.php @@ -377,14 +377,16 @@ class Libprofile $channel_menu .= $comanche->block($menublock); } + $clones = ''; $identities = ''; $pconfigs = PConfig::Get($profile['uid'], 'system','identities', []); $ids = q("select * from linkid where ident = '%s' and sigtype = %d", dbesc($profile['channel_hash']), intval(IDLINK_RELME) ); - $clones = Libzot::encode_locations($profile); - + if (PConfig::Get($profile['uid'],'system','nomadic_ids_in_profile', true)) { + $clones = Libzot::encode_locations($profile); + } if (($ids && $pconfigs) || $clones) { $identities .= ''; } diff --git a/Code/Module/Settings/Channel.php b/Code/Module/Settings/Channel.php index 2d13435f4..86d8ae779 100644 --- a/Code/Module/Settings/Channel.php +++ b/Code/Module/Settings/Channel.php @@ -77,6 +77,7 @@ class Channel $noindex = ((x($_POST, 'noindex')) ? intval($_POST['noindex']) : 0); $channel_menu = ((x($_POST['channel_menu'])) ? htmlspecialchars_decode(trim($_POST['channel_menu']), ENT_QUOTES) : ''); + $nomadic_ids_in_profile = ((x($_POST, 'nomadic_ids_in_profile')) ? intval($_POST['nomadic_ids_in_profile']) : 0); $unless_mention_count = ((x($_POST, 'unless_mention_count')) ? intval($_POST['unless_mention_count']) : 0); $unless_tag_count = ((x($_POST, 'unless_tag_count')) ? intval($_POST['unless_tag_count']) : 0); $preview_outbox = ((x($_POST, 'preview_outbox')) ? intval($_POST['preview_outbox']) : 0); @@ -182,6 +183,7 @@ class Channel set_pconfig(local_channel(), 'system', 'unless_tag_count', $unless_tag_count); set_pconfig(local_channel(), 'system', 'noindex', $noindex); set_pconfig(local_channel(), 'system', 'preview_outbox', $preview_outbox); + set_pconfig(local_channel(), 'system', 'nomadic_ids_in_profile', $nomadic_ids_in_profile); $r = q( "update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', @@ -498,6 +500,8 @@ class Channel '$post_newfriend' => ['post_newfriend', t('accepting a friend request'), $post_newfriend, '', $yes_no], '$post_joingroup' => ['post_joingroup', t('joining a group/community'), $post_joingroup, '', $yes_no], '$post_profilechange' => ['post_profilechange', t('making an interesting profile change'), $post_profilechange, '', $yes_no], + '$nomadic_ids_in_profile' => ['nomadic_ids_in_profile', t('Show nomadic links in profile'), PConfig::Get(local_channel(),'system','nomadic_ids_in_profile',true), '', $yes_no], + '$lbl_not' => t('Send a notification email when:'), '$notify1' => ['notify1', t('You receive a connection request'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, '', $yes_no], // '$notify2' => array('notify2', t('Your connections are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, '', $yes_no), diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index 459f43ea4..5eef8f00f 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -63,7 +63,7 @@ {{include file="field_input.tpl" field=$followed_tags}} {{include file="field_input.tpl" field=$unless_tag_count}} {{include file="field_checkbox.tpl" field=$preview_outbox}} - + {{include file="field_checkbox.tpl" field=$nomadic_ids_in_profile}}