Файл: CMS/core/modules/forum_print.php
Строк: 39
<?php
if (!defined('CMS')) { die('Access Denied!'); }
$row = $db->selectRow("SELECT `t`.*, `f`.`forums_id`, `f`.`forums_title`, `f`.`forums_parent`
FROM ?_forums_topics `t`
LEFT JOIN ?_forums `f`
ON `t`.`topics_forums_id` = `f`.`forums_id`
WHERE `t`.`topics_id` = ? LIMIT 1;", $id);
if (!empty($row)) {
$cat = '<a href="' . $config['site_url'] . '/forum/' . gen_uri('forum', $row['forums_id'], RND) . '">' . $row['forums_title'] . '</a>';
$url = '<a href="' . $config['site_url'] . '/forum/' . gen_uri('topic', $row['topics_id'], RND) . '">' . $row['topics_title'] . '</a>';
$date = get_date($row['topics_last_time'], 'j F Y');
header('Content-type:text/html; charset=utf-8');
echo <<<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body,td { font-family: verdana, arial, sans-serif; color: #666; font-size: 80%; }
h1,h2,h3,h4 { font-family: verdana, arial, sans-serif; color: #666; font-size: 100%; margin: 0px; }
img {border:0}
</style>
<title>Форум {$config['site_title']}> Версия для печати > {$row['topics_title']}</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<table border="0" width="100%" cellspacing="1" cellpadding="3">
<tr>
<td width="100%">
<a href="{$config['site_url']}">Главная</a> > <a href="{$config['site_url']}/forum/">Форум</a> > {$cat}> {$url}
<hr><h1>{$row['topics_title']}</h1><br /><small>{$date}. Разместил: {$row['topics_author'] }</small></td>
</tr>
<tr>
<td width="100%">
HTML;
$rows = $db->select("SELECT * FROM ?_forums_posts WHERE `posts_topics_id` = ? ORDER BY `posts_time` ASC;", $id);
$i = 0;
foreach($rows as $data) {
echo ++$i . '. <b>' . nickname($data['posts_user']) . '</b> (' . get_date($data['posts_time'], 'j.m.Y H:i') . ')<br />';
echo nl2br(bb_code($data['posts_text'])) . '<br /><br />';
}
echo <<<HTML
<hr>
<a href="javascript:history.go(-1)">Вернуться назад</a>
</td>
</tr>
</table>
</body>
</html>
HTML;
exit;
}
else {
$inSes->addMessage('Ошибка! Выбранная вами тема не существует, возможно она была удалена!');
gen_red('index', '', RND);
}
?>