diff --git a/includes/ajaxHandler/comment.class.php b/includes/ajaxHandler/comment.class.php index 04339bb0..af842bb9 100644 --- a/includes/ajaxHandler/comment.class.php +++ b/includes/ajaxHandler/comment.class.php @@ -182,7 +182,7 @@ class AjaxComment extends AjaxHandler if (!$this->_get['id']) return Util::toJSON(['success' => 0]); - if ($votes = DB::Aowow()->selectRow('SELECT 1 AS success, SUM(IF(value > 0, value, 0)) AS up, SUM(IF(value < 0, -value, 0)) AS down FROM ?_comments_rates WHERE commentId = ?d GROUP BY commentId', $this->_get['id'])) + if ($votes = DB::Aowow()->selectRow('SELECT 1 AS success, SUM(IF(value > 0, value, 0)) AS up, SUM(IF(value < 0, -value, 0)) AS down FROM ?_comments_rates WHERE commentId = ?d and userId <> 0 GROUP BY commentId', $this->_get['id'])) return Util::toJSON($votes); else return Util::toJSON(['success' => 1, 'up' => 0, 'down' => 0]); diff --git a/includes/community.class.php b/includes/community.class.php index 8b5feb9e..090c9a20 100644 --- a/includes/community.class.php +++ b/includes/community.class.php @@ -71,7 +71,7 @@ class CommunityContent JOIN ?_account a ON c.userId = a.id LEFT JOIN - ?_comments_rates cr ON cr.commentId = c.id + ?_comments_rates cr ON cr.commentId = c.id AND cr.userId <> 0 LEFT JOIN ?_comments c2 ON c.replyTo = c2.id WHERE