-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·95 lines (80 loc) · 2.53 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
session_start();
spl_autoload_register(function ($class) {
include 'classes/' . $class . '.class.php';
});
$db = new DB(DB::host, DB::username, DB::passwd, DB::db);
$html = new Html;
$helper = new Helper;
if (!isset($_GET['article_id'])) {
$article_id = 7;
} else {
$article_id =intval($_GET['article_id']);
}
$article_info = $db->getArticle($article_id);
if ($article_info === false) {
$article_info = array();
$article_info[0]['title'] = 'Такой статьи не существует!';
$article_info[0]['meta_title'] = 'Нет статьи!';
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $article_info[0]['meta_title']; ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<?php echo $article_info[0]['meta_description']; ?>">
<link rel="stylesheet" type="text/css" href="/css/styles.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-38988257-12', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<!-- Headline -->
<div id="headline">
<div class="container">
<span class="logo"><a href="http://try2seo.com">try2seo.com</a></span>
<span class="slogan">Поисковая оптимизация сайтов.</span>
</div>
</div>
<!-- Table of contents -->
<div class="container">
<div id="table-of-contents">
<h3>Оглавление</h3>
<?php $html->showArticles($db->getArticlesList()); ?>
</div>
<!-- Article -->
<div id="article">
<h1><?php echo $article_info[0]['title']; ?></h1>
<?php if (!isset($article_info[0]['summary'])) : ?>
<!-- No Summary -->
<?php else : ?>
<div id="table-of-article-contents">
<h3>В этой статье:</h3>
<?php echo $article_info[0]['summary']; ?>
</div>
<?php endif; ?>
<?php if (!isset($article_info[0]['content'])) : ?>
<!-- No content -->
<?php else : ?>
<?php echo $article_info[0]['content']; ?>
<?php endif; ?>
</div>
</div>
<!-- Social buttons -->
<div id="social-bottons">
</div>
<!-- Footer -->
<div id="footer">
<div class="container">
<p>try2seo.com | 2014</p>
</div>
</div>
</body>
</html>