aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-03 23:39:38 -0700
committerfriendica <info@friendica.com>2012-11-03 23:39:38 -0700
commitaaa5a2638c9cf773163eb60fbffae597d77afc22 (patch)
treed9e3035326af7028a17fd4b5fac423840a448405
parentd72bad4efa1fdf4b02c65d22c141e3cac338653a (diff)
downloadvolse-hubzilla-aaa5a2638c9cf773163eb60fbffae597d77afc22.tar.gz
volse-hubzilla-aaa5a2638c9cf773163eb60fbffae597d77afc22.tar.bz2
volse-hubzilla-aaa5a2638c9cf773163eb60fbffae597d77afc22.zip
feature enable 'dislike' - backend
-rw-r--r--include/ItemObject.php4
-rw-r--r--include/conversation.php8
-rw-r--r--view/tpl/wall_thread.tpl2
3 files changed, 11 insertions, 3 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 8a7bdea3a..bb507fe00 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -159,7 +159,7 @@ class Item extends BaseObject {
}
$like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : '');
- $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
+ $dislike = ((x($dlike,$item['uri']) && feature_enabled($conv->get_profile_owner(),'dislike')) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : '');
/*
* We should avoid doing this all the time, but it depends on the conversation mode
@@ -242,6 +242,8 @@ class Item extends BaseObject {
'vote' => $buttons,
'like' => $like,
'dislike' => $dislike,
+ 'nolike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? '1' : ''),
+
'comment' => $this->get_comment_box($indent),
'previewing' => ($conv->is_preview() ? ' preview ' : ''),
'wait' => t('Please wait'),
diff --git a/include/conversation.php b/include/conversation.php
index 87cc1b737..13b6c566c 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1001,7 +1001,9 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
// Can we put this after the visibility check?
like_puller($a,$item,$alike,'like');
- like_puller($a,$item,$dlike,'dislike');
+
+ if(feature_enabled($profile_uid,'dislike'))
+ like_puller($a,$item,$dlike,'dislike');
// Only add what is visible
if($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) {
@@ -1069,7 +1071,8 @@ old code
foreach($items as $item) {
like_puller($a,$item,$alike,'like');
- like_puller($a,$item,$dlike,'dislike');
+ if(feature_enabled($profile_uid,'dislike'))
+ like_puller($a,$item,$dlike,'dislike');
if($item['id'] == $item['parent']) {
$threads[] = $item;
@@ -1401,6 +1404,7 @@ old code
'vote' => $likebuttons,
'like' => $like,
'dislike' => $dislike,
+ 'nolike' => ((feature_enabled($profile_uid,'dislike')) ? '1' : ''),
'comment' => $comment,
'previewing' => $previewing,
'wait' => t('Please wait'),
diff --git a/view/tpl/wall_thread.tpl b/view/tpl/wall_thread.tpl
index fd294cfc3..2c4b709fb 100644
--- a/view/tpl/wall_thread.tpl
+++ b/view/tpl/wall_thread.tpl
@@ -64,7 +64,9 @@
{{ if $item.vote }}
<div class="wall-item-like-buttons" id="wall-item-like-buttons-$item.id">
<a href="#" class="icon like" title="$item.vote.like.0" onclick="dolike($item.id,'like'); return false"></a>
+ {{ if $item.nolike }}
<a href="#" class="icon dislike" title="$item.vote.dislike.0" onclick="dolike($item.id,'dislike'); return false"></a>
+ {{ endif }}
{{ if $item.vote.share }}<a href="#" class="icon recycle wall-item-share-buttons" title="$item.vote.share.0" onclick="jotShare($item.id); return false"></a>{{ endif }}
</div>
{{ endif }}