From c69494524590b7ffa07fcab6780c603ded2cb720 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 9 Feb 2015 21:18:50 -0800 Subject: like formatting for extended consensus items --- include/ItemObject.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 344664fd2..8f1112f6a 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -135,6 +135,28 @@ class Item extends BaseObject { $location = format_location($item); + + // process action responses - e.g. like/dislike/attend/agree/whatever + $response_verbs = array('like'); + if(feature_enabled($conv->get_profile_owner(),'dislike')) + $response_verbs[] = 'dislike'; + if($item['resource_type'] === 'event') { + $response_verbs[] = 'attendyes'; + $response_verbs[] = 'attendno'; + $response_verbs[] = 'attendmaybe'; + } + $consensus = (($item['item_flags'] & ITEM_CONSENSUS)? true : false); + if($consensus) { + $response_verbs[] = 'agree'; + $response_verbs[] = 'disagree'; + $response_verbs[] = 'abstain'; + } + + $responses = get_responses($conv_responses,$response_verbs,$this,$item); + + + $like_button_label = tt('Like','Likes',$like_count,'noun'); + $like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : ''); $like_list = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid'] . '-l'] : ''); if (count($like_list) > MAX_LIKERS) { @@ -307,6 +329,7 @@ class Item extends BaseObject { 'comment_count_txt' => $comment_count_txt, 'list_unseen_txt' => $list_unseen_txt, 'markseen' => t('Mark all seen'), + 'responses' => $responses, 'like_count' => $like_count, 'like_list' => $like_list, 'like_list_part' => $like_list_part, -- cgit v1.2.3 From 81e7b47b76e6cc72995e910190e4164d28ec5664 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Feb 2015 00:11:37 -0800 Subject: more progress on event confirmations --- include/ItemObject.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 8f1112f6a..3638b2ffb 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -134,16 +134,19 @@ class Item extends BaseObject { $profile_name = $item['author']['xchan_name']; $location = format_location($item); - + $isevent = false; + $attend = null; // process action responses - e.g. like/dislike/attend/agree/whatever $response_verbs = array('like'); if(feature_enabled($conv->get_profile_owner(),'dislike')) $response_verbs[] = 'dislike'; - if($item['resource_type'] === 'event') { + if($item['obj_type'] === ACTIVITY_OBJ_EVENT) { $response_verbs[] = 'attendyes'; $response_verbs[] = 'attendno'; $response_verbs[] = 'attendmaybe'; + $isevent = true; + $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); } $consensus = (($item['item_flags'] & ITEM_CONSENSUS)? true : false); if($consensus) { @@ -275,6 +278,8 @@ class Item extends BaseObject { 'body' => $body, 'text' => strip_tags($body), 'id' => $this->get_id(), + 'isevent' => $isevent, + 'attend' => $attend, 'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, $item['author']['xchan_addr']), 'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), $item['owner']['xchan_addr']), 'llink' => $item['llink'], -- cgit v1.2.3 From 79223b6b3d38bfbfb3a6d9530f6ccc5b7bb096c8 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Feb 2015 19:10:18 -0800 Subject: item voting tools --- include/ItemObject.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 3638b2ffb..7f5ee83a3 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -148,11 +148,13 @@ class Item extends BaseObject { $isevent = true; $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); } + $consensus = (($item['item_flags'] & ITEM_CONSENSUS)? true : false); if($consensus) { $response_verbs[] = 'agree'; $response_verbs[] = 'disagree'; $response_verbs[] = 'abstain'; + $conlabels = array( t('I agree'), t('I disagree'), t('I abstain')); } $responses = get_responses($conv_responses,$response_verbs,$this,$item); @@ -280,6 +282,8 @@ class Item extends BaseObject { 'id' => $this->get_id(), 'isevent' => $isevent, 'attend' => $attend, + 'consensus' => $consensus, + 'conlabels' => $conlabels, 'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, $item['author']['xchan_addr']), 'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), $item['owner']['xchan_addr']), 'llink' => $item['llink'], -- cgit v1.2.3 From 149a588b11dae7b21f24e728be45fa04224bacd3 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Feb 2015 20:21:54 -0800 Subject: ensure we have permission before displaying buttons --- include/ItemObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 7f5ee83a3..9dc364f9e 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -141,7 +141,7 @@ class Item extends BaseObject { $response_verbs = array('like'); if(feature_enabled($conv->get_profile_owner(),'dislike')) $response_verbs[] = 'dislike'; - if($item['obj_type'] === ACTIVITY_OBJ_EVENT) { + if($item['obj_type'] === ACTIVITY_OBJ_EVENT && $this->is_commentable) { $response_verbs[] = 'attendyes'; $response_verbs[] = 'attendno'; $response_verbs[] = 'attendmaybe'; @@ -149,7 +149,7 @@ class Item extends BaseObject { $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); } - $consensus = (($item['item_flags'] & ITEM_CONSENSUS)? true : false); + $consensus = ((($item['item_flags'] & ITEM_CONSENSUS) && $this->is_commentable) ? true : false); if($consensus) { $response_verbs[] = 'agree'; $response_verbs[] = 'disagree'; -- cgit v1.2.3 From 583af02f71f17039202a2e4009a3ab8586774663 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Feb 2015 20:43:04 -0800 Subject: fix permissions --- include/ItemObject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 9dc364f9e..ff7da2418 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -141,7 +141,7 @@ class Item extends BaseObject { $response_verbs = array('like'); if(feature_enabled($conv->get_profile_owner(),'dislike')) $response_verbs[] = 'dislike'; - if($item['obj_type'] === ACTIVITY_OBJ_EVENT && $this->is_commentable) { + if($item['obj_type'] === ACTIVITY_OBJ_EVENT && $this->is_commentable()) { $response_verbs[] = 'attendyes'; $response_verbs[] = 'attendno'; $response_verbs[] = 'attendmaybe'; @@ -149,7 +149,7 @@ class Item extends BaseObject { $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); } - $consensus = ((($item['item_flags'] & ITEM_CONSENSUS) && $this->is_commentable) ? true : false); + $consensus = ((($item['item_flags'] & ITEM_CONSENSUS) && $this->is_commentable()) ? true : false); if($consensus) { $response_verbs[] = 'agree'; $response_verbs[] = 'disagree'; -- cgit v1.2.3 From e8bdf2b8d741354fd479bd5fc31f704e2c6f6c88 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Feb 2015 21:21:18 -0800 Subject: more permissions tweaking --- include/ItemObject.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index ff7da2418..c429a0131 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -136,30 +136,40 @@ class Item extends BaseObject { $location = format_location($item); $isevent = false; $attend = null; + $canvote = false; // process action responses - e.g. like/dislike/attend/agree/whatever $response_verbs = array('like'); if(feature_enabled($conv->get_profile_owner(),'dislike')) $response_verbs[] = 'dislike'; - if($item['obj_type'] === ACTIVITY_OBJ_EVENT && $this->is_commentable()) { + if($item['obj_type'] === ACTIVITY_OBJ_EVENT) { $response_verbs[] = 'attendyes'; $response_verbs[] = 'attendno'; $response_verbs[] = 'attendmaybe'; - $isevent = true; - $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); + if($this->is_commentable()) { + $isevent = true; + $attend = array( t('I will attend'), t('I will not attend'), t('I might attend')); + } } - $consensus = ((($item['item_flags'] & ITEM_CONSENSUS) && $this->is_commentable()) ? true : false); + $consensus = (($item['item_flags'] & ITEM_CONSENSUS) ? true : false); if($consensus) { $response_verbs[] = 'agree'; $response_verbs[] = 'disagree'; $response_verbs[] = 'abstain'; - $conlabels = array( t('I agree'), t('I disagree'), t('I abstain')); + if($this->is_commentable()) { + $conlabels = array( t('I agree'), t('I disagree'), t('I abstain')); + $canvote = true; + } } + if(! feature_enabled($conv->get_profile_owner(),'dislike')) + unset($conv_responses['dislike']); + $responses = get_responses($conv_responses,$response_verbs,$this,$item); + $like_button_label = tt('Like','Likes',$like_count,'noun'); $like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : ''); @@ -284,6 +294,7 @@ class Item extends BaseObject { 'attend' => $attend, 'consensus' => $consensus, 'conlabels' => $conlabels, + 'canvote' => $canvote, 'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, $item['author']['xchan_addr']), 'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), $item['owner']['xchan_addr']), 'llink' => $item['llink'], -- cgit v1.2.3 From da2349bb6a85d13f0aa29046bef3021cf0c884ba Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 12 Feb 2015 17:45:25 -0800 Subject: provide relief to sites that are severely impacted by the slow ITEM_UNSEEN searches. This does not incorporate any other flag optimisations as that will require a major DB update and possibly involve significant downtime. This is just to bite off a little chunk now and provide some much needed relief. --- include/ItemObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index c429a0131..136e08eb7 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -612,7 +612,7 @@ class Item extends BaseObject { if((! visible_activity($child->data)) || array_key_exists('author_blocked',$child->data)) { continue; } - if($child->data['item_flags'] & ITEM_UNSEEN) + if(intval($child->data['item_unseen'])) $total ++; } } -- cgit v1.2.3 From 533f39debe494dc826570ff030fcda35041d9038 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 16 Feb 2015 17:01:13 -0800 Subject: bring back like/dislike summaries on photos --- include/ItemObject.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 136e08eb7..1785d55e7 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -168,10 +168,6 @@ class Item extends BaseObject { $responses = get_responses($conv_responses,$response_verbs,$this,$item); - - - $like_button_label = tt('Like','Likes',$like_count,'noun'); - $like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : ''); $like_list = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid'] . '-l'] : ''); if (count($like_list) > MAX_LIKERS) { -- cgit v1.2.3 From b3a9a6c802170a15cc58fd3af966b35f81c50818 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 11 Mar 2015 18:56:28 -0700 Subject: remove the now redundant audio/video buttons and label the editor text style buttons which didn't have them. Unused editor buttons were commented in case we need to bring them back. If things go smoothly we can remove them. Use the link icon going forward - for all links. --- include/ItemObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 1785d55e7..4fc01e6d4 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -672,7 +672,7 @@ class Item extends BaseObject { '$edquote' => t('Quote'), '$edcode' => t('Code'), '$edimg' => t('Image'), - '$edurl' => t('Link'), + '$edurl' => t('Insert Link'), '$edvideo' => t('Video'), '$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''), '$indent' => $indent, -- cgit v1.2.3 From c2517eca56a032c33208a786dc2734919e31c8e6 Mon Sep 17 00:00:00 2001 From: jeroenpraat Date: Thu, 2 Apr 2015 02:23:26 +0200 Subject: Update/fix Dutch and removing an ugly space --- include/ItemObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ItemObject.php') diff --git a/include/ItemObject.php b/include/ItemObject.php index 4fc01e6d4..d5601edf5 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -309,7 +309,7 @@ class Item extends BaseObject { 'title_tosource' => get_pconfig($conv->get_profile_owner(),'system','title_tosource'), 'ago' => relative_date($item['created']), 'app' => $item['app'], - 'str_app' => sprintf( t(' from %s'), $item['app']), + 'str_app' => sprintf( t('from %s'), $item['app']), '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')) : ''), -- cgit v1.2.3