From a3a8fb989cd01d9b4156041870069ebcb7e057dd Mon Sep 17 00:00:00 2001
From: Chris Smith
Date: Thu, 18 Mar 2010 17:22:30 +0000
Subject: [PATCH 01/11] [bug/59465] Removes start=0 from URLs used by viewtopic
and viewforum.
Having start=0 makes search engines index the page twice once with and
once without the start=0 parameter. This results in duplicate results
in the search results. Patch contributed by nn-.
---
phpBB/viewforum.php | 6 +++---
phpBB/viewtopic.php | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 95c142d865..72b5074351 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -151,7 +151,7 @@ $template->set_filenames(array(
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id);
$template->assign_vars(array(
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"),
+ 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")),
));
// Not postable forum or showing active topics?
@@ -302,7 +302,7 @@ $template->assign_vars(array(
'S_WATCH_FORUM_LINK' => $s_watching_forum['link'],
'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'],
'S_WATCHING_FORUM' => $s_watching_forum['is_watching'],
- 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"),
+ 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")),
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id),
'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true,
@@ -311,7 +311,7 @@ $template->assign_vars(array(
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '',
'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id) : '',
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . "&start=$start"),
+ 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($start == 0) ? '' : "&start=$start")),
'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics") : '',
));
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 29c4e5cdc1..8e0521522d 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -477,7 +477,7 @@ if ($start < 0 || $start >= $total_posts)
}
// General Viewtopic URL for return links
-$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : ''));
+$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : ''));
// Are we watching this topic?
$s_watching_topic = array(
@@ -601,7 +601,7 @@ $template->assign_vars(array(
'PAGINATION' => $pagination,
'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start),
'TOTAL_POSTS' => ($total_posts == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total_posts),
- 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id&start=$start" . ((strlen($u_sort_param)) ? "&$u_sort_param" : ''), true, $user->session_id) : '',
+ 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : ''), true, $user->session_id) : '',
'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '',
'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'),
@@ -630,9 +630,9 @@ $template->assign_vars(array(
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true,
- 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"),
+ 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")),
'S_TOPIC_MOD' => ($topic_mod != '') ? '' : '',
- 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id&start=$start&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),
+ 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . "&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),
'S_VIEWTOPIC' => true,
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
@@ -722,7 +722,7 @@ if (!empty($topic_data['poll_start']))
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting'))
{
- $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start");
+ $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start"));
meta_refresh(5, $redirect_url);
if (!sizeof($voted_id))
@@ -805,7 +805,7 @@ if (!empty($topic_data['poll_start']))
//, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
$db->sql_query($sql);
- $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start");
+ $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start"));
meta_refresh(5, $redirect_url);
trigger_error($user->lang['VOTE_SUBMITTED'] . '
' . sprintf($user->lang['RETURN_TOPIC'], '', ''));
From 492063cec63fe3665406a74e74265c1a7dd5c295 Mon Sep 17 00:00:00 2001
From: Chris Smith
Date: Thu, 18 Mar 2010 20:27:18 +0000
Subject: [PATCH 02/11] [bug/59465] Remove start=0 from topic pagination links.
Patch once again by nn-.
---
phpBB/includes/functions_display.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index f49aa42324..ea77551fc4 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -660,7 +660,7 @@ function topic_generate_pagination($replies, $url)
$times = 1;
for ($j = 0; $j < $replies + 1; $j += $per_page)
{
- $pagination .= '' . $times . '';
+ $pagination .= '' . $times . '';
if ($times == 1 && $total_pages > 5)
{
$pagination .= ' ... ';
From 8d0c0dcbcd890871f5b057afb8abb7fce0465b2f Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Mon, 8 Mar 2010 00:02:46 +0100
Subject: [PATCH 03/11] [bug/58695] Only show unapproved posts in ATOM Feeds
for moderators (Bug #58695)
---
phpBB/docs/CHANGELOG.html | 1 +
phpBB/feed.php | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 7b8d8f63f2..e3b20acad2 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -103,6 +103,7 @@
[Fix] Allow multibyte keys in request_var(). (Bug #51555)
[Fix] Prevent wrong tar archive type detection. (Bug #12531)
[Fix] Correct redirection after login to forum not in web root (Bug #58755)
+ [Fix] Only show unapproved posts in ATOM Feeds for moderators (Bug #58695)
[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
diff --git a/phpBB/feed.php b/phpBB/feed.php
index a42aa42a7f..e0365462a0 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -535,7 +535,7 @@ class phpbb_feed_base
if (!isset($forum_ids))
{
- $forum_ids = array_keys($auth->acl_getf('m_approve'));
+ $forum_ids = array_keys($auth->acl_getf('m_approve', true));
}
return $forum_ids;
@@ -994,7 +994,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
if (!$this->topic_data['topic_approved'])
{
// Also require m_approve
- $in_fid_ary = array_intersect($in_fid_ary, array_keys($auth->acl_getf('m_approve')));
+ $in_fid_ary = array_intersect($in_fid_ary, array_keys($auth->acl_getf('m_approve', true)));
if (empty($in_fid_ary))
{
From 0d4daeb615ed35dc4ded54dd2034df6317837a77 Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Mon, 8 Mar 2010 11:56:20 +0100
Subject: [PATCH 04/11] [bug/58695] Use method to get forums where user is
moderator, thanks to bantu for the hint
---
phpBB/feed.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/phpBB/feed.php b/phpBB/feed.php
index e0365462a0..d52d3e6c8b 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -994,7 +994,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
if (!$this->topic_data['topic_approved'])
{
// Also require m_approve
- $in_fid_ary = array_intersect($in_fid_ary, array_keys($auth->acl_getf('m_approve', true)));
+ $in_fid_ary = array_intersect($in_fid_ary, $this->get_moderator_approve_forums());
if (empty($in_fid_ary))
{
From 492d86000e768a1381cf88f5cd599a193427fbe1 Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Sun, 7 Mar 2010 13:16:11 +0100
Subject: [PATCH 05/11] [bug/58745] Correctly close user-delete-form in ACP
User Overview (Bug #58745)
---
phpBB/adm/style/acp_users_overview.html | 2 +-
phpBB/docs/CHANGELOG.html | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index d48cfa57be..7d9a0f27d3 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -148,6 +148,6 @@
{S_FORM_TOKEN}
-
+
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 3042027e83..5299adcc8c 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -99,6 +99,7 @@
[Fix] Add terminating semicolons to JavaScript code. (Bug #58085 - Patch by nn-)
[Fix] Minor language fixes. (Bug #54855)
[Fix] Parsing urls in signatures properly uses config settings. (Bug #57105)
+ [Fix] Correctly close user-delete-form in ACP User Overview (Bug #58745)
[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
From 738914ac838b8c9c95c97b0ad5b11fea6fda9cc7 Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Sat, 3 Apr 2010 13:11:23 +0200
Subject: [PATCH 06/11] [bug/58745] Correct changelog message
---
phpBB/docs/CHANGELOG.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 5299adcc8c..5bd003eb40 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -99,7 +99,7 @@
[Fix] Add terminating semicolons to JavaScript code. (Bug #58085 - Patch by nn-)
[Fix] Minor language fixes. (Bug #54855)
[Fix] Parsing urls in signatures properly uses config settings. (Bug #57105)
- [Fix] Correctly close user-delete-form in ACP User Overview (Bug #58745)
+ [Fix] Various XHTML mistakes in ACP (Bug #58745)
[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
From 46f85329da850bd9ed3c4b83c708683bbf0dcb91 Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Tue, 9 Mar 2010 19:27:32 +0100
Subject: [PATCH 07/11] [feature/unapproved-posts-in-feed] View note for
moderators on unapproved posts/topics with unapproved posts in ATOM Feed
---
phpBB/docs/CHANGELOG.html | 1 +
phpBB/feed.php | 33 ++++++++++++++++++++++++---------
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 7b8d8f63f2..2207be14ad 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -103,6 +103,7 @@
[Fix] Allow multibyte keys in request_var(). (Bug #51555)
[Fix] Prevent wrong tar archive type detection. (Bug #12531)
[Fix] Correct redirection after login to forum not in web root (Bug #58755)
+ [Fix] View note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed
[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
diff --git a/phpBB/feed.php b/phpBB/feed.php
index a42aa42a7f..575e937330 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -541,6 +541,19 @@ class phpbb_feed_base
return $forum_ids;
}
+ function is_moderator_approve_forum($forum_id)
+ {
+ $forum_ids = $this->get_moderator_approve_forums();
+
+ if (!$forum_id)
+ {
+ // Global announcement, your a moderator in any forum than it's okay.
+ return (sizeof($forum_ids) > 0) ? true : false;
+ }
+
+ return (in_array($forum_id, $forum_ids)) ? true : false;
+ }
+
function get_excluded_forums()
{
global $db, $cache;
@@ -677,7 +690,8 @@ class phpbb_feed_post_base extends phpbb_feed_base
if ($config['feed_item_statistics'])
{
$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
- . ' ' . $this->separator_stats . ' ' . $user->format_date($row['post_time']);
+ . ' ' . $this->separator_stats . ' ' . $user->format_date($row['post_time'])
+ . (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : '');
}
}
}
@@ -719,8 +733,9 @@ class phpbb_feed_topic_base extends phpbb_feed_base
{
$item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
. ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('date')])
- . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies']
- . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views'];
+ . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . (($this->is_moderator_approve_forum($row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'])
+ . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']
+ . (($this->is_moderator_approve_forum($row['forum_id']) && ($row['topic_replies_real'] != $row['topic_replies'])) ? ' ' . $this->separator_stats . ' ' . $user->lang['POSTS_UNAPPROVED'] : '');
}
}
}
@@ -780,7 +795,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
// Get the actual data
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name, ' .
- 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
@@ -912,7 +927,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base
}
$this->sql = array(
- 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
@@ -1077,7 +1092,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
global $auth, $db;
$this->sql = array(
- 'SELECT' => 'p.post_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
+ 'SELECT' => 'p.post_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
@@ -1241,7 +1256,7 @@ class phpbb_feed_news extends phpbb_feed_topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time,
+ t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time,
p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
'FROM' => array(
TOPICS_TABLE => 't',
@@ -1314,7 +1329,7 @@ class phpbb_feed_topics extends phpbb_feed_topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time,
+ t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time,
p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
'FROM' => array(
TOPICS_TABLE => 't',
@@ -1412,7 +1427,7 @@ class phpbb_feed_topics_active extends phpbb_feed_topic_base
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name,
- t.topic_id, t.topic_title, t.topic_replies, t.topic_views,
+ t.topic_id, t.topic_title, t.topic_replies, t.topic_replies_real, t.topic_views,
t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time,
p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url',
'FROM' => array(
From 9b596faa3976fb17c13eb4c8d604c9e388f47209 Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Wed, 10 Mar 2010 01:37:35 +0100
Subject: [PATCH 08/11] [feature/unapproved-posts-in-feed] Increase performance
of is_moderator_approve_forum() as per bantu
---
phpBB/feed.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 575e937330..4eb70c76c8 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -543,15 +543,20 @@ class phpbb_feed_base
function is_moderator_approve_forum($forum_id)
{
- $forum_ids = $this->get_moderator_approve_forums();
+ static $forum_ids;
+
+ if (!isset($forum_ids))
+ {
+ $forum_ids = array_flip($this->get_moderator_approve_forums());
+ }
if (!$forum_id)
{
// Global announcement, your a moderator in any forum than it's okay.
- return (sizeof($forum_ids) > 0) ? true : false;
+ return (!empty($forum_ids)) ? true : false;
}
- return (in_array($forum_id, $forum_ids)) ? true : false;
+ return (isset($forum_ids[$forum_id])) ? true : false;
}
function get_excluded_forums()
From 19c7ea3c16ceb616cfea4c1c4a160bd36c6a713b Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Wed, 10 Mar 2010 01:39:45 +0100
Subject: [PATCH 09/11] [feature/unapproved-posts-in-feed] Little changelog
correction
---
phpBB/docs/CHANGELOG.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 2207be14ad..b42edfd928 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -103,8 +103,8 @@
[Fix] Allow multibyte keys in request_var(). (Bug #51555)
[Fix] Prevent wrong tar archive type detection. (Bug #12531)
[Fix] Correct redirection after login to forum not in web root (Bug #58755)
- [Fix] View note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed
[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
+ [Feature] Show note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed (Bug #9511)
1.i. Changes since 3.0.7
From 5f044a015e622881126a55483de1f680abe29a17 Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Sun, 4 Apr 2010 02:03:23 +0200
Subject: [PATCH 10/11] [bug/9512] Fix dead link in MCP on reports for global
announcements in prosilver. (Bug #9512)
---
phpBB/docs/CHANGELOG.html | 1 +
phpBB/styles/prosilver/template/mcp_reports.html | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index ba79660646..4be97e3860 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -109,6 +109,7 @@
[Fix] Fix incorrect ampersand encoding in redirect parameter. (Bug #58465)
[Fix] Fix open_basedir issues when accessing styles- and language-management. (Bug #59135)
[Fix] Fix table binding issues with PostgreSQL in board-wide feed. (Bug #58425)
+ [Fix] Fix dead link in MCP on reports for global announcements in prosilver. (Bug #9512)
[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
[Feature] The memcache acm plugin now supports multiple memcache servers.
diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html
index 649154deb4..eefb24ee91 100644
--- a/phpBB/styles/prosilver/template/mcp_reports.html
+++ b/phpBB/styles/prosilver/template/mcp_reports.html
@@ -54,7 +54,7 @@
{postrow.REPORTER_FULL} « {postrow.REPORT_TIME}
- {L_FORUM}: {postrow.FORUM_NAME}
+ {L_FORUM}: {postrow.FORUM_NAME}{postrow.FORUM_NAME}
From 39f26c5cfde3fc018332f379f9b7449a5f1da537 Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Sun, 4 Apr 2010 11:51:34 +0200
Subject: [PATCH 11/11] [bug/9047] Use correct forum_id to generate the active
topics list. (Bug #9047)
---
phpBB/docs/CHANGELOG.html | 1 +
phpBB/viewforum.php | 18 ++++++++++--------
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index ba79660646..61e2f01ed8 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -109,6 +109,7 @@
[Fix] Fix incorrect ampersand encoding in redirect parameter. (Bug #58465)
[Fix] Fix open_basedir issues when accessing styles- and language-management. (Bug #59135)
[Fix] Fix table binding issues with PostgreSQL in board-wide feed. (Bug #58425)
+ [Fix] Fix broken links for reports on active topics, when the topic is in a subforum. (Bug #9047)
[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)
[Feature] The memcache acm plugin now supports multiple memcache servers.
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 95c142d865..5fb91c0292 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -592,12 +592,14 @@ if (sizeof($topic_list))
{
$row = &$rowset[$topic_id];
+ $topic_forum_id = ($row['forum_id']) ? (int) $row['forum_id'] : $forum_id;
+
// This will allow the style designer to output a different header
// or even separate the list of announcements from sticky and normal topics
$s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
// Replies
- $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
+ $replies = ($auth->acl_get('m_approve', $topic_forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
if ($row['topic_status'] == ITEM_MOVED)
{
@@ -614,16 +616,16 @@ if (sizeof($topic_list))
topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
// Generate all the URIs ...
- $view_topic_url_params = 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id;
+ $view_topic_url_params = 'f=' . $topic_forum_id . '&t=' . $topic_id;
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
- $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
- $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
+ $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
+ $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $topic_forum_id)) ? true : false;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : '';
// Send vars to template
$template->assign_block_vars('topicrow', array(
- 'FORUM_ID' => $forum_id,
+ 'FORUM_ID' => $topic_forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@@ -651,13 +653,13 @@ if (sizeof($topic_list))
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
- 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
- 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false,
+ 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $topic_forum_id)) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved,
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
@@ -672,7 +674,7 @@ if (sizeof($topic_list))
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $forum_id . '&t=' . $topic_id, true, $user->session_id),
+ 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $topic_forum_id . '&t=' . $topic_id, true, $user->session_id),
'U_MCP_QUEUE' => $u_mcp_queue,
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)