aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-05-08 13:44:43 +0200
committermarijus <mario@mariovavti.com>2014-05-08 13:44:43 +0200
commit8144498803a589f9179dea556acc8332381a93af (patch)
tree1c075eee98762ee724beffdd36a700ddbcbe5503 /include
parent1a4c99ec0232899ac791fdac7d9a509048f94ec5 (diff)
downloadvolse-hubzilla-8144498803a589f9179dea556acc8332381a93af.tar.gz
volse-hubzilla-8144498803a589f9179dea556acc8332381a93af.tar.bz2
volse-hubzilla-8144498803a589f9179dea556acc8332381a93af.zip
like indicator rewrite
Diffstat (limited to 'include')
-rw-r--r--include/ItemObject.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 2922ee473..36070335d 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -123,6 +123,14 @@ class Item extends BaseObject {
$location = format_location($item);
+ $like_count = ((x($alike,$item['mid'])) ? $alike[$item['mid']] : '');
+ $like_list = ((x($alike,$item['mid'])) ? $alike[$item['mid'] . '-l'] : '');
+ $like_button_label = ((x($alike,$item['mid'])) && ($alike[$item['mid']] < 2 ) ? t('like') : t('likes'));
+ if (feature_enabled($conv->get_profile_owner(),'dislike')) {
+ $dislike_count = ((x($dlike,$item['mid'])) ? $dlike[$item['mid']] : '');
+ $dislike_list = ((x($dlike,$item['mid'])) ? $dlike[$item['mid'] . '-l'] : '');
+ $dislike_button_label = ((x($dlike,$item['mid'])) && ($dlike[$item['mid']] < 2) ? t('dislike') : t('dislikes'));
+ }
$showlike = ((x($alike,$item['mid'])) ? format_like($alike[$item['mid']],$alike[$item['mid'] . '-l'],'like',$item['mid']) : '');
$showdislike = ((x($dlike,$item['mid']) && feature_enabled($conv->get_profile_owner(),'dislike'))
@@ -251,7 +259,12 @@ class Item extends BaseObject {
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''),
// end toolbar buttons
-
+ 'like_count' => $like_count,
+ 'like_list' => $like_list,
+ 'like_button_label' => $like_button_label,
+ 'dislike_count' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_count : ''),
+ 'dislike_list' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list : ''),
+ 'dislike_button_label' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_button_label : ''),
'showlike' => $showlike,
'showdislike' => $showdislike,
'comment' => $this->get_comment_box($indent),