From 11f0b45a9015a717e6e0da1bfd5a1c61381d64ed Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 18 Nov 2014 16:58:36 -0800 Subject: blog mode - turn the comment link into a button and group with the likes/dislikes --- mod/like.php | 18 +++++------------- view/tpl/conv_list.tpl | 9 ++++++--- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/mod/like.php b/mod/like.php index b56611197..04a2b43cd 100755 --- a/mod/like.php +++ b/mod/like.php @@ -263,26 +263,18 @@ function like_content(&$a) { else killme(); - - $r = q("SELECT * FROM item WHERE verb = '%s' AND item_restrict = 0 + $r = q("SELECT id FROM item WHERE verb = '%s' AND item_restrict = 0 AND author_xchan = '%s' AND ( parent = %d OR thr_parent = '%s') LIMIT 1", dbesc($activity), dbesc($observer['xchan_hash']), intval($item_id), dbesc($item['mid']) ); - if($r) { - $like_item = $r[0]; - - // Already liked/disliked it, delete it - $r = q("UPDATE item SET item_restrict = ( item_restrict & ~%d ), changed = '%s' WHERE id = %d", - intval(ITEM_DELETED), - dbesc(datetime_convert()), - intval($like_item['id']) - ); - - proc_run('php',"include/notifier.php","like",$like_item['id']); + if($r) { + // already liked it. Drop that item. + require_once('include/items.php'); + drop_item($r[0]['id'],false,DROPITEM_PHASE1); return; } diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl index b9a966e93..444734f48 100755 --- a/view/tpl/conv_list.tpl +++ b/view/tpl/conv_list.tpl @@ -104,7 +104,12 @@
-
+
+ + +
{{if $item.unseen_comments}}
{{/if}} + {{if $item.like_count}}
@@ -164,8 +169,6 @@ {{/if}}
-
-- cgit v1.2.3