aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-08-30 22:57:00 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-08-30 22:57:00 +0200
commitc03d692a98fafa921a832e063c76a3d844632ca7 (patch)
tree68111ed107e013d0264a87fce0826fd5706e3167 /phpBB/includes
parent625e7ef58aab1b2d61505f756d53c7d85d9f2d2b (diff)
downloadforums-c03d692a98fafa921a832e063c76a3d844632ca7.tar
forums-c03d692a98fafa921a832e063c76a3d844632ca7.tar.gz
forums-c03d692a98fafa921a832e063c76a3d844632ca7.tar.bz2
forums-c03d692a98fafa921a832e063c76a3d844632ca7.tar.xz
forums-c03d692a98fafa921a832e063c76a3d844632ca7.zip
[feature/soft-delete] Fix some more usages of _approved column names
PHPBB3-9657
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_admin.php2
-rw-r--r--phpBB/includes/functions_display.php30
-rw-r--r--phpBB/includes/mcp/mcp_queue.php11
3 files changed, 12 insertions, 31 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 328c8e9778..54130df935 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1882,7 +1882,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$db->sql_freeresult($result);
// Use "t" as table alias because of the $where_sql clause
- // NOTE: 't.post_approved' in the GROUP BY is causing a major slowdown.
+ // NOTE: 't.post_visibility' in the GROUP BY is causing a major slowdown.
$sql = 'SELECT t.topic_id, t.post_visibility, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id
FROM ' . POSTS_TABLE . " t
$where_sql
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 881c95907b..2781f1a7bb 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -987,33 +987,25 @@ function display_user_activity(&$userdata)
$forum_ary = array();
- // Do not include those forums the user is not having read access to...
- $forum_read_ary = $auth->acl_getf('!f_read');
-
- foreach ($forum_read_ary as $forum_id => $not_allowed)
+ $forum_read_ary = $auth->acl_getf('f_read');
+ foreach ($forum_read_ary as $forum_id => $allowed)
{
- if ($not_allowed['f_read'])
+ if ($allowed['f_read'])
{
$forum_ary[] = (int) $forum_id;
}
}
- $forum_ary = array_unique($forum_ary);
- $forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : '';
-
- $fid_m_approve = $auth->acl_getf('m_approve', true);
- $sql_m_approve = (!empty($fid_m_approve)) ? 'OR ' . $db->sql_in_set('forum_id', array_keys($fid_m_approve)) : '';
+ $forum_ary = array_diff($forum_ary, $user->get_passworded_forums());;
// Obtain active forum
$sql = 'SELECT forum_id, COUNT(post_id) AS num_posts
FROM ' . POSTS_TABLE . '
- WHERE poster_id = ' . $userdata['user_id'] . "
+ WHERE poster_id = ' . $userdata['user_id'] . '
AND post_postcount = 1
- AND (post_approved = 1
- $sql_m_approve)
- $forum_sql
+ AND ' . phpbb_content_visibility::get_visibility_sql_forums('post', $forum_ary) . '
GROUP BY forum_id
- ORDER BY num_posts DESC";
+ ORDER BY num_posts DESC';
$result = $db->sql_query_limit($sql, 1);
$active_f_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1035,13 +1027,11 @@ function display_user_activity(&$userdata)
$sql = 'SELECT topic_id, COUNT(post_id) AS num_posts
FROM ' . POSTS_TABLE . '
- WHERE poster_id = ' . $userdata['user_id'] . "
+ WHERE poster_id = ' . $userdata['user_id'] . '
AND post_postcount = 1
- AND (post_approved = 1
- $sql_m_approve)
- $forum_sql_topic
+ AND ' . phpbb_content_visibility::get_visibility_sql_forums('post', $forum_ary) . '
GROUP BY topic_id
- ORDER BY num_posts DESC";
+ ORDER BY num_posts DESC';
$result = $db->sql_query_limit($sql, 1);
$active_t_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index cbf0ff0089..3b18b7f0e7 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -548,7 +548,7 @@ function approve_post($post_id_list, $id, $mode)
{
$notify_poster = (isset($_REQUEST['notify_poster'])) ? true : false;
- phpbb_content_visibility::unhide_posts_topics('approve', $post_info, $post_id_list);
+ $success_msg = phpbb_content_visibility::unhide_posts_topics('approve', $post_info, $post_id_list);
$messenger = new messenger();
@@ -607,15 +607,6 @@ function approve_post($post_id_list, $id, $mode)
$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_data['forum_id']}&amp;t={$post_data['topic_id']}&amp;p={$post_data['post_id']}") . '#p' . $post_data['post_id'];
}
unset($post_info);
-
- if ($total_topics)
- {
- $success_msg = ($total_topics == 1) ? 'TOPIC_APPROVED_SUCCESS' : 'TOPICS_APPROVED_SUCCESS';
- }
- else
- {
- $success_msg = (sizeof($post_id_list) + sizeof($post_approved_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
- }
}
else
{