<?php
require_once '../core/system.php';
echo only_reg();
echo ban();
if (isset($_GET['id'])) {
$topic_name = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_topic` WHERE `id`  = '$get_id'"));
$header = rawuridecode($topic_name['name']);
}
require_once '../core/head.php';
if (isset($_GET['id'])){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_topic` WHERE `id` = '$get_id'"),0) == true) {
$topic = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_topic` WHERE `id`  = '$get_id'"));
$topic_razdel = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id`  = '$topic[id_razdel]'")); 
$topic_parent_razdel = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_razdel` WHERE `id`  = '$topic_razdel[attached_to]'")); 
}
if ($topic_parent_razdel['clan_forum'] == '1' || $topic_razdel['clan_forum'] == '1') {
include 'include_clan_forum_topic.php';
}elseif ($topic_parent_razdel['clan_forum'] == '0' || $topic_razdel['clan_forum'] == '0') {
include 'include_forum_topic.php';
}else{
$_SESSION['err'] = "Топик не найден!";
header('Location: /forum');
exit();
}
}
require_once '../core/foot.php';
?>