diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2004-08-22 13:16:00 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-08-22 13:16:00 +0000 |
commit | 02ce77099065c8993c493e461ec4e14adc4fc4f6 (patch) | |
tree | 3a24314e808f6350a0f8eeddfe9cbb23e20ecb28 /phpBB | |
parent | 946af346a1e21699b9fd246f96a98253f689e877 (diff) | |
download | forums-02ce77099065c8993c493e461ec4e14adc4fc4f6.tar forums-02ce77099065c8993c493e461ec4e14adc4fc4f6.tar.gz forums-02ce77099065c8993c493e461ec4e14adc4fc4f6.tar.bz2 forums-02ce77099065c8993c493e461ec4e14adc4fc4f6.tar.xz forums-02ce77099065c8993c493e461ec4e14adc4fc4f6.zip |
- user notes/feedback in post_details
git-svn-id: file:///svn/phpbb/trunk@4966 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 80 | ||||
-rw-r--r-- | phpBB/language/en/admin.php | 3 | ||||
-rw-r--r-- | phpBB/language/en/common.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/mcp.php | 4 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/mcp_post.html | 49 |
5 files changed, 124 insertions, 14 deletions
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 68cceebc66..8f657d92f2 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -107,6 +107,53 @@ function mcp_post_details($id, $mode, $action, $url) } break; + case 'del_marked': + case 'del_all': + case 'add_feedback': + + $deletemark = ($action == 'del_marked') ? true : false; + $deleteall = ($action == 'del_all') ? true : false; + $marked = request_var('marknote', 0); + $usernote = request_var('usernote', ''); + + if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) + { + $where_sql = ''; + if ($deletemark && $marked) + { + $sql_in = array(); + foreach ($marked as $mark) + { + $sql_in[] = $mark; + } + $where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')'; + unset($sql_in); + } + + $sql = 'DELETE FROM ' . LOG_TABLE . ' + WHERE log_type = ' . LOG_USERS . " + $where_sql"; + $db->sql_query($sql); + + add_log('admin', 'LOG_USERS_CLEAR'); + + $msg = ($deletemark) ? 'MARKED_DELETED' : 'ALL_DELETED'; + $redirect = "$url&i=$id&mode=post_details"; + meta_refresh(2, $redirect); + trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); + } + + if ($usernote && $action == 'add_feedback') + { + add_log('admin', 'LOG_USER_FEEDBACK', $post_info['username']); + add_log('user', $post_info['user_id'], 'LOG_USER_GENERAL', $usernote); + + $redirect = "$url&i=$id&mode=post_details"; + meta_refresh(2, $redirect); + trigger_error($user->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); + } + break; + default: } @@ -125,9 +172,9 @@ function mcp_post_details($id, $mode, $action, $url) $message = smilie_text($message); $template->assign_vars(array( - 'S_MCP_ACTION' => "$url&i=main&quickmod=1", - 'S_CHGPOSTER_ACTION' => "$url&i=$id&mode=post_details", - 'S_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&p=$post_id", + 'U_MCP_ACTION' => "$url&i=main&quickmod=1", // Use this for mode paramaters + 'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters + 'U_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&p=$post_id", 'S_CAN_VIEWIP' => $auth->acl_get('m_ip', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $auth->acl_get('m_', $post_info['forum_id']), @@ -137,12 +184,13 @@ function mcp_post_details($id, $mode, $action, $url) 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], -// 'S_USER_NOTES' => ($post_info['user_notes']) ? true : false, 'S_USER_WARNINGS' => ($post_info['user_warnings']) ? true : false, + 'S_SHOW_USER_NOTES' => true, + 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, 'U_VIEW_PROFILE' => "memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'], - 'U_MCP_USERNOTES' => "mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'], - 'U_MCP_WARNINGS' => "mcp.$phpEx$SID&i=warnings&mode=view_user&u=" . $post_info['user_id'], +// 'U_MCP_USERNOTES' => "mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'], +// 'U_MCP_WARNINGS' => "mcp.$phpEx$SID&i=warnings&mode=view_user&u=" . $post_info['user_id'], 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '', 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&p=$post_id#$post_id\">", '</a>'), @@ -160,6 +208,26 @@ function mcp_post_details($id, $mode, $action, $url) 'POST_ID' => $post_info['post_id']) ); + // Get User Notes + $log_data = array(); + $log_count = 0; + view_log('user', $log_data, $log_count, $config['posts_per_page'], 0, 0, 0, $post_info['user_id']); + + if ($log_count) + { + $template->assign_var('S_USER_NOTES', true); + + foreach ($log_data as $row) + { + $template->assign_block_vars('usernotes', array( + 'REPORT_BY' => $row['username'], + 'REPORT_AT' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'ID' => $row['id']) + ); + } + } + // Get Reports if ($auth->acl_get('m_', $post_info['forum_id'])) { diff --git a/phpBB/language/en/admin.php b/phpBB/language/en/admin.php index bc86dd197c..5a8b0e912f 100644 --- a/phpBB/language/en/admin.php +++ b/phpBB/language/en/admin.php @@ -1143,9 +1143,6 @@ $lang += array( 'USER_POSTING_PREFS' => 'Posting preferences', - 'ADD_FEEDBACK' => 'Add feedback', - 'ADD_FEEDBACK_EXPLAIN' => 'If you would like to add a report on this please fill out the following form. Only use plain text, HTML, BBCode, etc. are not permitted.', - 'ADMIN_SIGNATURE_PREVIEW' => 'Users signature will appear like this', 'USER_ADMIN_BAN_NAME_REASON' => 'Username banned via user management', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index c40a16487b..3345bd7af0 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -86,6 +86,7 @@ $lang += array( 'DAY' => 'Day', 'DAYS' => 'Days', 'DELETE' => 'Delete', + 'DELETE_ALL' => 'Delete All', 'DELETE_COOKIES' => 'Delete all board cookies', 'DELETE_MARKED' => 'Delete Marked', 'DESCENDING' => 'Descending', @@ -524,7 +525,6 @@ $unused = array( 'DESCRIPTION' => 'Description', 'DOWNLOAD' => 'Download', 'Date' => 'Date', - 'Delete_all' => 'Delete All', 'Deny_selected' => 'Deny Selected', 'Disable_BBCode_pm' => 'Disable BBCode in this message', 'Disable_HTML_pm' => 'Disable HTML in this message', diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 49deed20c3..88a8305ca3 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -29,6 +29,8 @@ if (empty($lang) || !is_array($lang)) $lang += array( 'ACTION' => 'Action', + 'ADD_FEEDBACK' => 'Add feedback', + 'ADD_FEEDBACK_EXPLAIN' => 'If you would like to add a report on this please fill out the following form. Only use plain text, HTML, BBCode, etc. are not permitted.', 'ALL_ENTRIES' => 'All entries', 'ALREADY_REPORTED' => 'This post has already been reported', 'APPROVE' => 'Approve', @@ -54,6 +56,7 @@ $lang += array( 'EMPTY_REPORT' => 'You must enter a description when selecting this reason', 'EMPTY_TOPICS_REMOVED_WARNING' => 'Please note that one or several topics have been removed from the database because they were or become empty', + 'FEEDBACK' => 'Feedback', 'FORK' => 'Fork', 'FORK_TOPIC' => 'Fork Topic', 'FORK_TOPIC_CONFIRM' => 'Are you sure you want to copy this topic?', @@ -242,6 +245,7 @@ $lang += array( 'UNRATE_POST_EXPLAIN' => 'Reset post rating', 'USER_CANNOT_POST' => 'You cannot post in this forum', 'USER_CANNOT_REPORT' => 'You cannot report posts in this forum', + 'USER_FEEDBACK_ADDED' => 'User feedback added successfully', 'VIEW_DETAILS' => 'View Details', diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index aba3f5edd0..702e01ad76 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -1,6 +1,6 @@ <!-- INCLUDE mcp_header.html --> -<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"><form method="post" name="mcp" action="{S_APPROVE_ACTION}"> +<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"><form method="post" name="mcp" action="{U_APPROVE_ACTION}"> <tr> <th colspan="2" height="28" align="center">{L_POST_DETAILS}</th> </tr> @@ -13,7 +13,7 @@ </tr> <tr> <td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td> - <td class="row2" width="80%"><span class="gen">{POSTER_NAME} [ <a href="{U_VIEW_PROFILE}">{L_READ_PROFILE}</a> ]<!-- IF S_USER_NOTES --> [ <a href="{U_MCP_USERNOTES}">{L_READ_USERNOTES}</a> ]<!-- ENDIF --><!-- IF S_USER_WARNINGS --> [ <a href="{U_MCP_WARNINGS}">{L_READ_WARNINGS}</a> ]<!-- ENDIF --></span></td> + <td class="row2" width="80%"><span class="gen">{POSTER_NAME} [ <a href="{U_VIEW_PROFILE}">{L_READ_PROFILE}</a> ]</span></td> </tr> <!-- IF S_CAN_VIEWIP --> <tr> @@ -46,6 +46,47 @@ <!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF --> <!-- ELSE --> + <!-- IF S_SHOW_USER_NOTES --> + <br /><a name="usernotes"></a> + <form method="post" name="mcp" action="{U_POST_ACTION}"> + + <!-- IF S_USER_NOTES --> + <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> + <tr> + <th colspan="2" height="28" align="center">{L_FEEDBACK}</th> + </tr> + <!-- BEGIN usernotes --> + <!-- IF usernotes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + <td<!-- IF not S_CLEAR_ALLOWED --> colspan="2"<!-- ENDIF -->><span class="gensmall">Report by: <b>{usernotes.REPORT_BY}</b> on {usernotes.REPORT_AT}</span><hr /><span class="gen">{usernotes.ACTION}</span></td> + <!-- IF S_CLEAR_ALLOWED --><td width="5%" align="center"><input type="checkbox" name="marknote[]" value="{usernotes.ID}" /></td><!-- ENDIF --> + </tr> + <!-- END usernotes --> + <!-- IF S_CLEAR_ALLOWED --> + <tr> + <td class="cat" colspan="2" align="center"><input class="btnlite" type="submit" name="action[del_marked]" value="{L_DELETE_MARKED}" /> <input class="btnlite" type="submit" name="action[del_all]" value="{L_DELETE_ALL}" /></td> + </tr> + <!-- ENDIF --> + </table> + <br /> + <!-- ENDIF --> + + <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> + <tr> + <th colspan="2" height="28" align="center">{L_ADD_FEEDBACK}</th> + </tr> + <tr> + <td class="row3" align="center" colspan="2"><span class="genmed">{L_ADD_FEEDBACK_EXPLAIN}</span></td> + <tr> + <td colspan="2" class="row1" align="center"><textarea name="usernote" rows="10" cols="76"></textarea></td> + </tr> + <tr> + <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="action[add_feedback]" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" /></td> + </tr> + </table> + + </form> + <!-- ENDIF --> + <!-- IF S_SHOW_REPORTS --> <br /><a name="reports"></a> @@ -84,7 +125,7 @@ </tr> <!-- IF S_CAN_CHGPOSTER --> <tr> - <form method="post" name="mcp" action="{S_CHGPOSTER_ACTION}"{S_FORM_ENCTYPE}> + <form method="post" name="mcp" action="{U_POST_ACTION}"{S_FORM_ENCTYPE}> <td class="row1" valign="top"><b class="gen">{L_CHANGE_POSTER}</b></td> <td class="row2"><!-- IF S_USER_SELECT --><select name="u">{S_USER_SELECT}</select> <input type="submit" class="btnmain" name="action[chgposter]" value="{L_CONFIRM}" /><br /><!-- ENDIF --> <input class="post" type="text" name="username" value="{SEARCH_USERNAME}" /> <input class="btnlite" type="submit" value="{L_SEARCH}" name="action[chgposter_search]" /></td> </form> @@ -92,7 +133,7 @@ <!-- ENDIF --> <!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST --> <tr> - <form method="post" name="mcp" action="{S_MCP_ACTION}"{S_FORM_ENCTYPE}> + <form method="post" name="mcp" action="{U_MCP_ACTION}"{S_FORM_ENCTYPE}> <td class="row1" valign="top"><b class="gen">{L_MOD_OPTIONS}</b></td> <td class="row2"><select name="mode"><!-- IF S_CAN_LOCK_POST --><!-- IF S_POST_LOCKED --><option value="unlock_post">{L_UNLOCK_POST} [{L_UNLOCK_POST_EXPLAIN}]</option><!-- ELSE --><option value="lock_post">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</option><!-- ENDIF --><!-- ENDIF --><!-- IF S_CAN_DELETE_POST --><option value="delete_post">{L_DELETE_POST}</option><!-- ENDIF --></select> <input class="btnmain" type="submit" value="{L_SUBMIT}" /></td> </form> |