[geeklog-hg] geeklog: Comment Notifications will now be triggered when someon...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Wed Apr 10 11:27:56 EDT 2013
changeset 9047:ae72aa08d4ac
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/ae72aa08d4ac
user: Tom <websitemaster at cogeco.net>
date: Wed Apr 10 11:27:35 2013 -0400
description:
Comment Notifications will now be triggered when someone replies directly to your comment or any comment reply in your particular comment branch. (feature request #0001222)
diffstat:
system/lib-comment.php | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diffs (21 lines):
diff -r baf7baae5c3b -r ae72aa08d4ac system/lib-comment.php
--- a/system/lib-comment.php Tue Apr 09 01:37:25 2013 +0900
+++ b/system/lib-comment.php Wed Apr 10 11:27:35 2013 -0400
@@ -1373,8 +1373,16 @@
// Must occur after table unlock, only with valid $cid and $pid
// NOTE: This could be modified to send notifications to all parents in the comment tree
// with only a modification to the below SELECT statement
+ // See: http://wiki.geeklog.net/index.php/CommentAlgorithm
if ($_CONF['allow_reply_notifications'] == 1 && $cid > 0 && $pid > 0) {
- $result = DB_query("SELECT cid, uid, deletehash FROM {$_TABLES['commentnotifications']} WHERE cid = $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";
+
+ $result = DB_query($sql);
$A = DB_fetchArray($result);
if ($A !== false) {
CMT_sendReplyNotification($A);
More information about the geeklog-cvs
mailing list