Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv4755
Modified Files:
serendipity_functions.inc.php index.php
serendipity_lang_en.inc.php serendipity_lang_de.inc.php
Log Message:
* When a user unsubscribes, send him to the unsubscribed entry, thanks Garvin
* When a user unsubscribes, write a confirmation in the entry
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- serendipity_functions.inc.php 16 Aug 2003 21:26:42 -0000 1.136
+++ serendipity_functions.inc.php 17 Aug 2003 18:06:02 -0000 1.137
@@ -135,6 +135,7 @@
function serendipity_displayCommentForm($id) {
global $serendipity;
+
?>
<div class="serendipityCommentForm">
<form <?php echo ($serendipity['XHTML11'] ? 'id' : 'name'); ?>="serendipity_comment" action="<?php echo $serendipity['serendipityHTTPPath']; ?>comment.php" method="post" onsubmit="if (this.serendipity_remember.checked) rememberMe(this, '<?php echo $_SERVER['HTTP_HOST']; ?>')">
@@ -617,7 +618,14 @@
<br />
<div class="serendipity_commentsTitle"><?php echo COMMENTS; ?></div>
- <?php echo serendipity_printComments(serendipity_fetchComments($entry['id'])); ?>
+<?php
+ if (preg_match('@/unsubscribe/(.*)/([0-9]+)@', $_SERVER['REQUEST_URI'], $res)) {
+ echo '<div align="center" style="color: #FF0000; font-weight: bold;">'. sprintf(UNSUBSCRIBE_OK, urldecode($res[1])) .'</div><br />';
+ }
+
+
+ echo serendipity_printComments(serendipity_fetchComments($entry['id']));
+?>
<br />
<div class="serendipity_commentsTitle"><?php echo ADD_COMMENT; ?></div>
<?php echo serendipity_displayCommentForm($entry['id']); ?>
@@ -892,7 +900,7 @@
$title,
$poster,
$entryURI,
- $serendipity['baseURL'] .'unsubscribe/'. $subscriber['email'] .'/'. $entry_id
+ $serendipity['baseURL'] .'unsubscribe/'. urlencode($subscriber['email']) .'/'. $entry_id
);
mail($subscriber['email'], $subject, $text . $serendipity['signature'], "From: {$serendipity['blogTitle']} <$fromEmail>\r\n");
Index: index.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/index.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- index.php 17 Aug 2003 16:12:55 -0000 1.25
+++ index.php 17 Aug 2003 18:06:03 -0000 1.26
@@ -7,6 +7,11 @@
$track_referer = true;
$uri = $_SERVER['REQUEST_URI'];
+if (preg_match('@/unsubscribe/(.*)/([0-9]+)@', $uri, $res)) {
+ serendipity_cancelSubscription(urldecode($res[1]), $res[2]);
+ $uri = '/archives/'. $res[2] .'_untitled.html';
+}
+
if (preg_match('@/archives/(\d+)\.html@', $uri, $matches)) {
header('Content-Type: text/html; charset=ISO-8859-1');
$range = $matches[1];
@@ -114,11 +119,6 @@
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']}{$serendipity['indexFile']}");
- exit;
} else if (preg_match('@/admin$@', $uri)) {
header("Location: {$serendipity['serendipityHTTPPath']}serendipity_admin.php");
exit;
Index: serendipity_lang_en.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- serendipity_lang_en.inc.php 17 Aug 2003 16:12:55 -0000 1.32
+++ serendipity_lang_en.inc.php 17 Aug 2003 18:06:03 -0000 1.33
@@ -246,6 +246,7 @@
define('TOGGLE_ALL', 'Toggle expand all');
define('TOGGLE_OPTION', 'Toggle option');
define('SUBSCRIBE_TO_THIS_ENTRY', 'Subscribe to this entry');
+define('UNSUBSCRIBE_OK', "%s is now unsubscribed from 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\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.");
Index: serendipity_lang_de.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- serendipity_lang_de.inc.php 17 Aug 2003 16:12:55 -0000 1.23
+++ serendipity_lang_de.inc.php 17 Aug 2003 18:06:03 -0000 1.24
@@ -245,7 +245,9 @@
define('RUNNING', 'Sie benutzen serendipity v.');
define('TOGGLE_ALL', 'Alle Optionen ein-/ausblenden');
define('TOGGLE_OPTION', 'Option ein-/ausblenden');
+
define('SUBSCRIBE_TO_THIS_ENTRY', 'Bei Aktualisierung dieser Kommentare benachrichtigen');
+define('UNSUBSCRIBE_OK', 'TRANSLATE_ME');
define('NEW_COMMENT_TO_SUBSCRIBED_ENTRY', 'Benachrichtigung zu neuem Kommentar des Eintrags "%s"');
define('SUBSCRIPTION_MAIL', "Hallo %s,\n\nEin neues Kommentar wurde dem Eintrag hinzugefügt, den Sie auf \"%s\" namens \"%s\" finden.\nDer Name des Autoren ist: %s\n\nSie können den Eintrag hier finden: %s\n\nSie können diese Benachrichtung mit folgender URL kündigen: %s\n");
define('SIGNATURE', "\n-- \n%s wird betrieben mit Serendipity.\nDas allerbeste blog, Sie können es auch nutzen.\nWie das geht, sehen Sie auf <http://s9y.org>.");
|