что бы рядом с ником забаненого юзера писало что он забанен
Сначала выполнить SQL
ALTER TABLE `phpbb_users` ADD `user_ban` TINYINT( 1 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `user_form_salt` ;
Если уже есть забаненные пользователи, то вручную в этом поле выставить
1.
Файл viewtopic.php
// Найти
if ($row['post_attachment'] && $config['allow_attachments'])
{
$attach_list[] = $row['post_id'];
if ($row['post_approved'])
{
$has_attachments = true;
}
}
// После вставить
if ($row['user_ban'])
{
$sqlban = 'SELECT MAX(ban_id) AS last, MAX(ban_end) AS end FROM '. BANLIST_TABLE .' WHERE ban_userid = '. $row['user_id'] .' LIMIT 1';
$res = $db->sql_query($sqlban);
$r = $db->sql_fetchrow($res);
$last_ban = $r['last'];
$end = $r['end'];
$db->sql_freeresult($res);
$row['end'] = $end;
if ($end !=0)
{
if (!$last_ban || $end < time())
{
// ban Expired
include_once($phpbb_root_path . 'includes/mcp/mcp_unban.' . $phpEx);
mcp_unban($row['user_id']);
$row['user_ban'] = 0;
}
}
}
// Найти
$rowset[$row['post_id']] = array(
// После вставить
'user_ban' => $row['user_ban'],
'end' => $row['end'],
// Найти
$user_cache[$poster_id] = array(
// После вставить
'user_ban' => $row['user_ban'],
'end' => $row['end'],
// Найти
$postrow = array(
// После вставить
'BAN_END' => ($user_cache[$poster_id]['end']) ? $user->format_date($user_cache[$poster_id]['end']) : '<span style="color: red;">'.$user->lang['PERMANENT'].'</span>',
'S_BAN' => $user_cache[$poster_id]['user_ban'],
Файл language/ru/common.php
// Найти
$lang = array_merge($lang, array(
// После вставить
'BANNED' => ' Забанен до: ',
'PERMANENT' => 'Бессрочно',
Файл includes/functions_user.php
// Найти, строка 791
$banlist_ary[] = (int) $row['user_id'];
// После вставить
// set user_ban to 1
$sqlban = 'UPDATE ' . USERS_TABLE . ' SET user_ban = 1 WHERE ' . $db->sql_in_set('username_clean', $sql_usernames);
$result = $db->sql_query($sqlban);
// Найти
$l_unban_list = '';
while ($row = $db->sql_fetchrow($result))
{
$l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info'];
$unban_info[] = $row['unban_info'];
}
$db->sql_freeresult($result);
// После вставить
if ($mode == 'user')
{ // set 'user_ban' to zero
$unban_name = array_map(NULL, $unban_info);
$sql_unban = 'UPDATE '. USERS_TABLE .' SET user_ban = 0 WHERE '. $db->sql_in_set('username', $unban_name);
$db->sql_query($sql_unban);
}
Создать файл includes/mcp/mcp_unban.php
<?php
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* @package mcp
*/
function mcp_unban($id)
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpEx;
$mode = 'user';
$sql = 'SELECT username FROM '. USERS_TABLE .' WHERE user_id = ' .$id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$user_name = $row['username'];
$sql = 'UPDATE '. USERS_TABLE .' SET user_ban = 0 WHERE user_id = ' .$id;
$db->sql_query($sql);
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
WHERE ban_userid = ' .$id;
$db->sql_query($sql);
// Add to moderator and admin log
add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $user_name);
add_log('mod', 0, 0, 'LOG_UNBAN_' . strtoupper($mode), $user_name);
}
?>
Файл styles/subsilver2/template/viewtopic_body.html
Найти
<span class="postdetails">
После вставить
<!-- IF postrow.S_BAN --><br /><b><span style="background: red;"><span style="color: white;">{L_BANNED}</span></span></b><br>{postrow.BAN_END}<hr /><!-- ENDIF -->
Уф.... Вроде все...