From 2e7f4c1870dcd8ce05329b80d97be1269ff2a1a7 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 14 Aug 2016 06:41:12 -0400 Subject: Added a disable comments setting to the "Additional features" settings with a corresponding post editor toggle button --- include/conversation.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index b53498d20..de917c44e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1121,6 +1121,10 @@ function status_editor($a, $x, $popup = false) { $feature_voting = feature_enabled($x['profile_uid'], 'consensus_tools'); if(x($x, 'hide_voting')) $feature_voting = false; + + $feature_nocomment = feature_enabled($x['profile_uid'], 'disable_comments'); + if(x($x, 'disable_comments')) + $feature_nocomment = false; $feature_expire = ((feature_enabled($x['profile_uid'], 'content_expire') && (! $webpage)) ? true : false); if(x($x, 'hide_expire')) @@ -1239,6 +1243,9 @@ function status_editor($a, $x, $popup = false) { '$voting' => t('Toggle voting'), '$feature_voting' => $feature_voting, '$consensus' => 0, + '$nocommenttitle' => t('Disable comments'), + '$feature_nocomment' => $feature_nocomment, + '$nocomment' => 0, '$clearloc' => $clearloc, '$title' => ((x($x, 'title')) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8') : ''), '$placeholdertitle' => ((x($x, 'placeholdertitle')) ? $x['placeholdertitle'] : t('Title (optional)')), -- cgit v1.2.3 From cb9ac6dd3435a429a58250d326ff76ca5f97398a Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 14 Aug 2016 06:46:48 -0400 Subject: Replace hardcoded button title in javascript to translatable text --- include/conversation.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index de917c44e..567336646 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1194,6 +1194,8 @@ function status_editor($a, $x, $popup = false) { '$modalerrorlist' => t('Error getting album list'), '$modalerrorlink' => t('Error getting photo link'), '$modalerroralbum' => t('Error getting album'), + '$nocomment_enabled' => t('Comments enabled'), + '$nocomment_disabled' => t('Comments disabled'), )); $tpl = get_markup_template('jot.tpl'); -- cgit v1.2.3 From 229cc2ac431cdcef80cc45a42178fe7a1e4233e4 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 14 Aug 2016 06:55:02 -0400 Subject: Change text for submenu on small screens to be static toggle statement --- include/conversation.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 567336646..7d1473fe2 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1246,6 +1246,7 @@ function status_editor($a, $x, $popup = false) { '$feature_voting' => $feature_voting, '$consensus' => 0, '$nocommenttitle' => t('Disable comments'), + '$nocommenttitlesub' => t('Toggle comments'), '$feature_nocomment' => $feature_nocomment, '$nocomment' => 0, '$clearloc' => $clearloc, -- cgit v1.2.3 From 4f62d7a78f63e4bae136f52d70d0af906d997b78 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 21 Aug 2016 15:43:03 +0200 Subject: move jotnets to jot and some cleanup (mostly whitespace) --- include/conversation.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 7d1473fe2..637234bff 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1200,8 +1200,6 @@ function status_editor($a, $x, $popup = false) { $tpl = get_markup_template('jot.tpl'); - $jotplugins = ''; - $preview = t('Preview'); if(x($x, 'hide_preview')) $preview = ''; @@ -1218,8 +1216,14 @@ function status_editor($a, $x, $popup = false) { if(! $cipher) $cipher = 'aes256'; + $jotplugins = ''; call_hooks('jot_tool', $jotplugins); + $jotnets = ''; + if(x($x,'jotnets')) { + call_hooks('jot_networks', $jotnets); + } + $o .= replace_macros($tpl, array( '$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string), '$action' => z_root() . '/item', @@ -1276,6 +1280,8 @@ function status_editor($a, $x, $popup = false) { '$preview' => $preview, '$source' => ((x($x, 'source')) ? $x['source'] : ''), '$jotplugins' => $jotplugins, + '$jotnets' => $jotnets, + '$jotnets_label' => t('Other networks and post services'), '$defexpire' => $defexpire, '$feature_expire' => $feature_expire, '$expires' => t('Set expiration date'), -- cgit v1.2.3 From 38ea8bee935181220e89fd22120865ab63af9da6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 25 Aug 2016 17:43:07 -0700 Subject: ratings are gone. They can be enabled, but there is no UI for doing so at this time; and will likely only be available in a 'pro' configuration once the new implementation details have been hashed out. This appears to require a mechanism for rebuttal before it can again be opened to the public. There are also some synchronisation issues to contend with; as ratings are currently only distributed to active directory servers. There is no reliable mechanism for a new directory server to fetch existing ratings. --- include/conversation.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 637234bff..2e056b620 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -941,12 +941,9 @@ function item_photo_menu($item){ $clean_url = normalise_link($item['author-link']); } - $poco_rating = get_config('system','poco_rating_enable'); - // if unset default to enabled - if($poco_rating === false) - $poco_rating = true; + $rating_enabled = get_config('system','rating_enabled'); - $ratings_url = (($poco_rating) ? z_root() . '/ratings/' . urlencode($item['author_xchan']) : ''); + $ratings_url = (($rating_enabled) ? z_root() . '/ratings/' . urlencode($item['author_xchan']) : ''); $post_menu = Array( t("View Source") => $vsrc_link, -- cgit v1.2.3 From ea0be8ea1a22abfdedae0d0c47677a9de44e08c0 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 31 Aug 2016 17:49:22 -0700 Subject: provide techlevels in the pro server role. Should have no visible effect on other roles. --- include/conversation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 2e056b620..a56a765be 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1621,6 +1621,8 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ $uid = ((App::$profile['profile_uid']) ? App::$profile['profile_uid'] : local_channel()); + $account_id = ((App::$profile['profile_uid']) ? App::$profile['channel_account_id'] : App::get_account_id()); + if($uid == local_channel()) { $cal_link = ''; @@ -1723,7 +1725,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ ); } - if(feature_enabled($uid,'wiki') && (get_config('system','server_role') !== 'basic')) { + if(feature_enabled($uid,'wiki') && (get_account_techlevel($account_id) > 3)) { $tabs[] = array( 'label' => t('Wiki'), 'url' => z_root() . '/wiki/' . $nickname, -- cgit v1.2.3 From 9cfd0dd9d875f3951c10a6a260715c2bc835fbc6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 8 Sep 2016 13:24:09 -0700 Subject: fix bookmarks in dev --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index a56a765be..f06016966 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1621,7 +1621,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ $uid = ((App::$profile['profile_uid']) ? App::$profile['profile_uid'] : local_channel()); - $account_id = ((App::$profile['profile_uid']) ? App::$profile['channel_account_id'] : App::get_account_id()); + $account_id = ((App::$profile['profile_uid']) ? App::$profile['channel_account_id'] : App::$channel['channel_account_id']); if($uid == local_channel()) { -- cgit v1.2.3 From 956dab69b480fbc91a1735b66c0cf46a98d334ef Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 8 Sep 2016 22:20:45 -0700 Subject: illegal offset errors in include/conversation:status_editor() when no permissions array is passed --- include/conversation.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index f06016966..e515fb26a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1213,6 +1213,10 @@ function status_editor($a, $x, $popup = false) { if(! $cipher) $cipher = 'aes256'; + // avoid illegal offset errors + if(! array_key_exists('permissions',$x)) + $x['permissions'] = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ]; + $jotplugins = ''; call_hooks('jot_tool', $jotplugins); -- cgit v1.2.3 From fb9544badd66043bf7ee5a7566ba288ad7da29fa Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 25 Sep 2016 17:06:13 -0700 Subject: null_date conversion; phase 1 --- include/conversation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e515fb26a..62b22e893 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -723,7 +723,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''), - 'expiretime' => (($item['expires'] !== NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''), + 'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''), 'location' => $location, 'indent' => '', 'owner_name' => $owner_name, -- cgit v1.2.3 From bba7fe24e91b5899035df42afb31276a6c6f1d8b Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 25 Sep 2016 20:34:36 -0700 Subject: subtle indicator of your own response verb activity --- include/conversation.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index e515fb26a..c6eb7c589 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1053,6 +1053,9 @@ function builtin_activity_puller($item, &$conv_responses) { $conv_responses[$mode][$item['thr_parent']] ++; $conv_responses[$mode][$item['thr_parent'] . '-l'][] = $url; + if(get_observer_hash() && get_observer_hash() === $item['author_xchan']) { + $conv_responses[$mode][$item['thr_parent'] . '-m'] = true; + } // there can only be one activity verb per item so if we found anything, we can stop looking return; -- cgit v1.2.3 From eae9774cb6fd1c4205f5a63b608adf64495de750 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 26 Sep 2016 16:20:36 -0700 Subject: missing categories in preview mode --- include/conversation.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index c6eb7c589..1cac60bf9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -712,10 +712,8 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'forged' => $forged, 'txt_cats' => t('Categories:'), 'txt_folders' => t('Filed under:'), - 'has_cats' => ((count($categories)) ? 'true' : ''), - 'has_folders' => ((count($folders)) ? 'true' : ''), - 'categories' => $categories, - 'folders' => $folders, + 'has_cats' => ((count($body['categories'])) ? 'true' : ''), + 'has_folders' => ((count($body['folders'])) ? 'true' : ''), 'text' => strip_tags($body['html']), 'ago' => relative_date($item['created']), 'app' => $item['app'], -- cgit v1.2.3