aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJim Wigginton <terrafrost@phpbb.com>2009-07-20 00:57:18 +0000
committerJim Wigginton <terrafrost@phpbb.com>2009-07-20 00:57:18 +0000
commitb3767cd1436bf2b579ad2e0c1c17f55881d4dc4e (patch)
tree7774576395c4db0b4f90e103c3f5a524c1db373b /phpBB
parente7a17a34295106391cb1803070dccb9e7a419d86 (diff)
downloadforums-b3767cd1436bf2b579ad2e0c1c17f55881d4dc4e.tar
forums-b3767cd1436bf2b579ad2e0c1c17f55881d4dc4e.tar.gz
forums-b3767cd1436bf2b579ad2e0c1c17f55881d4dc4e.tar.bz2
forums-b3767cd1436bf2b579ad2e0c1c17f55881d4dc4e.tar.xz
forums-b3767cd1436bf2b579ad2e0c1c17f55881d4dc4e.zip
- added filtration ability to MCP
- added missing lang variable - fixed a pagination bug in filtration routines git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9800 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/CHANGELOG.html2
-rw-r--r--phpBB/includes/acp/acp_logs.php6
-rw-r--r--phpBB/includes/functions_admin.php3
-rw-r--r--phpBB/includes/mcp/mcp_logs.php36
-rw-r--r--phpBB/includes/mcp/mcp_notes.php22
-rw-r--r--phpBB/language/en/acp/common.php2
-rw-r--r--phpBB/styles/prosilver/template/mcp_logs.html3
-rw-r--r--phpBB/styles/prosilver/template/mcp_notes_user.html3
-rw-r--r--phpBB/styles/subsilver2/template/mcp_logs.html3
-rw-r--r--phpBB/styles/subsilver2/template/mcp_notes_user.html3
10 files changed, 78 insertions, 5 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index a81c6d919c..2e81cb13ce 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -215,7 +215,7 @@
<li>[Feature] Add option to disable remote upload avatars (Bug #45375 - Patch by nickvergessen)</li>
<li>[Feature] Ability to delete warnings and keep warnings permanently (Bug #43375 - Patch by nickvergessen)</li>
<li>[Feature] Ability to empty a user's outbox from the user ACP quick tools.</li>
- <li>[Feature] Ability to filter ACP logs</li>
+ <li>[Feature] Ability to filter ACP / MCP logs</li>
</ul>
<a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3>
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index c44592a23c..f13979ec0f 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -158,8 +158,12 @@ class acp_logs
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
+ if (empty($row['log_operation']))
+ {
+ continue;
+ }
$selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : '';
- $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . $user->lang[$row['log_operation']] . '</option>';
+ $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . htmlspecialchars(strip_tags($user->lang[$row['log_operation']]), ENT_COMPAT, 'UTF-8') . '</option>';
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index dd6378a2b5..ff7f687945 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2499,7 +2499,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
$sql = 'SELECT COUNT(l.log_id) AS total_entries
FROM ' . LOG_TABLE . " l
WHERE l.log_type = $log_type
- AND l.log_time >= $limit_days
+ AND l.log_time >= $limit_days " .
+ (!empty($log_operation) ? "AND l.log_operation = '" . $db->sql_escape($log_operation) . "'" : '') . "
$sql_forum";
$result = $db->sql_query($sql);
$log_count = (int) $db->sql_fetchfield('total_entries');
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index a6b1935c88..b83e364811 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -164,10 +164,43 @@ class mcp_logs
$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+ $log_operation = request_var('log_operation', '');
+ $s_lang_keys = '<option value="">' . $user->lang['SHOW_ALL_OPERATIONS'] . '</option>';
+
+ if ($topic_id)
+ {
+ $sql_forum = 'AND topic_id = ' . intval($topic_id);
+ }
+ else if (is_array($forum_id))
+ {
+ $sql_forum = 'AND ' . $db->sql_in_set('forum_id', array_map('intval', $forum_id));
+ }
+ else
+ {
+ $sql_forum = ($forum_id) ? 'AND forum_id = ' . intval($forum_id) : '';
+ }
+
+ $sql = "SELECT DISTINCT log_operation
+ FROM " . LOG_TABLE . '
+ WHERE log_type = ' . LOG_MOD . '
+ ' . (($limit_days) ? "AND log_time >= $sql_where " : ' ') .
+ $sql_forum;
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (empty($row['log_operation']))
+ {
+ continue;
+ }
+ $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : '';
+ $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . htmlspecialchars(strip_tags($user->lang[$row['log_operation']]), ENT_COMPAT, 'UTF-8') . '</option>';
+ }
+ $db->sql_freeresult($result);
+
// Grab log data
$log_data = array();
$log_count = 0;
- view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort);
+ view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $log_operation);
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
@@ -181,6 +214,7 @@ class mcp_logs
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
+ 'S_LANG_KEYS' => $s_lang_keys,
'S_LOGS' => ($log_count > 0),
)
);
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 7480b24a46..d07874524a 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -193,9 +193,28 @@ class mcp_notes
$sql_where = ($st) ? (time() - ($st * 86400)) : 0;
$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
+ $log_operation = request_var('log_operation', '');
+ $s_lang_keys = '<option value="">' . $user->lang['SHOW_ALL_OPERATIONS'] . '</option>';
+
+ $sql = "SELECT DISTINCT log_operation
+ FROM " . LOG_TABLE . '
+ WHERE log_type = ' . LOG_USERS .
+ (($limit_days) ? " AND log_time >= $sql_where" : '');
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (empty($row['log_operation']))
+ {
+ continue;
+ }
+ $selected = ($log_operation == $row['log_operation']) ? ' selected="selected"' : '';
+ $s_lang_keys .= '<option value="' . $row['log_operation'] . '"' . $selected . '>' . htmlspecialchars(strip_tags($user->lang[$row['log_operation']]), ENT_COMPAT, 'UTF-8') . '</option>';
+ }
+ $db->sql_freeresult($result);
+
$log_data = array();
$log_count = 0;
- view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
+ view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $log_operation);
if ($log_count)
{
@@ -219,6 +238,7 @@ class mcp_notes
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
+ 'S_LANG_KEYS' => $s_lang_keys,
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index b1d722a006..55eadc8341 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -281,6 +281,8 @@ $lang = array_merge($lang, array(
'SETTING_TOO_LONG' => 'The entered value for the setting ā€œ%1$sā€ is too long. The maximal allowed length is %2$d.',
'SETTING_TOO_SHORT' => 'The entered value for the setting ā€œ%1$sā€ is not long enough. The minimal allowed length is %2$d.',
+ 'SHOW_ALL_OPERATIONS' => 'Show all operations',
+
'UCP' => 'User Control Panel',
'USERNAMES_EXPLAIN' => 'Place each username on a separate line.',
'USER_CONTROL_PANEL' => 'User Control Panel',
diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html
index bf1e867be3..ef2b4f4ab6 100644
--- a/phpBB/styles/prosilver/template/mcp_logs.html
+++ b/phpBB/styles/prosilver/template/mcp_logs.html
@@ -8,6 +8,9 @@
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="linklist">
+ <li class="leftside">
+ {L_SELECT_LANG_KEY}: <select name="log_operation">{S_LANG_KEYS}</select>&nbsp;<input type="submit" class="button2" name="filter" value="{L_FILTER}" />
+ </li>
<li class="rightside pagination">
<!-- IF TOTAL -->{TOTAL} <!-- ENDIF -->
<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html
index ce4df31866..aecb9b817a 100644
--- a/phpBB/styles/prosilver/template/mcp_notes_user.html
+++ b/phpBB/styles/prosilver/template/mcp_notes_user.html
@@ -51,6 +51,9 @@
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="linklist">
+ <li class="leftside">
+ {L_SELECT_LANG_KEY}: <select name="log_operation">{S_LANG_KEYS}</select>&nbsp;<input type="submit" class="button2" name="filter" value="{L_FILTER}" />
+ </li>
<li class="rightside pagination">
<!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF -->
<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> &bull; <span>{PAGINATION}</span><!-- ELSE --> &bull; {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/mcp_logs.html b/phpBB/styles/subsilver2/template/mcp_logs.html
index f7c4a99fc1..04c4228645 100644
--- a/phpBB/styles/subsilver2/template/mcp_logs.html
+++ b/phpBB/styles/subsilver2/template/mcp_logs.html
@@ -22,6 +22,9 @@
</tr>
<!-- END log -->
<tr align="center">
+ <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SELECT_LANG_KEY}:</span> <select name="log_operation">{S_LANG_KEYS}</select>&nbsp;<input type="submit" class="button2" name="filter" value="{L_FILTER}" /></td>
+ </tr>
+ <tr align="center">
<td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
</tr>
<!-- IF S_CLEAR_ALLOWED -->
diff --git a/phpBB/styles/subsilver2/template/mcp_notes_user.html b/phpBB/styles/subsilver2/template/mcp_notes_user.html
index 5df3f50407..f4cb776a52 100644
--- a/phpBB/styles/subsilver2/template/mcp_notes_user.html
+++ b/phpBB/styles/subsilver2/template/mcp_notes_user.html
@@ -55,6 +55,9 @@
<!-- IF S_USER_NOTES -->
<tr align="center">
+ <td colspan="5" class="row3"><span class="gensmall">{L_SELECT_LANG_KEY}:</span> <select name="log_operation">{S_LANG_KEYS}</select>&nbsp;<input type="submit" class="button2" name="filter" value="{L_FILTER}" /></td>
+ </tr>
+ <tr align="center">
<td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
</tr>
<tr>