aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/language/email/topic_notify_english.tpl4
-rw-r--r--phpBB/posting.php58
-rw-r--r--phpBB/templates/PSO/posting_body.tpl8
-rw-r--r--phpBB/templates/PSO/posting_preview.tpl2
4 files changed, 52 insertions, 20 deletions
diff --git a/phpBB/language/email/topic_notify_english.tpl b/phpBB/language/email/topic_notify_english.tpl
index 687a819565..1280ab15d4 100644
--- a/phpBB/language/email/topic_notify_english.tpl
+++ b/phpBB/language/email/topic_notify_english.tpl
@@ -4,4 +4,8 @@ You are receiving this email because you are watching the topic, "{TOPIC_TITLE}"
{TOPIC_URL}
+If you no longer wish to watch this topic you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link:
+
+{UN_WATCH_URL}
+
{EMAIL_SIG} \ No newline at end of file
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 1749196fb5..243cc6d547 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -97,7 +97,30 @@ else
$attach_sig = ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['preview']) ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : $userdata['user_attachsig'];
-$notify = ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['preview']) ) ? ( ( !empty($HTTP_POST_VARS['notify']) ) ? TRUE : 0 ) : $userdata['user_notify'];
+if($mode == "reply" && !empty($topic_id) )
+{
+ if( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['preview']) )
+ {
+ $notify = ( !empty($HTTP_POST_VARS['notify']) ) ? TRUE : 0;
+ }
+ else
+ {
+ $sql = "SELECT *
+ FROM " . TOPICS_WATCH_TABLE . "
+ WHERE topic_id = $topic_id
+ AND user_id = " . $userdata['user_id'];
+ if( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain topic watch information", "", __LINE__, __FILE__, $sql);
+ }
+
+ $notify = ( $db->sql_numrows($result)) ? TRUE : 0;
+ }
+}
+else
+{
+ $notify = ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['preview']) ) ? ( ( !empty($HTTP_POST_VARS['notify']) ) ? TRUE : 0 ) : $userdata['user_notify'];
+}
$preview = (isset($HTTP_POST_VARS['preview'])) ? TRUE : 0;
@@ -541,18 +564,21 @@ if( ($mode == "newtopic" || $mode == "reply") && $topic_status == TOPIC_UNLOCKED
{
if($email_set[$i]['user_email'] != "")
{
- $email_headers = "From: " . $board_config['board_email_from'] . "\r\n";
+ $email_headers = "From: " . $board_config['board_email_from'] . "\nReturn-Path: " . $board_config['board_email_from'] . "\r\n";
$emailer->use_template("topic_notify");
$emailer->email_address($email_set[$i]['user_email']);
$emailer->set_subject($lang['Topic_reply_notification']);
$emailer->extra_headers($email_headers);
+ $path = (dirname($HTTP_SERVER_VARS['REQUEST_URI']) == "/") ? "" : dirname($HTTP_SERVER_VARS['REQUEST_URI']);
+
$emailer->assign_vars(array(
"USERNAME" => $email_set[$i]['username'],
"SITENAME" => $board_config['sitename'],
"TOPIC_TITLE" => $email_set[$i]['topic_title'],
- "TOPIC_URL" => "http://" . $SERVER_NAME . "/viewtopic.$phpEx?" . POST_TOPIC_URL . "=$new_topic_id",
+ "TOPIC_URL" => "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . $path . "/viewtopic.$phpEx?" . POST_POST_URL . "=$new_post_id#$new_post_id",
+ "UN_WATCH_URL" => "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . $path . "/viewtopic.$phpEx?" . POST_TOPIC_URL . "=$new_topic_id&unwatch=topic",
"EMAIL_SIG" => $board_config['board_email'])
);
@@ -582,11 +608,11 @@ if( ($mode == "newtopic" || $mode == "reply") && $topic_status == TOPIC_UNLOCKED
// Handle notification request ... not complete
// only fully functional for new posts
//
- if( !empty($notify) )
+ if( isset($notify) )
{
if($mode == "reply")
{
- $sql = "SELECT notify_status
+ $sql = "SELECT *
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $new_topic_id
AND user_id = " . $userdata['user_id'];
@@ -599,11 +625,23 @@ if( ($mode == "newtopic" || $mode == "reply") && $topic_status == TOPIC_UNLOCKED
{
if( !$notify )
{
-
+ $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
+ WHERE topic_id = $new_topic_id
+ AND user_id = " . $userdata['user_id'];
+ if( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't delete topic watch information", "", __LINE__, __FILE__, $sql);
+ }
}
}
else if( $notify )
{
+ $sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)
+ VALUES (" . $userdata['user_id'] . ", $new_topic_id, 0)";
+ if( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't insert topic watch information", "", __LINE__, __FILE__, $sql);
+ }
}
}
else if( $notify )
@@ -1379,14 +1417,6 @@ if( $user_sig != "" )
}
//
-// Notify selection
-//
-if($mode == "newtopic" || $preview || ( $mode == "editpost" && $notify_show ) )
-{
- $template->assign_block_vars("notify_checkbox", array());
-}
-
-//
// Delete selection
//
if($mode == 'editpost' && !$preview && ( $is_last_post || $is_auth['auth_mod'] ) )
diff --git a/phpBB/templates/PSO/posting_body.tpl b/phpBB/templates/PSO/posting_body.tpl
index 79e4e6f15d..8a62866890 100644
--- a/phpBB/templates/PSO/posting_body.tpl
+++ b/phpBB/templates/PSO/posting_body.tpl
@@ -31,11 +31,11 @@ function insertCode(formObj, selectObj)
<td class="row2"><span class="courier"><input type="text" name="subject" size="50" maxlength="100" value="{SUBJECT}" /></span></td>
</tr>
<tr>
- <td class="row1"><span class="gen"><b>{L_MESSAGE_BODY}</b></span><br><br><span class="gensmall">{L_HTML_IS} <u>{HTML_STATUS}</u><br />{L_BBCODE_IS} <u>{BBCODE_STATUS}</u><br />{L_SMILIES_ARE} <u>{SMILIES_STATUS}</u></span></td>
+ <td class="row1"><span class="gen"><b>{L_MESSAGE_BODY}</b></span><br /><br /><span class="gensmall">{L_HTML_IS} <u>{HTML_STATUS}</u><br />{L_BBCODE_IS} <u>{BBCODE_STATUS}</u><br />{L_SMILIES_ARE} <u>{SMILIES_STATUS}</u></span></td>
<td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
- <td><span class="gen"><textarea name="message" rows="10" cols="45" wrap="virtual">{MESSAGE}</textarea></span></td>
- <td valign="top">&nbsp;<span class="gensmall">BBcodes:</span><br><span class="couriersmall"><select class="small" name="addbbcode" size="6" onchange="insertCode(this.form, this);"> <option value="[b][/b]">[b] [/b]</option> <option value="[i][/i]">[i] [/i]</option> <option value="[quote][/quote]">[quote] [/quote]</option> <option value="[code][/code]">[code] [/code]</option> <option value="[list][/list]">[list] [/list]</option> <option value="[list=][/list]">[list=] [/list]</option> <option value="[img][/img]">[img] [/img]</option> <option value="[url][/url]">[url] [/url]</option></select></span> <br clear="all" />&nbsp;<span class="gensmall">Smiley codes:</span><br><span class="couriersmall"><select class="small" name="addsmiley" size="1" onchange="insertCode(this.form, this);"> <option value=":)">Smiley</option> </option> <option value=";)">Wink</option> <option value=":d">Big Grin</option> <option value=":lol:">Laugh Out Loud</option> <option value=":(">Sad</option> <option value=":o">Eek!</option> <option value=":">Eek!</option> <option value=":oops:">Opps!</option> <option value="8)">Cool</option> <option value=":?">Confused</option> <option value=":roll:">Rolling Eyes</option> <option value=":p">Razz</option> <option value=":x">Mad</option> <option value=":|">Neutral</option> <option value=":!:">Exclamation</option> <option value=":?:">Question</option> <option value=":idea:">Idea</option> <option value=":arrow:">Arrow</option></select></span></td>
+ <td><span class="courier"><textarea name="message" rows="10" cols="45" wrap="virtual">{MESSAGE}</textarea></span></td>
+ <td valign="top">&nbsp;<span class="gensmall">BBcodes:</span><br /><span class="couriersmall"><select class="small" name="addbbcode" size="6" onchange="insertCode(this.form, this);"> <option value="[b][/b]">[b] [/b]</option> <option value="[i][/i]">[i] [/i]</option> <option value="[quote][/quote]">[quote] [/quote]</option> <option value="[code][/code]">[code] [/code]</option> <option value="[list][/list]">[list] [/list]</option> <option value="[list=][/list]">[list=] [/list]</option> <option value="[img][/img]">[img] [/img]</option> <option value="[url][/url]">[url] [/url]</option></select></span> <br clear="all" />&nbsp;<span class="gensmall">Smiley codes:</span><br /><span class="couriersmall"><select class="small" name="addsmiley" size="1" onchange="insertCode(this.form, this);"> <option value=":)">Smiley</option> </option> <option value=";)">Wink</option> <option value=":d">Big Grin</option> <option value=":lol:">Laugh Out Loud</option> <option value=":(">Sad</option> <option value=":o">Eek!</option> <option value=":">Eek!</option> <option value=":oops:">Opps!</option> <option value="8)">Cool</option> <option value=":?">Confused</option> <option value=":roll:">Rolling Eyes</option> <option value=":p">Razz</option> <option value=":x">Mad</option> <option value=":|">Neutral</option> <option value=":!:">Exclamation</option> <option value=":?:">Question</option> <option value=":idea:">Idea</option> <option value=":arrow:">Arrow</option></select></span></td>
</tr>
</table></td>
</tr>
@@ -66,12 +66,10 @@ function insertCode(formObj, selectObj)
<td><span class="gen">{L_ATTACH_SIGNATURE}</span></td>
</tr>
<!-- END signature_checkbox -->
- <!-- BEGIN notify_checkbox -->
<tr>
<td><input type="checkbox" name="notify" {S_NOTIFY_CHECKED} /></td>
<td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td>
</tr>
- <!-- END notify_checkbox -->
<!-- BEGIN delete_checkbox -->
<tr>
<td><input type="checkbox" name="delete" /></td>
diff --git a/phpBB/templates/PSO/posting_preview.tpl b/phpBB/templates/PSO/posting_preview.tpl
index 7c4d64a108..4965b6dd2c 100644
--- a/phpBB/templates/PSO/posting_preview.tpl
+++ b/phpBB/templates/PSO/posting_preview.tpl
@@ -11,7 +11,7 @@
<tr>
<th>&nbsp;{L_MESSAGE}&nbsp;</th>
</tr>
- <tr bgcolor="{ROW_COLOR}">
+ <tr bgcolor="{T_TD_COLOR1}">
<td height="100%"><table width="100%" height="100%" cellspacing="1" cellpadding="0" border="0">
<tr>
<td><img src="images/icon_minipost.gif" alt="Post image icon" /><span class="gensmall">{L_POSTED}: {POST_DATE}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post Subject: {POST_SUBJECT}</span><hr /></td>