- Адаптированная под последние ревизии версия, спасибо dredd
if ($mode == 'newtopic' || $mode == 'reply')
{
set_tracks(COOKIE_TOPIC, $tracking_topics, $topic_id);
}
if($mode == 'newtopic' && defined('TORRENT_ATTACH_ID') && $bb_cfg['bt_newtopic_auto_reg'] && !$error_msg)
{
$v_chat = "На трекере новый релиз! [url=http://" . $bb_cfg['server_name'] . "/" . $post_url . "]" . $subject . "[/url]";
$text_htmll = bbcode2html(bbcode_chat(prepare_message($v_chat)));
//$text_html = preg_replace_callback("/\[n\](.*?)\[\/n\]/siu", 'parse_username', $text_html);
DB()->query("INSERT INTO bb_chat (user_id, time, text, text_html, ip) VALUES ('". BOT_UID ."', '". TIMENOW ."', '". DB()->escape($v_chat) ."', '". DB()->escape($text_htmll) ."', '0')");
$sql = DB()->fetch_rowset("SELECT c.*, u.username, u.user_rank, u.avatar_ext_id, u.user_opt
FROM bb_chat c
LEFT JOIN ". BB_USERS ." u ON(u.user_id = c.user_id)
ORDER BY c.id DESC
LIMIT {$bb_cfg['chat_message']}");
CACHE('bb_cache')->set('chat', $sql);
}
что там написано в 1 строке?
<?php
if (!defined('IN_AJAX')) die(basename(__FILE__));
global $bb_cfg, $userdata;
$mode = (string) $this->request['mode'];
function parse_username($username)
{
$username = $username[1];
$row = DB()->fetch_row("SELECT user_id, user_rank FROM ". BB_USERS ." WHERE username = '". DB()->escape($username) ."'");
if($row) $username = '<a href="'. PROFILE_URL . $row['user_id'] .'">'. $username .'</a>';
return $username;
}
switch($mode)
{
case 'select':
$id = (int) @$this->request['id'];
$up = (int) @$this->request['up'];