aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/acp_users_overview.html2
-rw-r--r--phpBB/includes/acp/acp_users.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index fdc1d55855..ea2700e5e4 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -141,7 +141,7 @@
<dl>
<dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
<dd>
- <!-- IF USER_TOTAL_POSTS == 0 -->
+ <!-- IF USER_HAS_POSTS == 0 -->
{L_USER_NO_POSTS_DELETE}<input type="hidden" id="delete_type" name="delete_type" value="retain" />
<!-- ELSE -->
<select id="delete_type" name="delete_type"><option class="sep" value="">{L_SELECT_OPTION}</option><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 1f0f053a85..7565d43690 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1009,11 +1009,11 @@ class acp_users
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
- $sql = 'SELECT COUNT(post_id) as user_total_posts
+ $sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
WHERE poster_id = '. $user_id;
- $result = $db->sql_query($sql);
- $user_row['user_total_posts'] = (int) $db->sql_fetchfield('user_total_posts');
+ $result = $db->sql_query_limit($sql, 1);
+ $user_row['user_has_posts'] = ($db->sql_fetchfield('post_id') ? 1 : 0);
$db->sql_freeresult($result);
$template->assign_vars(array(
@@ -1043,7 +1043,7 @@ class acp_users
'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],
- 'USER_TOTAL_POSTS' => $user_row['user_total_posts'],
+ 'USER_HAS_POSTS' => $user_row['user_has_posts'],
'USER_INACTIVE_REASON' => $inactive_reason,
));