function getRead($id = null) { $row = Blog::getRowBlog($id); if ($row) { $this->data['row'] = $row; $this->data['id'] = $row->blogID; $this->data['alias'] = $row->slug; $this->data['blogcategories'] = Blog::summaryCategory(); $this->data['clouds'] = Blog::clouds(); $this->data['recent'] = Blog::recentPosts(); $this->data['comments'] = Blog::getComments($row->blogID); $this->layout = View::make("layouts." . CNF_THEME . ".index"); $this->layout->nest('content', 'blog.view', $this->data)->with('page', $this->data); } else { return Redirect::to('blog')->with('message', SiteHelpers::alert('error', ' Article not found !')); } }
require "blocks/autoload.php"; require "blocks/db.php"; require "blocks/user.php"; if (isset($_GET['id'])) { $id = $_GET['id']; } //Устанавливаем cookie для того, чтобы просмотры засчитывались только 1 раз от юзера setcookie("viewCookie[" . $id . "]", "view" . $id . "", mktime(0, 0, 0, 1, 1, date("Y") + 1)); $blog = new Blog($id); $blog->db = $db; if (!isset($_COOKIE['viewCookie'][$id])) { $blog->addView("news"); } try { $blog->getSelectedData(); $blog->getComments(); } catch (DataException $e) { die(require "blocks/errorTemplate.php"); } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="shortcut icon" href="img/favicon.ico"> <link rel="stylesheet" type="text/css" href="css/reset.css"> <link rel="stylesheet" type="text/css" href="css/style.css"> <? require("blocks/scripts.php"); ?> <title>Официальный сайт клана Пламя - <? print($blog->title); ?></title> </head> <body>
?> </p> <?php ?> <div class="boxbottom"><div class="author"></div><div class="links"></div></div> </div> <?php if ($showComments) { ?> <div id="comments"> <h3><?php echo $words->get('CommentsTitle'); ?> </h3> <?php $comments = $Blog->getComments($blog->blog_id); if (!$comments) { echo '<p>' . $words->get('CommentsAdd') . '</p>'; } else { $count = 0; $lastHandle = ''; foreach ($comments as $comment) { require 'comment.php'; ++$count; $lastHandle = $comment->user_handle; } } if ($member) { ?> <form method="post" action="" class="def-form" id="blog-comment-form"> <div class="row">