$row_class = !($i % 2) ? 'row1' : 'row2';
$user_level = $shout_row['user_level'];
$user_rank = $shout_row['user_rank'];
if($user_level == ADMIN) $username = '<span class="colorAdmin">'.$shout_row['username'].'</span>' ;
else if($user_rank == SUPERMOD) $username = '<span class="colorSuperMod">'.$shout_row['username'].'</span>';
else if($user_rank == TECHNICAL_HELP) $username = '<span class="colorTechnicalhelp">'.$shout_row['username'].'</span>';
else if($user_rank == WARNED) $username = '<span class="colorWarned">'.$shout_row['username'].'</span>';
else if($user_rank == MOVIES) $username = '<span class="colorMovies">'.$shout_row['username'].'</span>';
else if($user_rank == GAMES) $username = '<span class="colorGames">'.$shout_row['username'].'</span>';
else if($user_rank == MUSIC) $username = '<span class="colorMusic">'.$shout_row['username'].'</span>';
else if($user_rank == BOOKS) $username = '<span class="colorBooks">'.$shout_row['username'].'</span>';
else if($user_level == MOD) $username = '<span class="colorMod">'.$shout_row['username'].'</span>';
else if($user_level == GROUP_MEMBER) $username = '<span class="colorGroup">'.$shout_row['username'].'</span>';
else $username = '<span class="colorNick">'.$shout_row['username'].'</span>';
<div class="tLeft pad_6">
<input type="button" class="chat_btn" value="Ж" name="codeB" title="Жирный (Ctrl+B)" style="font-weight: bold;"/>
<input type="button" class="chat_btn" value="К" name="codeI" title="Курсив (Ctrl+I)" style="font-style: italic;"/>
<input type="button" class="chat_btn" value="П" name="codeU" title="Подчёркнутый (Ctrl+U)" style="text-decoration: underline;"/>
<input type="button" class="chat_btn" value="З" name="codeS" title="Зачёркнутый (Ctrl+S)" text-decoration: line-through;"/>
<input type="button" class="chat_btn" value="Ссылка" name="codeUrl" title="Ссылка (Ctrl+W)" style="text-decoration: underline;"/>
<input type="button" class="chat_btn" value="Картинка" name="codeImg" title="Img (Ctrl+r)" />
<input type="hidden" name="codeUrl2"/>
<select name="codeColor" class="chat_btn">
<option style="color: black; background: #fff;" value="black" selected="selected">{L_QR_COLOR_SEL}:</option>
<option style="color: darkred;" value="darkred"> {L_COLOR_DARK_RED}</option>
<option style="color: brown;" value="brown"> {L_COLOR_BROWN}</option>
<option style="color: #996600;" value="#996600"> {L_COLOR_ORANGE}</option>
<option style="color: red;" value="red"> {L_COLOR_RED}</option>
<option style="color: #993399;" value="#993399"> {L_COLOR_VIOLET}</option>
<option style="color: green;" value="green"> {L_COLOR_GREEN}</option>
<option style="color: darkgreen;" value="darkgreen"> {L_COLOR_DARK_GREEN}</option>
<option style="color: gray;" value="gray"> {L_COLOR_GRAY}</option>
<option style="color: olive;" value="olive"> {L_COLOR_OLIVE}</option>
<option style="color: blue;" value="blue"> {L_COLOR_BLUE}</option>
<option style="color: darkblue;" value="darkblue"> {L_COLOR_DARK_BLUE}</option>
<option style="color: indigo;" value="indigo"> {L_COLOR_INDIGO}</option>
<option style="color: #006699;" value="#006699"> {L_COLOR_STEEL_BLUE}</option>
</select>
<select name="codeAlign" class="chat_btn">
<option value="left" selected="selected">Расположение:</option>
<option value="left"> Слева</option>
<option value="right"> Справа</option>
<option value="center"> По центру</option>
<option value="justify"> Выровнять</option>
</select>
<script type="text/javascript">
var bbcode = new BBCode("message");
var ctrl = "ctrl";
bbcode.addTag("codeB", "b", null, "B", ctrl);
bbcode.addTag("codeI", "i", null, "I", ctrl);
bbcode.addTag("codeU", "u", null, "U", ctrl);
bbcode.addTag("codeS", "s", null, "S", ctrl);
bbcode.addTag("codeImg", "img", null, "R", ctrl);
bbcode.addTag("codeUrl", "url", "/url", "", ctrl);
bbcode.addTag("codeUrl2", "url=", "/url", "W", ctrl);
bbcode.addTag("codeColor", function(e) { var v=e.value; e.selectedIndex=0; return "color="+v }, "/color");
bbcode.addTag("codeAlign", function(e) { var v=e.value; e.selectedIndex=0; return "align="+v }, "/align");
</script>
if (defined('TORRENT_ATTACH_ID') && $bb_cfg['bt_newtopic_auto_reg'] && !$error_msg)
{
// Мини Чат на аякс
$shoutbox_date = time();
$link_post = '<b style="color:red;">Внимание новый релиз !!!</b> <a href="viewtopic.php?t='.$topic_id.'"><b>'.str_replace("\'", "''", $subject).'</b></a>';
$link_post = DB()->escape($link_post);
CACHE('bb_cache')->rm('shout_data');
DB()->query("INSERT bb_shout
SET
shout_username = 'Bot',
shout_user_id = -746,
shout_group_id = 0,
shout_session_time = $shoutbox_date,
shout_ip = '',
shout_text = '$link_post',
shout_active = 0
");
// Мини Чат на аякс
$mode = (int) $this->request['mode'];
$message = (string) $this->request['message'];
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&', '<', '>', '"');
$message = str_replace("\r", '', trim($message));
$message = preg_replace("#\n{3,}#", "\n\n", $message);
$message = preg_replace($html_entities_match, $html_entities_replace, $message);
$message = nl2br($message);