aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-07-06 13:40:21 +0200
committerJoas Schilling <nickvergessen@gmx.de>2011-07-07 12:40:35 +0200
commitb2a65ac76db38e47c0644389ba737492ef6307f6 (patch)
tree4b7aec3dfc7a51b93c58e665c4d5257a8356a143 /phpBB/includes/functions_display.php
parent7e4460dbc99ce25dbeaa57eaedddea6112cfb9bf (diff)
downloadforums-b2a65ac76db38e47c0644389ba737492ef6307f6.tar
forums-b2a65ac76db38e47c0644389ba737492ef6307f6.tar.gz
forums-b2a65ac76db38e47c0644389ba737492ef6307f6.tar.bz2
forums-b2a65ac76db38e47c0644389ba737492ef6307f6.tar.xz
forums-b2a65ac76db38e47c0644389ba737492ef6307f6.zip
[ticket/10237] Use confirm-box to handle unwatching a forum/topic actions
PHPBB3-10237
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index d7422aa2c9..496da72344 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1097,22 +1097,34 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
}
- if ($_GET['unwatch'] == $mode)
- {
- $is_watching = 0;
+ if (confirm_box(true))
+ {
$sql = 'DELETE FROM ' . $table_sql . "
WHERE $where_sql = $match_id
AND user_id = $user_id";
$db->sql_query($sql);
- }
-
- $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
- meta_refresh(3, $redirect_url);
+ $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
+ $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
+ meta_refresh(3, $redirect_url);
+ trigger_error($message);
+ }
+ else
+ {
+ $s_hidden_fields = array(
+ 'uid' => $user->data['user_id'],
+ 'unwatch' => $mode,
+ 'start' => $start,
+ 'f' => $forum_id,
+ );
+ if ($mode != 'forum')
+ {
+ $s_hidden_fields['t'] = $topic_id;
+ }
- $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
- trigger_error($message);
+ confirm_box(false, 'UNWATCH_' . strtoupper($mode), build_hidden_fields($s_hidden_fields));
+ }
}
else
{