mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/10237] Use confirm-box to handle unwatching a forum/topic actions
PHPBB3-10237
This commit is contained in:
parent
7e4460dbc9
commit
b2a65ac76d
2 changed files with 23 additions and 9 deletions
|
@ -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&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;
|
||||
}
|
||||
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
|
||||
meta_refresh(3, $redirect_url);
|
||||
|
||||
$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
|
||||
{
|
||||
|
|
|
@ -652,6 +652,8 @@ $lang = array_merge($lang, array(
|
|||
'UNREAD_PMS' => '<strong>%d</strong> unread messages',
|
||||
'UNREAD_POST' => 'Unread post',
|
||||
'UNREAD_POSTS' => 'Unread posts',
|
||||
'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?',
|
||||
'UNWATCH_TOPIC_CONFIRM' => 'Are you sure you wish to unsubscribe from this topic?',
|
||||
'UNWATCHED_FORUMS' => 'You are no longer subscribed to the selected forums.',
|
||||
'UNWATCHED_TOPICS' => 'You are no longer subscribed to the selected topics.',
|
||||
'UNWATCHED_FORUMS_TOPICS' => 'You are no longer subscribed to the selected entries.',
|
||||
|
|
Loading…
Add table
Reference in a new issue