aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2008-09-22 13:32:28 +0000
committerHenry Sudhof <kellanved@phpbb.com>2008-09-22 13:32:28 +0000
commit08428f8fa133c43c05066ff0e307abe01d943fa0 (patch)
tree6fd52c4b643026b0b1f82f172032f8b45513e7a6 /phpBB/includes/functions_display.php
parent0f14f278d0fa9d765bb141ab79242a34fa73a883 (diff)
downloadforums-08428f8fa133c43c05066ff0e307abe01d943fa0.tar
forums-08428f8fa133c43c05066ff0e307abe01d943fa0.tar.gz
forums-08428f8fa133c43c05066ff0e307abe01d943fa0.tar.bz2
forums-08428f8fa133c43c05066ff0e307abe01d943fa0.tar.xz
forums-08428f8fa133c43c05066ff0e307abe01d943fa0.zip
merging 8904
git-svn-id: file:///svn/phpbb/trunk@8905 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php35
1 files changed, 21 insertions, 14 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 9b37544c9e..ca97913887 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -231,22 +231,29 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($mark_read == 'forums' || $mark_read == 'all')
{
$redirect = build_url('mark');
-
- if ($mark_read == 'all')
+ $token = request_var('hash', '');
+ if (check_link_hash($token, 'global'))
{
- markread('all');
-
- $message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
+ if ($mark_read == 'all')
+ {
+ markread('all');
+ $message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
+ }
+ else
+ {
+ markread('topics', $forum_ids);
+ $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
+ }
+ meta_refresh(3, $redirect);
+ trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
}
else
{
- markread('topics', $forum_ids);
-
- $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
+ $message = sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
+ meta_refresh(3, $redirect);
+ trigger_error($message);
}
-
- meta_refresh(3, $redirect);
- trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
+
}
// Grab moderators ... if necessary
@@ -443,7 +450,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
}
$template->assign_vars(array(
- 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', 'f=' . $root_data['forum_id'] . '&amp;mark=forums') : '',
+ 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid('viewforum', 'hash=' . generate_link_hash('global') . '&amp;f=' . $root_data['forum_id'] . '&amp;mark=forums') : '',
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
@@ -986,7 +993,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
$match_id = ($mode == 'forum') ? $forum_id : $topic_id;
- $u_url = "uid={$user->data['user_id']}&amp;hash=" . generate_link_hash("{$mode}_$topic_id");
+ $u_url = "uid={$user->data['user_id']}&amp;hash=" . generate_link_hash("{$mode}_$match_id");
$u_url .= ($mode == 'forum') ? '&amp;f' : '&amp;f=' . $forum_id . '&amp;t';
// Is user watching this thread?
@@ -1056,7 +1063,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$token = request_var('hash', '');
$redirect_url = append_sid("view$mode", "$u_url=$match_id&amp;start=$start");
- if ($_GET['watch'] == $mode && check_link_hash($token, "{$mode}_$topic_id"))
+ if ($_GET['watch'] == $mode && check_link_hash($token, "{$mode}_$match_id"))
{
$is_watching = true;