<?php
session_start();
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;

$do = isset($_GET['do']) ? check($_GET['do']) : false;
///Подключаем шапку
$title->GetHeader();
$id = isset($_GET['id']) ? abs((int)$_GET['id']) : false;
$array = DB::$dbs->query("SELECT * FROM forum_mess WHERE id = ? LIMIT 1", [$id]);
if ($array -> rowCount() == 0) {
header('location: /');
die();
}
$arr = $array -> fetch();
$raz = DB::$dbs->queryFetch("SELECT * FROM forum_razdel WHERE id = ? LIMIT 1", [$arr['rid']]);
$praz = DB::$dbs->queryFetch("SELECT * FROM forum_prazdel WHERE id = ? LIMIT 1", [$arr['prid']]);
$topic = DB::$dbs->queryFetch("SELECT * FROM forum_topic WHERE id = ? LIMIT 1", [$arr['tid']]);

echo '<div class="container-fluid page_header"><div class="container"><div class="row"><div class="col-xs-12 col-sm-8 col-md-9 col-lg-9"><h1>Форум - Действие с сообщением </h1><ol class="breadcrumb" xmlns:v="http://'.homeurl.'/#"><li typeof="v:Breadcrumb"><a href="/" rel="v:url" property="v:title">'.homeurl.'</a></li><li typeof="v:Breadcrumb"><a href="/forum" rel="v:url" property="v:title">Форум</a></li>
<li typeof="v:Breadcrumb"><a href="viewrazd.php?id='.$raz['id'].'" rel="v:url" property="v:title">'.$raz['name'].'</a></li>
<li typeof="v:Breadcrumb"><a href="viewthem.php?id='.$praz['id'].'" rel="v:url" property="v:title">'.$praz['name'].'</a></li>
<li typeof="v:Breadcrumb"><a href="viewtopic.php?id='.$topic['id'].'" rel="v:url" property="v:title">'.$topic['name'].'</a></li>
<li class="active" typeof="v:Breadcrumb"><span property="v:title">Действие с сообщением</span></li></ol></div><div class="col-xs-12 col-sm-4 col-md-3 col-lg-3 text-right page_header_sidebar"></div></div></div></div>';
echo'<div class="container page_body"><div class="row"><div class="col-xs-12 page_content col-lg-9"><div class="navbar page_content_navbar collapse hidden-lg"><div class="container-fluid"><div class="navbar-collapse"></div></div></div><div class="text_box hidden-lg pr_block_small hidden"></div><div class="container-fluid cols_table">';

switch($do) {
default:
header('location: /');
break;
case 'nar':
if ($topic['block'] == 2) {
header('location: /');
die();
}
$user = DB::$dbs->queryFetch("SELECT * FROM blogger WHERE id = ? LIMIT 1", [$arr['user_id']]);
$title->SetTitle(''.$topic['name'].' - Выписать нарушение');

if ($topic['type'] == 'closed') {
header('location: /');
die();
}
if ($arr['user_id'] == $b['id'] && $b['level'] < 1 && $b['level'] < user_inf($arr['user_id'], 'level')) {
header('location: /');
die();
}
$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", array($topic['id']));
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = '?page='.$pg;
} else {
$st = '';
}
echo '<div class="catSides"> <a href="viewtopic.php?id='.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> - Выписать нарушение</div>';
echo '<div class="row"><div class="col-xs-3 col-sm-1"><div class="user_brief"> <b>Автор:</b> '.Nick($arr['user_id']).'<br/><b>Текст на момент наказания:</b> '.$arr['text'].'<br/><a href="/rules">Ссылка на общие правила</a></div></div></div>';
if (isset($_POST['add'])) {
$form = ['text' => isset($_POST['text']) ? check($_POST['text']) : null, 'nar' => isset($_POST['nar']) ? check($_POST['nar']) : null, 'type' => isset($_POST['type']) ? abs((int)$_POST['type']) : null];
if (empty($form['text'])) {
err('Введите комментарий!');
} elseif (empty($form['type'])) {
err('Укажите тип!');
} elseif ($form['nar'] < 0) {
err('Укажите пункты правил!');
} else {
$tema = 'http://'.$_SERVER['HTTP_HOST'].'/forum/thema'.$topic['id'];
DB::$dbs->query("INSERT INTO nar SET user_id = ?, id_user = ?, text = ?, type = ?, time = ?, message = ?, nar = ?, tema= ?", [$arr['user_id'],$b['id'],$form['text'],$form['type'],time(),$arr['text'],$form['nar'],$tema]);
DB::$dbs->query("UPDATE `blogger` SET `gears` = `gears` - ? WHERE `id` = ?", [10,$arr['user_id']]);
jurnal($arr['user_id'],Nick($b['id']).' выписал вам [url=http://'.$_SERVER['HTTP_HOST'].'/info/expired.html?id='.$arr['user_id'].'][b]'.($form['type'] == 1 ? 'предупреждение':'нарушение').'[/b][/url]',5); // личная лента
lenta(Nick($b['id']).' выписал [url=http://'.$_SERVER['HTTP_HOST'].'/info/expired.html?id='.$arr['user_id'].'][b]'.($form['type'] == 1 ? 'предупреждение':'нарушение').'[/b][/url] для '.Nick($arr['user_id'])); // общая лента
header('Location: /forum/thema'.$topic['id'].$st);
die();
}
}
echo '<div class="catSides"><i class="md-format-list-bulleted"></i> Применение наказании</div>';
echo '<div class="row"><div class="col-xs-3 col-sm-1"><div class="user_brief"><form action="?do=nar&id='.$id.'" method="POST"><b>Ваш комментарий:</b><br/><textarea class="form-control" rows="3"name="text"></textarea><br/><input type="radio" name="type" value="1" checked="checked"/> Предупреждение<br/><input type="radio" name="type" value="2"/> Нарушение <br/><b>Нарушаемые пункты (* через запятую, если нет в списке - пишем 0):</b><br/> <input type="text" class="form-control" name="nar"/><br/><input type="submit" name="add" class="btn btn-primary" value="Применить"/></form></div></div></div>';
break;
case 'quote':
if ($topic['block'] == 2) {
header('location: /');
die();
}
$raz = DB::$dbs->queryFetch("SELECT * FROM forum_razdel WHERE id = ? LIMIT 1", [$arr['rid']]);
$praz = DB::$dbs->queryFetch("SELECT * FROM forum_prazdel WHERE id = ? LIMIT 1", [$arr['prid']]);
$user = DB::$dbs->queryFetch("SELECT * FROM blogger WHERE id = ? LIMIT 1", [$arr['user_id']]);
$title->SetTitle(''.$topic['name'].' - Цитируем');
if ($topic['type'] == 'closed') {
header('location: /');
die();
}
if ($arr['user_id'] == $b['id']) {
header('location: /');
die();
}
echo '<div class="catSides"><a href="viewtopic.php?id='.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> | Цитируем</div>';
$posting = $user['nick'].' ('.date('d.m.y в H:i', $arr['time']).') '.$arr['text'].'...';
echo '<div class="row text_box"><div class="pull-right text-muted top_right_box"></div><b>Цитируемый текст:</b><br/>'.$posting.'</div>';
$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", [$topic['id']]);
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = '?page='.$pg;
} else {
$st = '';
}
if (isset($_POST['add'])) {
$err = [];
$form = ['text' => isset($_POST['text']) ? check($_POST['text']) : null];
if (empty($form['text'])) {
$err[] = 'Введите сообщение!';
}
if (DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE text = ? AND tid = ?", [$form['text'],$topic['id']]) > 0) {
$err[] = 'Такое сообщение уже есть!';
}
$time = DB::$dbs->query("SELECT * FROM forum_mess WHERE user_id = ? ORDER BY time DESC", [$b['id']]);
while($t = $time -> fetch()) {
if ((time() - $t['time']) < 10) {
err('Пишите не чаще чем раз в 10 секунд!');
///Подключаем футер
$title->GetFooter();
die();
}
}
if (empty($err)) {
$podpis = DB::$dbs -> query("SELECT * FROM `forum_podpis` WHERE `tid`=? AND `user_id` != ? order by id", array($topic['id'],$b['id']));
if ($podpis -> rowCount() != 0){
$podp = DB::$dbs -> query("SELECT * FROM `forum_podpis` WHERE `tid` = ? order by id", array($topic['id']));
while($pod = $podp -> fetch()) {
$mes = Nick($b['id']).' оставил сообщение в теме <a href="/forum/thema'.$topic['id'].'">'.$topic['name'].'</a>';
jurnal($pod['user_id'],$mes,2);
}
}
DB::$dbs->query("INSERT INTO forum_mess SET text = ?, user_id = ?, time = ?, rid = ?, prid = ?, tid = ?, cit = ?", [$form['text'],$b['id'],time(),$raz['id'],$praz['id'],$topic['id'],$posting]);
$m = DB::$dbs->lastInsertId();
DB::$dbs->query("UPDATE forum_topic SET last = ? WHERE id = ?", [time(),$topic['id']]);
DB::$dbs->query("UPDATE `blogger` SET `gears` = `gears` + ? WHERE id = ?", [1,$b['id']]);
DB::$dbs->query("UPDATE `blogger` SET `post` = `post` + ? WHERE id = ?", [1,$b['id']]);
if(empty($_SESSION['fpage'])){
$_SESSION['fpage']=1;
}
$mess = 'Пользователь [b]'.$b['nick'].'[/b] процитировал ваше сообщение '.$arr['text'].' в теме  [url=http://'.$_SERVER['HTTP_HOST'].'/forum/viewtopic.php?id='.$topic['id'].'&page='.$_SESSION['fpage'].']'.$topic['name'].'[/url]';
jurnal($arr['user_id'],$mess,2);
if ($_POST['addfile'] == 1) {
header('location: ?do=addfile&id='.$m);
} else {
header('location: /forum/thema'.$topic['id'].$st);
die();
}
} else {
echo '<div class="error">';
foreach($err as $error) {
echo '<b>'.$error.'</b><br/>';
}
echo '</div>';
}
}

echo '<form name="form" method="post" action="?do=quote&id='.$id.'" method="POST" enctype="multipart/form-data"><div class="row text_box"><div class="pull-right text-muted top_right_box"></div>Сообщение:<br/>';
//quickpaste('text');
//quickcode();echo'<br/>';
//quicksmiles();
echo'<textarea class="form-control" rows="3" name="text"></textarea><br/><input type="checkbox" name="addfile" value="1"/> Прикрепить файл<br/><input type="submit" class="btn btn-primary" name="add" value="Написать"/></div></form>';
break;
case 'addfile':
$id = isset($_GET['id']) ? abs((int)$_GET['id']) : false;
$array = DB::$dbs->query("SELECT * FROM forum_mess WHERE id = ?", [$id]);
if ($array -> rowCount() == 0) {
header('location: /');
die();
}
$arr = $array -> fetch();
if ($arr['del'] == 1 && $b['id'] != $arr['user_id']) {
header('location: /');
die();
}
$topic = DB::$dbs->queryFetch("SELECT * FROM forum_topic WHERE id = ?", [$arr['tid']]);
if ($topic['block'] == 2) {
header('location: /');
die();
}
$user = DB::$dbs->queryFetch("SELECT * FROM blogger WHERE id = ?", [$arr['user_id']]);
$title->SetTitle('Форум - '.$raz['name'].' - '.$praz['name'].' - '.$topic['name'].' - Прикрепить файл');
echo '<div class="catSides"> <a href="viewtopic.php?id='.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> | Прикрепить файл</div>';
$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", array($topic['id']));
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = '?page='.$pg;
} else {
$st = '';
}
$limit_size = 5;
// upload files
if (isset($_GET['upload'])) {
for($i=0;$i<count($_FILES['userfile']['name']);$i++){
$namefile = retrans($_FILES['userfile']['name'][$i]);
$ext = strtolower(strrchr($_FILES['userfile']['name'][$i], '.'));
$newpath = 'files/forum/';
$fname = strtolower($_FILES['userfile']['name'][$i]);
$fnames = $_FILES['userfile']['name'][$i];
$fsize = $_FILES['userfile']['size'][$i];
$ext2 = explode(".", $fnames);
$ext_file = array('.exe','.msi','.jar','.jad','.sis','.sisx','.txt','.pdf','.doc','.rtf','.djvu','.xls','.jpg','.jpeg','.gif','.png','.bmp','.wmf','.zip','.rar','.7z','.tar','.gz','.3gp','.avi','.flv','.mpeg','.mp4','.mp3','.amr');
if ($fsize >= 1024 * 5 * 1024) {
err('Вес файла превышает <b>5</b> мб.');
DB::$dbs->query("DELETE FROM forum_mess WHERE id = ?", [$id]);
}
elseif (count($ext2) != 2) {
err('Запрещены файлы не имеющие имени, расширения, или с двойным расширением.');
DB::$dbs->query("DELETE FROM forum_mess WHERE id = ?", [$id]);
}
elseif (mb_strlen($fname) > 50) {
err('Длина названия файла не должна превышать 50 символов!');
DB::$dbs->query("DELETE FROM forum_mess WHERE id = ?", [$id]);
}
elseif (!preg_match('#^[a-z0-9.()+_-]#', $fname)) {
err('В названии файла "<b>' . $fname . '</b>" присутствуют недопустимые символы. Разрешены только латинские символы, цифры и некоторые знаки ( .()+_- )<br />Запрещены пробелы.');
DB::$dbs->query("DELETE FROM forum_mess WHERE id = ?", [$id]);
}
elseif (preg_match('/(\.php|\.pl|\.htaccess)/i', $fname) || !in_array($ext, $ext_file)) {
err('Запрещенный формат файла!');
DB::$dbs->query("DELETE FROM forum_mess WHERE id = ?", [$id]);
} else {
$upfile = mt_rand(10000,99999).''.homeurl.'_'.$namefile;
$path = '../files/forum/'.$upfile;
if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $path)) {
DB::$dbs->query("INSERT INTO forum_files SET tid = ?, files = ?, mid = ?, size = ?", [$topic['id'],$upfile,$id,$fsize]);
header('location: /forum/thema'.$topic['id'].$st);
die();
} else err('Закачка файла '.$namefile.' окончилась неудачно.');
}
}
}
echo '<form action="?do=addfile&id='.$id.'&upload" method="POST" enctype="multipart/form-data"><div class="row text_box"><div class="pull-right text-muted top_right_box"></div>Максимальный размер каждого файла <b>'.$limit_size.' mb.</b><br/>Файл:<br/><input type="file" name="userfile[]"/><br/><input type="submit" class="btn btn-primary" value="Прикрепить"/></div></form>';
break;
case 'editp':
if ($topic['block'] == 2) {
header('location: /');
die();
}
$user = DB::$dbs->queryFetch("SELECT * FROM blogger WHERE id = ? LIMIT 1", [$arr['user_id']]);
$title->SetTitle(''.$topic['name'].' - Изменить пост');
if ($arr['user_id'] != $b['id'] && $b['level'] == 0 && $b['level'] < user_inf($arr['user_id'], 'level')) {
header('location: /');
die();
}

echo '<div class="catSides"><a href="viewtopic.php?id='.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> - Изменить пост</div>';

$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", array($topic['id']));
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = '?page='.$pg;
} else {
$st = '';
}
if (isset($_POST['add'])) {
$err = [];
$form = ['text' => isset($_POST['text']) ? check($_POST['text']) : null];
if (empty($form['text'])) {
$err[] = 'Введите сообщение!';
}
if (empty($err)) {
DB::$dbs->query("UPDATE `forum_mess` SET `text` = ?, `time_edit` = ?, `count_edit` = `count_edit` + ?, `who_edit` = ? WHERE `id` = ? LIMIT 1", [$form['text'],time(),1,$b['id'],$id]);
if ($_POST['addfile'] == 1) {
header('location: ?do=addfile&id='.$id);
} else {
header('location: /forum/thema'.$topic['id'].$st);
die();
}
} else {
echo '<div class="error">';
foreach($err as $error) {
echo '<b>'.$error.'</b><br/>';
}
echo '</div>';
}
}
echo '<div class="row text_box"><div class="pull-right text-muted top_right_box"></div><form action="?do=editp&id='.$id.'" method="POST" enctype="multipart/form-data">Сообщение:<br/><textarea class="form-control" rows="3" name="text">'.$arr['text'].'</textarea><br/><input type="checkbox" name="addfile" value="1"/> Прикрепить файл<br/> <input type="submit" class="btn btn-primary" name="add" value="Изменить"/></form></div>';
break;
case 'del_post':
$title->SetTitle(''.$topic['name'].' - Удалить пост');
if ($b['level'] < 1) {
header('location: /');
die();
}

echo '<div class="catSides"><a href="viewtopic.php?id='.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> | Удалить пост</div>';

$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", array($topic['id']));
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = 'page='.$pg;
} else {
$st = '';
}
if (isset($_GET['del'])) {
if ($topic['type'] == 'closed') {
header('location: /');
die();
}
DB::$dbs->query("UPDATE forum_mess SET del = ?, who_del = ? WHERE id = ? LIMIT 1", [1,$b['id'],$id]);
header('location: /forum/thema'.$topic['id'].'?'.$st);
}
echo '<div class="row text_box"><div class="pull-right text-muted top_right_box"></div>Действительно удалить?<br/><a href="?do=del_post&id='.$id.'&del"> Да</a> | <a href="/forum/thema'.$topic['id'].'?'.$st.'">Нет</a></div>';
break;
case 'vost_post':
$title->SetTitle(''.$topic['name'].' - Восстановить пост');
if ($b['level'] < 4) {
header('location: /');
die();
}

echo '<div class="catSides"><a href="viewtopic.php?id='.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> - Восстановить пост</div>';

$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", array($topic['id']));
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = 'page='.$pg;
} else {
$st = '';
}
if (isset($_GET['del'])) {
if ($topic['type'] == 'closed') {
header('location: /');
die();
}
DB::$dbs->query("UPDATE forum_mess SET del = ?, who_del = ? WHERE id = ? LIMIT 1", [2,$b['id'],$id]);
header('location: /forum/thema'.$topic['id'].'?'.$st);
}
echo '<div class="row text_box"><div class="pull-right text-muted top_right_box"></div>Действительно восстановить?<br/><a href="?do=vost_post&id='.$id.'&del"> Да</a> | <a href="/forum/thema'.$topic['id'].'?'.$st.'">Нет</a></div>';
break;
case 'best':
$title->SetTitle(''.$topic['name'].' - Лучший ответ');

echo '<div class="catSides"> <a href="/forum/thema'.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> - Лучший ответ</div>';
$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", array($topic['id']));
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = '?page='.$pg;
} else {
$st = '';
}
if ($topic['type'] == 'closed') {
header('location: /forum/thema'.$topic['id'].$st);
die();
}
if ($b['id'] == $topic['user_id'] && $topic['otvet_2'] != $arr['id'] && $topic['otvet'] == 0 && $b['id'] != $arr['user_id']) {
DB::$dbs->query("UPDATE `forum_topic` SET `otvet` = ? WHERE `id` = ?",[$id,$topic['id']]);
DB::$dbs->query("UPDATE `blogger` SET `gears` = `gears` + ? WHERE `id` = ? LIMIT 1", [1,$arr['user_id']]);
jurnal(Nick($b['id']).' отметил Ваш пост "'.$arr['text'].'" как Лучший!',$arr['user_id'],4);
header('location: /forum/thema'.$topic['id'].$st);
die();
} else {
header('location: /forum/thema'.$topic['id'].$st);
die();
}
break;
case 'worst':
$title->SetTitle(''.$topic['name'].' - Худший ответ');
echo '<div class="catSides"> <a href="/viewforum/thema'.$topic['id'].'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> - Худший ответ</div>';
$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", array($topic['id']));
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = '?page='.$pg;
} else {
$st = '';
}
if ($topic['type'] == 'closed') {
header('location: /forum/thema'.$topic['id'].$st);
die();
}
if ($b['id'] == $topic['user_id'] && $topic['otvet_2']==0 && $topic['otvet'] != $arr['id'] && $b['id'] != $arr['user_id']){
DB::$dbs->query("UPDATE forum_topic SET otvet_2 = ? WHERE id = ? LIMIT 1", [$id,$topic['id']]);
DB::$dbs->query("UPDATE `blogger` SET `gears` = `gears` - ? WHERE `id` = ? LIMIT 1", [1,$arr['user_id']]);
jurnal(Nick($b['id']).' отметил Ваш пост "'.$arr['text'].'" как Худший!',$arr['user_id'],4);
header('location: /forum/thema'.$topic['id'].$st);
die();
} else {
header('location: /forum/thema'.$topic['id'].$st);
die();
}
break;
case 'complaint':
$title->SetTitle($topic['name'].' - Жалоба на сообщение');
echo '<div class="catSides"> <a href="/forum/thema'.$topic['id'].$st.'"><i class="md-format-list-bulleted"></i> '.$topic['name'].'</a> | Жалоба на сообщение</div>';
$mess = DB::$dbs->querySingle("SELECT COUNT(id) FROM forum_mess WHERE tid = ?", [$topic['id']]);
if ($mess > 10) {
$pg = ceil($mess / 10);
$st = '?page='.$pg;
} else {
$st = '';
}
if ($arr['user_id'] == $b['id']) {
header('location: /forum/thema'.$arr['tid'].$st);
die();
}
if (isset($_POST['send'])) {
$komm = check($_POST['komm']);
if (empty($komm)) {
err('Введите комментарий!');
} elseif (DB::$dbs->querySingle("SELECT COUNT(*) FROM `complaint` WHERE `id_post` = ? AND `user_id` = ?", [$id,$b['id']])>0) {
err('Вы уже жаловались на этот пост!');
} else {
$tema = 'http://'.homeurl.'/forum/thema'.$topic['id'].$st;
DB::$dbs->query("INSERT INTO `complaint` SET `id_user` = ?, `user_id` = ?, `text` = ?, `komm` = ?, `id_post` = ?, `time` = ?, `read` = ?, `type` = ?, `tema` = ?", [$arr['user_id'],$b['id'],$arr['text'],$komm,$id,time(),1,1,$tema]);
echo '<div class="access">Ваша жалоба отправлена модераторам на рассмотрение!</div>';
///Подключаем футер
$title->GetFooter();
die();
}
}
echo '<div class="row text_box"><div class="pull-right text-muted top_right_box"></div><form action="?do=complaint&id='.$id.'" method="POST">Комментарий:<br/><textarea name="komm"></textarea><br/><input type="submit" name="send" value="Отправить"/></form></div>';
break;
}
echo'<div class="catSides"><i class="md-format-list-bulleted"></i> <a href="/rules">Правила</a> | <a href="/bbcodes"> Справка BBcode</a> | <a href="/smiles">Все смайлы</a> | <a href="search">Поиск</a> | <a href="wholly_new">Найти новые</a></div>'; 

///Подключаем меню
$title->GetMenu();


///Подключаем футер
$title->GetFooter();
?>