Initial commit of files related to the warning system

As the comments suggest, it's not finished but I'm getting it in before
I do things to my machine


git-svn-id: file:///svn/phpbb/trunk@5324 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames 2005-12-10 23:08:02 +00:00
parent 877d71528d
commit 85fdeda51c
10 changed files with 592 additions and 2 deletions

View file

@ -176,6 +176,7 @@ define('USER_GROUP_TABLE', $table_prefix.'user_group');
define('USERS_TABLE', $table_prefix.'users'); define('USERS_TABLE', $table_prefix.'users');
define('USERS_PASSWD_TABLE', $table_prefix.'users_passwd'); define('USERS_PASSWD_TABLE', $table_prefix.'users_passwd');
define('USERS_NOTES_TABLE', $table_prefix.'users_notes'); define('USERS_NOTES_TABLE', $table_prefix.'users_notes');
define('WARNINGS_TABLE', $table_prefix.'warnings');
define('WORDS_TABLE', $table_prefix.'words'); define('WORDS_TABLE', $table_prefix.'words');
define('POLL_OPTIONS_TABLE', $table_prefix.'poll_results'); define('POLL_OPTIONS_TABLE', $table_prefix.'poll_results');
define('POLL_VOTES_TABLE', $table_prefix.'poll_voters'); define('POLL_VOTES_TABLE', $table_prefix.'poll_voters');

View file

@ -220,6 +220,7 @@ function mcp_notes_user_view($id, $mode, $action)
'RANK_TITLE' => $rank_title, 'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($userrow['user_regdate'], $user->lang['DATE_FORMAT']), 'JOINED' => $user->format_date($userrow['user_regdate'], $user->lang['DATE_FORMAT']),
'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,
'AVATAR_IMG' => $avatar_img, 'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img, 'RANK_IMG' => $rank_img,

367
phpBB/includes/mcp/mcp_warn.php Executable file
View file

@ -0,0 +1,367 @@
<?php
/**
*
* @package mcp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package mcp
* mcp_warn
* Handling warning the users
*/
class mcp_warn
{
var $p_master;
function mcp_main(&$p_master)
{
$this->p_master = &$p_master;
}
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx, $SID;
$action = request_var('action', array('' => ''));
if (is_array($action))
{
list($action, ) = each($action);
}
switch ($mode)
{
case 'front':
mcp_warn_front_view($id, $mode);
$this->tpl_name = 'mcp_warn_front';
break;
case 'warn_post':
mcp_warn_post_view($id, $mode, $action);
$this->tpl_name = 'mcp_warn_post';
break;
case 'warn_user':
mcp_warn_user_view($id, $mode, $action);
$this->tpl_name = 'mcp_warn_user';
break;
}
}
}
/**
* @package module_install
*/
class mcp_warn_info
{
function module()
{
return array(
'filename' => 'mcp_warn',
'title' => 'MCP_WARN',
'version' => '1.0.0',
'modes' => array(
'front' => array('title' => 'MCP_WARN_FRONT', 'auth' => 'acl_m_'),
'list' => array('title' => 'MCP_WARN_LIST', 'auth' => 'acl_m_'),
'warn_user' => array('title' => 'MCP_WARN_USER', 'auth' => 'acl_m_'),
'warn_post' => array('title' => 'MCP_WARN_POST', 'auth' => 'acl_m_'),
),
);
}
function install()
{
}
function uninstall()
{
}
}
//
// Functions
//
/**
* Generates the summary on the main page of the warning module
*/
function mcp_warn_front_view($id, $mode)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$template->assign_var('U_POST_ACTION', "mcp.$phpEx$SID&amp;i=warn&amp;mode=warn_user");
// Obtain a list of the 5 naughtiest users....
// These are the 5 users with the highest warning count
$sql = 'SELECT user_id, username, user_warnings
FROM ' . USERS_TABLE . '
WHERE user_warnings > 0
ORDER BY user_warnings DESC LIMIT 5';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('highest', array(
'U_NOTES' => 'mcp.' . $phpEx . $SID . '&amp;i=notes&amp;mode=user_notes&amp;u=' . $row['user_id'],
'U_USER' => 'memberlist.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['user_id'],
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['user_warning_time']), // TODO: Need to obtain the time of the last warning. Probably store this in the USERS_TABLE rather than join the WARNINGS_TABLE for efficiency
'WARNINGS' => $row['user_warnings'],
)
);
}
$db->sql_freeresult($result);
// And now the 5 most recent users to get in trouble
$sql = 'SELECT u.user_id, u.username, u.user_warnings, w.warning_time
FROM ' . USERS_TABLE . ' u, ' . WARNINGS_TABLE . ' w
WHERE u.user_id = w.user_id
ORDER BY w.warning_time DESC LIMIT 5';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('latest', array(
'U_NOTES' => 'mcp.' . $phpEx . $SID . '&amp;i=notes&amp;mode=user_notes&amp;u=' . $row['user_id'],
'U_USER' => 'memberlist.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $row['user_id'],
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['warning_time']),
'WARNINGS' => $row['user_warnings'],
)
);
}
$db->sql_freeresult($result);
}
/**
* Handles warning the user when the warning is for a specific post
*/
function mcp_warn_post_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$post_id = request_var('p', 0);
$notify = (isset($_REQUEST['notify_user'])) ? true : false;
$warning = request_var('warning', '');
$sql = 'SELECT u.*, p.* FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
WHERE post_id = $post_id
AND u.user_id = p.poster_id";
$result = $db->sql_query($sql);
if (!$userrow = $db->sql_fetchrow($result))
{
trigger_error($user->lang['NO_POST']);
}
$db->sql_freeresult($result);
// There is no point issuing a warning to ignored users (ie anonymous and bots)
if ($userrow['user_type'] == USER_IGNORE)
{
trigger_error($user->lang['CANNOT_WARN_ANONYMOUS']);
}
// Check if there is already a warning for this post to prevent multiple
// warnings for the same offence
$sql = 'SELECT * FROM ' . WARNINGS_TABLE . "
WHERE post_id = $post_id";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
trigger_error($user->lang['ALREADY_WARNED']);
}
$db->sql_freeresult($result);
$user_id = $userrow['user_id'];
if ($warning && $action == 'add_warning')
{
add_warning($userrow, $warning, $notify, $post_id);
$redirect = "mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes&amp;u=$user_id";
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// OK, they didn't submit a warning so lets build the page for them to do so
// We want to make the message available here as a reminder
// Parse the message and subject
$message = $userrow['post_text'];
// If the board has HTML off but the post has HTML on then we process it, else leave it alone
if (!$auth->acl_get('f_html', $userrow['forum_id']) && $row['enable_html'])
{
$message = preg_replace('#(<!\-\- h \-\-><)([\/]?.*?)(><!\-\- h \-\->)#is', "&lt;\\2&gt;", $message);
}
// Second parse bbcode here
if ($userrow['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
// Always process smilies after parsing bbcodes
$message = smiley_text($message);
if ($userrow['enable_html'] && $auth->acl_get('f_html', $userrow['forum_id']))
{
// Remove Comments from post content
$message = preg_replace('#<!\-\-(.*?)\-\->#is', '', $message);
}
// Replace naughty words such as farty pants
$message = str_replace("\n", '<br />', censor_text($message));
// Generate the appropriate user information for the user we are looking at
$rank_title = $rank_img = '';
// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
$avatar_img = '';
if (!empty($userrow['user_avatar']))
{
switch ($userrow['user_avatar_type'])
{
case AVATAR_UPLOAD:
$avatar_img = $config['avatar_path'] . '/';
break;
case AVATAR_GALLERY:
$avatar_img = $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $userrow['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" border="0" alt="" />';
}
else
{
$avatar_img = '<img src="adm/images/no_avatar.gif" alt="" />';
}
$template->assign_vars(array(
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;p=$post_id",
'POST' => $message,
'USERNAME' => $userrow['username'],
'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',
'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($userrow['user_regdate'], $user->lang['DATE_FORMAT']),
'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
)
);
}
/**
* Handles warning the user
*/
function mcp_warn_user_view($id, $mode, $action)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
$user_id = request_var('u', 0);
$username = request_var('username', '');
$notify = (isset($_REQUEST['notify_user'])) ? true : false;
$warning = request_var('warning', '');
$sql_where = ($user_id) ? "user_id = $user_id" : "username = '" . $db->sql_escape($username) . "'";
$sql = 'SELECT * FROM ' . USERS_TABLE . " WHERE $sql_where";
$result = $db->sql_query($sql);
if (!$userrow = $db->sql_fetchrow($result))
{
trigger_error($user->lang['NO_USER']);
}
$db->sql_freeresult($result);
$user_id = $userrow['user_id'];
if ($warning && $action == 'add_warning')
{
add_warning($userrow, $warning, $notify);
$redirect = "mcp.$phpEx$SID&amp;i=notes&amp;mode=user_notes&amp;u=$user_id";
meta_refresh(2, $redirect);
trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
}
// OK, they didn't submit a warning so lets build the page for them to do so
$template->assign_vars(array(
'U_POST_ACTION' => "mcp.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;u=$user_id",
'USERNAME' => $userrow['username'],
'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',
'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($userrow['user_regdate'], $user->lang['DATE_FORMAT']),
'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,
'AVATAR_IMG' => $avatar_img,
'RANK_IMG' => $rank_img,
)
);
}
/**
* Insert the warning into the database
*/
function add_warning($userrow, $warning, $send_pm = true, $post_id = 0)
{
global $SID, $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
if ($send_pm)
{
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
$pm_data = array(
'from_user_id' => $user->data['user_id'],
'from_user_ip' => $user->data['user_ip'],
'from_username' => $user->data['username'],
'enable_sig' => false,
'enable_bbcode' => false,
'enable_html' => false,
'enable_smilies' => false,
'enable_urls' => false,
'icon_id' => 0,
'message_md5' => 0,
'bbcode_bitfield' => 0,
'bbcode_uid' => '',
'message' => $warning, // TODO: The message sent to the user should either be templated from the language pack or set in the board config
'address_list' => array('u' => array($userrow['user_id'] => 'to')),
);
submit_pm('post', 'Warning Issued', $pm_data, false, false); // TODO: The topic should either be in the language of the recipient or set in the board config
}
add_log('admin', 'LOG_USER_WARNING', $userrow['username']);
add_log('user', $userrow['user_id'], 'LOG_USER_GENERAL', $warning); // TODO: Need a relevant language entry for this such that it is displayed as a warning in the notes
$sql_ary = array(
'user_id' => $userrow['user_id'],
'post_id' => $post_id,
'log_id' => 0, // TODO : Obtain the log_id of the warning
'warning_time' => time(),
);
$db->sql_query('INSERT INTO ' . WARNINGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_warnings = user_warnings + 1 WHERE user_id = ' . $userrow['user_id']);
}
?>

View file

@ -215,6 +215,7 @@ $lang += array(
'LOG_ME_IN' => 'Log me on automatically each visit', 'LOG_ME_IN' => 'Log me on automatically each visit',
'LOG_USER_FEEDBACK' => '<b>Added user feedback</b><br />&#187; %s', 'LOG_USER_FEEDBACK' => '<b>Added user feedback</b><br />&#187; %s',
'LOG_USER_GENERAL' => '%s', 'LOG_USER_GENERAL' => '%s',
'LOG_USER_WARNING' => '<b>Added user warning</b><br />&#187;%s',
'MARK' => 'Mark', 'MARK' => 'Mark',
'MARK_ALL' => 'Mark all', 'MARK_ALL' => 'Mark all',
@ -429,6 +430,7 @@ $lang += array(
'VIEW_BOOKMARKS' => 'View bookmarks', 'VIEW_BOOKMARKS' => 'View bookmarks',
'VIEW_LATEST_POST' => 'View latest post', 'VIEW_LATEST_POST' => 'View latest post',
'VIEW_NEWEST_POST' => 'View newest post', 'VIEW_NEWEST_POST' => 'View newest post',
'VIEW_NOTES' => 'View user notes',
'VIEW_ONLINE_TIME' => 'This data is based on users active over the past %d minute', 'VIEW_ONLINE_TIME' => 'This data is based on users active over the past %d minute',
'VIEW_ONLINE_TIMES' => 'This data is based on users active over the past %d minutes', 'VIEW_ONLINE_TIMES' => 'This data is based on users active over the past %d minutes',
'VIEW_TOPIC' => 'View topic', 'VIEW_TOPIC' => 'View topic',
@ -439,6 +441,8 @@ $lang += array(
'VIEW_TOPIC_POLL' => 'Poll: ', 'VIEW_TOPIC_POLL' => 'Poll: ',
'VIEW_TOPIC_STICKY' => 'Sticky: ', 'VIEW_TOPIC_STICKY' => 'Sticky: ',
'WARNINGS' => 'Warnings',
'WARN_USER' => 'Warn user',
'WELCOME_SUBJECT' => 'Welcome to %s Forums', 'WELCOME_SUBJECT' => 'Welcome to %s Forums',
'WEBSITE' => 'Website', 'WEBSITE' => 'Website',
'WHOIS' => 'Whois', 'WHOIS' => 'Whois',

View file

@ -31,9 +31,12 @@ if (empty($lang) || !is_array($lang))
$lang += array( $lang += array(
'ACTION' => 'Action', 'ACTION' => 'Action',
'ADD_FEEDBACK' => 'Add feedback', '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.', '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.',
'ADD_WARNING' => 'Add warning',
'ADD_WARNING_EXPLAIN' => 'To send a warning to this user please fill out the following form. Only use plain text; HTML, BBCode, etc. are not permitted.',
'ALL_ENTRIES' => 'All entries', 'ALL_ENTRIES' => 'All entries',
'ALREADY_REPORTED' => 'This post has already been reported', 'ALREADY_REPORTED' => 'This post has already been reported',
'ALREADY_WARNED' => 'A warning has already been issued for this post',
'APPROVE' => 'Approve', 'APPROVE' => 'Approve',
'APPROVE_POST' => 'Approve Post', 'APPROVE_POST' => 'Approve Post',
'APPROVE_POST_CONFIRM' => 'Are you sure you want to approve this post?', 'APPROVE_POST_CONFIRM' => 'Are you sure you want to approve this post?',
@ -41,6 +44,7 @@ $lang += array(
'APPROVE_POSTS_CONFIRM' => 'Are you sure you want to approve the selected posts?', 'APPROVE_POSTS_CONFIRM' => 'Are you sure you want to approve the selected posts?',
'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it\'s already in', 'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it\'s already in',
'CANNOT_WARN_ANONYMOUS' => 'You cannot warn an guest user',
'CAN_LEAVE_BLANK' => 'This can be left blank.', 'CAN_LEAVE_BLANK' => 'This can be left blank.',
'CHANGE_POSTER' => 'Change poster', 'CHANGE_POSTER' => 'Change poster',
@ -143,7 +147,11 @@ $lang += array(
'MCP_VIEW_LOGS' => 'View logs', 'MCP_VIEW_LOGS' => 'View logs',
'MCP_VIEW_RECENT' => 'View recent (%s)', 'MCP_VIEW_RECENT' => 'View recent (%s)',
'MCP_VIEW_USER' => 'View warnings for a specific user', 'MCP_VIEW_USER' => 'View warnings for a specific user',
'MCP_WARNINGS' => 'Warnings', 'MCP_WARN' => 'Warnings',
'MCP_WARN_FRONT' => 'Front Page',
'MCP_WARN_LIST' => 'List warnings',
'MCP_WARN_POST' => 'Warn for specific post',
'MCP_WARN_USER' => 'Warn User',
'MERGE_POSTS' => 'Merge posts', 'MERGE_POSTS' => 'Merge posts',
'MERGE_POSTS_CONFIRM' => 'Are you sure you want to merge the selected posts?', 'MERGE_POSTS_CONFIRM' => 'Are you sure you want to merge the selected posts?',
'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic.<br />Please enter the destination topic id or click on the "Select" button to search for one', 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic.<br />Please enter the destination topic id or click on the "Select" button to search for one',
@ -157,9 +165,11 @@ $lang += array(
'NOTIFY_POSTER_APPROVAL'=> 'Notify poster about approval?', 'NOTIFY_POSTER_APPROVAL'=> 'Notify poster about approval?',
'NOTIFY_POSTER_DISAPPROVAL' => 'Notify poster about disapproval?', 'NOTIFY_POSTER_DISAPPROVAL' => 'Notify poster about disapproval?',
'NOTIFY_USER_WARN' => 'Notify user about warning?',
'NOT_MODERATOR' => 'You are not a moderator of this forum', 'NOT_MODERATOR' => 'You are not a moderator of this forum',
'NO_DESTINATION_FORUM' => 'Please select a forum for destination', 'NO_DESTINATION_FORUM' => 'Please select a forum for destination',
'NO_ENTRIES' => 'No log entries for this period', 'NO_ENTRIES' => 'No log entries for this period',
'NO_FEEDBACK' => 'No feedback exists for this user',
'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts', 'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts',
'NO_MATCHES_FOUND' => 'No matches found', 'NO_MATCHES_FOUND' => 'No matches found',
'NO_POST_SELECTED' => 'You must select at least one post to perform this action', 'NO_POST_SELECTED' => 'You must select at least one post to perform this action',
@ -258,6 +268,7 @@ $lang += array(
'USER_CANNOT_POST' => 'You cannot post in this forum', 'USER_CANNOT_POST' => 'You cannot post in this forum',
'USER_CANNOT_REPORT' => 'You cannot report posts in this forum', 'USER_CANNOT_REPORT' => 'You cannot report posts in this forum',
'USER_FEEDBACK_ADDED' => 'User feedback added successfully', 'USER_FEEDBACK_ADDED' => 'User feedback added successfully',
'USER_WARNING_ADDED' => 'User warned successfully',
'VIEW_DETAILS' => 'View Details', 'VIEW_DETAILS' => 'View Details',

View file

@ -38,6 +38,10 @@
<td class="gen" align="right" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td> <td class="gen" align="right" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td>
<td><b class="gen">{POSTS}</b></td> <td><b class="gen">{POSTS}</b></td>
</tr> </tr>
<tr>
<td class="gen" align="right" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
<td><b class="gen">{WARNINGS}</b></td>
</tr>
</table></td> </table></td>
</tr> </tr>
</table> </table>

View file

@ -0,0 +1,73 @@
<!-- INCLUDE mcp_header.html -->
<!-- $Id$ -->
<form method="post" name="mcp" action="{U_POST_ACTION}">
<table class="bg" width="75%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th colspan="2"align="center">{L_SELECT_USER}</th>
</tr>
<tr>
<td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}: </b><br /><span class="gensmall">[ <a href="{U_FIND_MEMBER}" onclick="window.open('{U_FIND_MEMBER}', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;">{L_FIND_USERNAME}</a> ]</span></td>
<td class="row2"><input type="text" class="post" name="username" maxlength="50" size="20" /></td>
</tr>
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="submituser" value="{L_SUBMIT}" class="btnmain" /></td>
</tr>
</table>
</form>
<br clear="all" /><br />
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<td class="row3" colspan="5" align="center"><b class="gen">{L_MOST_WARNINGS}</b></td>
</tr>
<tr>
<th>&nbsp;{L_USERNAME}&nbsp;</th>
<th>&nbsp;{L_WARNINGS}&nbsp;</th>
<th>&nbsp;{L_LATEST_TIME}&nbsp;</th>
<th>&nbsp;</th>
</tr>
<!-- BEGIN highest -->
<tr>
<td class="row1" width="15%" valign="top"><span class="gen"><a href="{highest.U_USER}">{highest.USERNAME}</a></span></td>
<td class="row2" width="15%" valign="top"><span class="gen">{highest.WARNINGS}</span></td>
<td class="row1" width="15%" valign="top"><span class="gen"></span></td>
<td class="row2" width="15%" valign="top"><span class="gen"><a href="{highest.U_NOTES}">{L_VIEW_NOTES}</a></span></td>
</tr>
<!-- BEGINELSE -->
<tr>
<td class="row1" colspan="5" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td>
</tr>
<!-- END highest -->
</table>
<br clear="all" /><br />
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<td class="row3" colspan="5" align="center"><b class="gen">{L_LATEST_WARNINGS}</b></td>
</tr>
<tr>
<th>&nbsp;{L_USERNAME}&nbsp;</th>
<th>&nbsp;{L_TIME}&nbsp;</th>
<th>&nbsp;{L_TOTAL_WARNINGS}&nbsp;</th>
<th>&nbsp;</th>
</tr>
<!-- BEGIN latest -->
<tr>
<td class="row1" width="15%" valign="top"><span class="gen"><a href="{latest.U_USER}">{latest.USERNAME}</a></span></td>
<td class="row2" width="15%" valign="top"><span class="gen">{latest.WARNING_TIME}</span></td>
<td class="row1" width="15%" valign="top"><span class="gen">{latest.WARNINGS}</span></td>
<td class="row2" width="15%" valign="top"><span class="gen"><a href="{latest.U_NOTES}">{L_VIEW_NOTES}</a></span></td>
</tr>
<!-- BEGINELSE -->
<tr>
<td class="row1" colspan="5" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td>
</tr>
<!-- END latest -->
</table>
<br clear="all" /><br />
<!-- INCLUDE mcp_footer.html -->

View file

@ -0,0 +1,58 @@
<!-- INCLUDE mcp_header.html -->
<!-- $Id$ -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th colspan="2" height="28" align="center">{L_POST}</th>
</tr>
<tr>
<td class="row1" align="center"><table cellspacing="1" cellpadding="2" border="0">
<tr>
<td class="gen" align="center"><!-- IF USER_COLOR --><b style="color: #{USER_COLOR}"><!-- ELSE --><b><!-- ENDIF -->{USERNAME}</b></td>
</tr>
<!-- IF RANK -->
<tr>
<td class="postdetails" align="center">{RANK}</td>
</tr>
<!-- ENDIF -->
<!-- IF RANK_IMG -->
<tr>
<td align="center">{RANK_IMG}</td>
</tr>
<!-- ENDIF -->
<!-- IF AVATAR_IMG -->
<tr>
<td align="center">{AVATAR_IMG}</td>
</tr>
<!-- ENDIF -->
</table></td>
<td class="row1">
<span class="gen">{POST}</span>
</td>
</tr>
</table>
<br clear="all" /><br />
<form method="post" name="mcp" action="{U_POST_ACTION}">
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th height="28" align="center">{L_ADD_WARNING}</th>
</tr>
<tr>
<td class="row3" align="center"><span class="genmed">{L_ADD_WARNING_EXPLAIN}</span></td>
<tr>
<td class="row1" align="center"><textarea name="warning" rows="10" cols="76"></textarea></td>
</tr>
<tr>
<td class="row1" align="center"><input type="checkbox" name="notify_user" checked="checked" /><span class="genmed">{L_NOTIFY_USER_WARN}</span></td>
</tr>
<tr>
<td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
</form>
<br clear="all" /><br />
<!-- INCLUDE mcp_footer.html -->

View file

@ -0,0 +1,69 @@
<!-- INCLUDE mcp_header.html -->
<!-- $Id$ -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th colspan="2" height="28" align="center">{USERNAME}</th>
</tr>
<tr>
<td class="row1" align="center"><table cellspacing="1" cellpadding="2" border="0">
<tr>
<td class="gen" align="center"><!-- IF USER_COLOR --><b style="color: #{USER_COLOR}"><!-- ELSE --><b><!-- ENDIF -->{USERNAME}</b></td>
</tr>
<!-- IF RANK -->
<tr>
<td class="postdetails" align="center">{RANK}</td>
</tr>
<!-- ENDIF -->
<!-- IF RANK_IMG -->
<tr>
<td align="center">{RANK_IMG}</td>
</tr>
<!-- ENDIF -->
<!-- IF AVATAR_IMG -->
<tr>
<td align="center">{AVATAR_IMG}</td>
</tr>
<!-- ENDIF -->
</table></td>
<td class="row1"><table width="100%" cellspacing="1" cellpadding="2" border="0">
<tr>
<td class="gen" align="right" nowrap="nowrap">{L_JOINED}: </td>
<td width="100%"><b class="gen">{JOINED}</b></td>
</tr>
<tr>
<td class="gen" align="right" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}: </td>
<td><b class="gen">{POSTS}</b></td>
</tr>
<tr>
<td class="gen" align="right" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
<td><b class="gen">{WARNINGS}</b></td>
</tr>
</table></td>
</tr>
</table>
<br clear="all" /><br />
<form method="post" name="mcp" action="{U_POST_ACTION}">
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
<tr>
<th height="28" align="center">{L_ADD_WARNING}</th>
</tr>
<tr>
<td class="row3" align="center"><span class="genmed">{L_ADD_WARNING_EXPLAIN}</span></td>
<tr>
<td class="row1" align="center"><textarea name="warning" rows="10" cols="76"></textarea></td>
</tr>
<tr>
<td class="row1" align="center"><input type="checkbox" name="notify_user" checked="checked" /><span class="genmed">{L_NOTIFY_USER_WARN}</span></td>
</tr>
<tr>
<td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
</form>
<br clear="all" /><br />
<!-- INCLUDE mcp_footer.html -->

View file

@ -484,6 +484,7 @@ $template->assign_vars(array(
'REPORT_IMG' => $user->img('btn_report', 'REPORT_POST'), 'REPORT_IMG' => $user->img('btn_report', 'REPORT_POST'),
'REPORTED_IMG' => $user->img('icon_reported', 'POST_REPORTED'), 'REPORTED_IMG' => $user->img('icon_reported', 'POST_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'POST_UNAPPROVED'), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'POST_UNAPPROVED'),
'WARN_IMG' => $user->img('btn_report', 'WARN_USER'),
'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_KEY' => $s_sort_key,
@ -1299,6 +1300,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;p=" . $row['post_id'] . '#' . $row['post_id'], 'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;p=" . $row['post_id'] . '#' . $row['post_id'],
'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$i + 1])) ? $rowset[$i + 1]['post_id'] : '', 'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$i + 1])) ? $rowset[$i + 1]['post_id'] : '',
'U_PREV_POST_ID' => $prev_post_id, 'U_PREV_POST_ID' => $prev_post_id,
'U_WARN' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=warn&amp;mode=warn_post&amp;p=" . $row['post_id'] : '',
'POST_ID' => $row['post_id'], 'POST_ID' => $row['post_id'],