Файл: CMS/core/modules/journal_print.php
Строк: 123
<?php
if (!defined('CMS')) { die('Access Denied!'); }
if (!empty($id)) {
$row = $db->selectRow("SELECT * FROM ?_journal_posts
WHERE `journal_id` = ? AND `journal_moders` = '0' LIMIT 1;", $id);
if (!empty($row)) {
$cid = intval($row['journal_cats_id']);
list($title, $about, $count) = $categories[$cid];
$cat = '<a href="' . $config['site_url'] . '/journal/' . gen_uri('category', $cid, RND) . '">' . $title . '</a>';
$url = '<a href="' . $config['site_url'] . '/journal/' . gen_uri('post', $id, RND) . '">' . $row['journal_title'] . '</a>';
$journal = '<a href="' . $config['site_url'] . '/journal/' . gen_uri('index', '', RND) . '">Журнал</a>';
$date = date('d.m.Y в H:i', $row['journal_time']);
$row['text'] = nl2br(smiles(bb_code($row['journal_text'])));
$author = users_anketa($row['journal_user']);
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_name']} > Версия для печати > {$row['journal_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']}">{$config['site_name']}</a> > {$journal} > {$cat} > {$url}
<hr><h1>{$row['journal_title']}</h1><br />
<small>{$date}. Автор: {$author}</small></td>
</tr>
<tr>
<td width="100%">
{$row['text']}<br /><br />
<hr>
<a href="javascript:history.go(-1)">Вернуться назад</a>
</td>
</tr>
</table>
</body>
</html>
HTML;
exit;
}
else {
$inSes->addMessage('Ошибка! Публикация не найдена или временно недоступна!');
gen_red('index', '', RND);
}
}
else {
$onpage = !empty($config['print_num']) ? (int) $config['print_num'] : 25;
$rows = $db->select("SELECT * FROM ?_journal_posts
WHERE `journal_moders` = '0'
ORDER BY `journal_time` DESC
LIMIT ?d, ?d", 0, $onpage );
if (!empty($rows)) {
header('Content-type:text/html; charset=utf-8');
$date = date('d.m.Y в H:i', time());
$new = '<a href="' . $config['site_url'] . '/journal/' . gen_uri('new', '', RND) . '">Новые статьи</a>';
$journal = '<a href="' . $config['site_url'] . '/journal/' . gen_uri('index', '', RND) . '">Журнал</a>';
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_name']} > Версия для печати > Новые публикации</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']}">{$config['site_name']}</a> > {$journal} > {$new}
<hr><h1> Новые публикации - {$config['site_name']}</h1>
<small>{$date}</small></td>
</tr>
<tr>
<td width="100%">
HTML;
$i = 0;
foreach($rows as $row) {
echo ++$i . '. <a href="' . $config['site_url'] . '/journal/' . gen_uri('post', $row['journal_id']) . '"><b>' . $row['journal_title'] . '</b></a> (' . date('d.m.Y в H:i', $row['journal_time']) . ')<br />';
echo nl2br(bb_code($row['journal_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);
}
}
?>