// Initial ban check against user_id or IP address
if ($is_user)
{
preg_match('#(..)(..)(..)(..)#', USER_IP, $ip);
$where_sql = "ban_ip IN('". USER_IP ."', '$ip[1]$ip[2]$ip[3]ff', '$ip[1]$ip[2]ffff', '$ip[1]ffffff')";
$where_sql .= ($login) ? " OR ban_userid = $user_id" : '';
$sql = "SELECT ban_id, b.ban_ip, b.ban_time_exp, b.ban_theme, b.ban_by, u2.username AS modername
FROM ". BB_BANLIST ." b
LEFT JOIN ". BB_USERS ." u2 ON (u2.user_id = b.ban_by)
WHERE $where_sql LIMIT 1";
if (DB()->fetch_row($sql))
{
$result = DB()->fetch_row($sql);
if ( $result != FALSE)
{
$t_exp = '';
if ($result['ban_time_exp'] != 0)
{
$t_exp = "до: " . date("H:i d-m-Y", $result['ban_time_exp']);
}
else $t_exp = 'перманентно';
bb_die("Вы забанены на трекере. Забанил " . $result['modername'] . ". Срок: ". $t_exp . ", причина: " . $result['ban_theme']);
}
}
}