]> git.mxchange.org Git - friendica.git/commitdiff
Global setting for the behaviour of likes.
authorMichael Vogel <icarus@dabo.de>
Mon, 23 Feb 2015 11:44:50 +0000 (12:44 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 23 Feb 2015 11:44:50 +0000 (12:44 +0100)
include/items.php
mod/network.php

index 53bacbcd054a50e6ce6be133505f8586cccd7f9f..dd4021775380dd2121ceec673dbf97b202e09b81 100644 (file)
@@ -1435,7 +1435,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
 
        // update the commented timestamp on the parent
        // Only update "commented" if it is really a comment
-       if ($arr['verb'] == ACTIVITY_POST)
+       if (($arr['verb'] == ACTIVITY_POST) OR !get_config("system", "like_no_comment"))
                q("UPDATE `item` SET `commented` = '%s', `changed` = '%s' WHERE `id` = %d",
                        dbesc(datetime_convert()),
                        dbesc(datetime_convert()),
index fb980f31b6cc2fd99f55235c89962ef358d8801a..c180252f4440bedf17743efd7b07a350d4135c5e 100644 (file)
@@ -705,15 +705,19 @@ die("ss");
 
                // Fetch a page full of parent items for this page
                if($update) {
+                       if (!get_config("system", "like_no_comment"))
+                               $sql_extra4 = "(`item`.`deleted` = 0 OR `item`.`verb` = '".ACTIVITY_LIKE."' OR `item`.`verb` = '".ACTIVITY_DISLIKE."')";
+                       else
+                               $sql_extra4 = "`item`.`deleted` = 0";
+
                        $r = q("SELECT `item`.`parent` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
                                FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
-                               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
-                               and `item`.`moderated` = 0 and `item`.`unseen` = 1
+                               WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND $sql_extra4
+                               AND `item`.`moderated` = 0 AND `item`.`unseen` = 1
                                $sql_extra3 $sql_extra $sql_nets ORDER BY `item_id` DESC LIMIT 100",
                                intval(local_user())
                        );
-                       //      (`item`.`deleted` = 0 OR `item`.`verb` = '" . ACTIVITY_LIKE ."' OR `item`.`verb` = '" . ACTIVITY_DISLIKE . "')
                } else {
                        $r = q("SELECT `thread`.`iid` AS `item_id`, `thread`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
                                FROM $sql_table $sql_post_table STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`