aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-08-25 23:16:31 -0400
committerNils Adermann <naderman@naderman.de>2011-08-25 23:16:31 -0400
commit459570bcca9347f4f115e0e53d098b4ebd4ffc1a (patch)
tree9fce9dd270161b63a25094c89617567f0ac1fcff /phpBB
parent28f72e427e61d2aa4ba4e5c5722c3e98469a16e1 (diff)
parentd602f748663ea1b726bbf2614e4d54ee5da309b1 (diff)
downloadforums-459570bcca9347f4f115e0e53d098b4ebd4ffc1a.tar
forums-459570bcca9347f4f115e0e53d098b4ebd4ffc1a.tar.gz
forums-459570bcca9347f4f115e0e53d098b4ebd4ffc1a.tar.bz2
forums-459570bcca9347f4f115e0e53d098b4ebd4ffc1a.tar.xz
forums-459570bcca9347f4f115e0e53d098b4ebd4ffc1a.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/9995] Do not run forum SQL query when marking the whole board read. [ticket/9995] Always continue when harvesting $forum_ids for markread(). [ticket/9995] Remove useless statement from display_forums() Conflicts: phpBB/includes/functions_display.php
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_display.php42
1 files changed, 27 insertions, 15 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 26a4e965a7..9c27f7eed1 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -52,6 +52,27 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
}
+ // Handle marking everything read
+ if ($mark_read == 'all')
+ {
+ $redirect = build_url(array('mark', 'hash'));
+ meta_refresh(3, $redirect);
+
+ if (check_link_hash(request_var('hash', ''), 'global'))
+ {
+ markread('all');
+
+ trigger_error(
+ $user->lang['FORUMS_MARKED'] . '<br /><br />' .
+ sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>')
+ );
+ }
+ else
+ {
+ trigger_error(sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
+ }
+ }
+
// Display list of active topics for this category?
$show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
@@ -109,13 +130,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$forum_id = $row['forum_id'];
// Mark forums read?
- if ($mark_read == 'forums' || $mark_read == 'all')
+ if ($mark_read == 'forums')
{
if ($auth->acl_get('f_list', $forum_id))
{
$forum_ids[] = $forum_id;
- continue;
}
+
+ continue;
}
// Category with no members
@@ -141,8 +163,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
continue;
}
- $forum_ids[] = $forum_id;
-
if ($config['load_db_lastread'] && $user->data['is_registered'])
{
$forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];
@@ -244,22 +264,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$db->sql_freeresult($result);
// Handle marking posts
- if ($mark_read == 'forums' || $mark_read == 'all')
+ if ($mark_read == 'forums')
{
$redirect = build_url(array('mark', 'hash'));
$token = request_var('hash', '');
if (check_link_hash($token, 'global'))
{
- 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>');
- }
+ 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);
}