[geeklog-hg] geeklog: Updated Comment Notifications for comments that get app...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Thu Apr 11 09:30:44 EDT 2013
changeset 9048:97b04f78d957
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/97b04f78d957
user: Tom <websitemaster at cogeco.net>
date: Thu Apr 11 09:30:08 2013 -0400
description:
Updated Comment Notifications for comments that get approved later. Only one notification will now be sent out to a user if they subscribed multiple times.
diffstat:
system/lib-comment.php | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diffs (30 lines):
diff -r ae72aa08d4ac -r 97b04f78d957 system/lib-comment.php
--- a/system/lib-comment.php Wed Apr 10 11:27:35 2013 -0400
+++ b/system/lib-comment.php Thu Apr 11 09:30:08 2013 -0400
@@ -1380,9 +1380,8 @@
. "FROM {$_TABLES['comments']} AS c, {$_TABLES['comments']} AS c2, "
. "{$_TABLES['commentnotifications']} AS cn "
. "WHERE c2.cid = cn.cid AND (c.lft >= c2.lft AND c.lft <= c2.rht) "
- . "AND c.cid = $pid";
-
- $result = DB_query($sql);
+ . "AND c.cid = $pid GROUP BY cn.uid";
+ $result = DB_query($sql);
$A = DB_fetchArray($result);
if ($A !== false) {
CMT_sendReplyNotification($A);
@@ -1987,7 +1986,13 @@
// notify of new published comment
if ($_CONF['allow_reply_notifications'] == 1 && $A['pid'] > 0) {
- $result = DB_query("SELECT cid, uid, deletehash FROM {$_TABLES['commentnotifications']} WHERE cid = {$A['pid']}");
+ // $sql = "SELECT cid, uid, deletehash FROM {$_TABLES['commentnotifications']} WHERE cid = $pid"; // Used in Geeklog 2.0.0 and before. Notification sent only if someone directly replies to the comment (not a reply of a reply)
+ $sql = "SELECT cn.cid, cn.uid, cn.deletehash "
+ . "FROM {$_TABLES['comments']} AS c, {$_TABLES['comments']} AS c2, "
+ . "{$_TABLES['commentnotifications']} AS cn "
+ . "WHERE c2.cid = cn.cid AND (c.lft >= c2.lft AND c.lft <= c2.rht) "
+ . "AND c.cid = $pid GROUP BY cn.uid";
+ $result = DB_query($sql);
$B = DB_fetchArray($result);
if ($B !== false) {
CMT_sendReplyNotification($B);
More information about the geeklog-cvs
mailing list