Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv19593
Modified Files:
index.php serendipity_functions.inc.php
serendipity_lang_en.inc.php
Log Message:
Adding unSubscribe-URI to subscription mails
Someone please translate into German
unSubscription URI looks like "[blogPath]/unsubscribe/[email]/[entry_id]/" and is sent with every notification-mail
NOTE: Someone look at the fixme :)
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- index.php 30 Jul 2003 16:12:17 -0000 1.23
+++ index.php 16 Aug 2003 20:03:13 -0000 1.24
@@ -114,6 +114,11 @@
print $data;
exit;
}
+} else if (preg_match('@/unsubscribe/(.*)/([0-9]+)@', $uri, $res)) {
+ serendipity_cancelSubscription($res[1], $res[2]);
+ /* Fixme: send the user to the unsubscribed entry */
+ header("Location: {$serendipity['serendipityHTTPPath']}index.php");
+ exit;
} else if (preg_match('@/admin$@', $uri)) {
header("Location: {$serendipity['serendipityHTTPPath']}serendipity_admin.php");
exit;
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- serendipity_functions.inc.php 16 Aug 2003 11:05:48 -0000 1.132
+++ serendipity_functions.inc.php 16 Aug 2003 20:03:13 -0000 1.133
@@ -891,11 +891,18 @@
$serendipity['blogTitle'],
$title,
$poster,
- $entryURI
+ $entryURI,
+ $serendipity['baseURL'] .'unsubscribe/'. $subscriber['email'] .'/'. $entry_id
);
mail($subscriber['email'], $subject, $text . $serendipity['signature'], "From: {$serendipity['blogTitle']} <$fromEmail>\r\n");
}
+}
+
+function serendipity_cancelSubscription($email, $entry_id) {
+ global $serendipity;
+ $sql = "UPDATE {$serendipity['dbPrefix']}comments SET subscribed = 'false' WHERE entry_id = $entry_id AND email = '$email'";
+ serendipity_db_query($sql);
}
function serendipity_sendComment($to, $fromName, $fromEmail, $fromUrl, $id, $title, $comment, $type = 'NORMAL') {
Index: serendipity_lang_en.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- serendipity_lang_en.inc.php 16 Aug 2003 11:05:48 -0000 1.30
+++ serendipity_lang_en.inc.php 16 Aug 2003 20:03:13 -0000 1.31
@@ -248,7 +248,7 @@
define('SUBSCRIBE_TO_THIS_ENTRY', 'Subscribe to this entry');
define('NEW_COMMENT_TO_SUBSCRIBED_ENTRY', 'New comment to subscribed entry "%s"');
-define('SUBSCRIPTION_MAIL', "Hello %s,\n\nA new comment was made to the entry you are monitoring on \"%s\", entitled \"%s\"\nThe name of the poster is: %s\n\nYou can find the entry here: %s\n");
+define('SUBSCRIPTION_MAIL', "Hello %s,\n\nA new comment was made to the entry you are monitoring on \"%s\", entitled \"%s\"\nThe name of the poster is: %s\n\nYou can find the entry here: %s\n\nYou can unsubscribe by clicking on this link: %s\n");
define('SIGNATURE', "\n-- \n%s is powered by Serendipity.\nThe best blog around, you can use it too.\nCheck out <http://s9y.org> to find out how.");
define('serendipity_LANG_LOADED', true);
|