This repository has been archived by the owner on Jan 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
article.php
125 lines (116 loc) · 4.07 KB
/
article.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
//Check if config is ok. If not redirect to installation
include 'check.php';
require("Db.class.php");
// Retrieve single article from DB
if (isset($_GET['id'])) {
$db = new Db();
$id = $_GET['id'];
$query = sprintf('select * from `data` where id = %d', $id);
$results = $db->query($query);
} else {
header('Location: index.php');
exit();
}
foreach ($results as $row) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>AnuKu - Content Management Simplicity</title>
<!-- Bootstrap core CSS -->
<link href="template/bootstrap/css/bootstrap.css" rel="stylesheet">
<!-- Custom CSS for Anuku -->
<link href="template/bootstrap/css/stickyfooter.css" rel="stylesheet">
<link href="template/style.css" rel="stylesheet">
<link href="template/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- JS beauties go here -->
<script src="template/bootstrap/js/jquery-1.9.1.min.js"></script>
<script src="template/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<!-- Wrap all page content here -->
<div id="wrap">
<!-- top navigation -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a>
<div class="nav-collapse collapse" id="main-menu">
<ul class="nav" id="main-menu-left">
<li>
<!-- add new post button -->
<a href="admin/post-add.php">
<button type="submit" class="btn btn-success button-nav">
Add new post <i class="icon-plus-sign"></i>
</button>
</a>
</li>
</ul>
<!-- right navigation menu -->
<ul class="nav pull-right" id="main-menu-right">
<?php
if (isset($_SESSION['logged_in'])) { ?>
<li>
<a href="#">Welcome <?php echo strtoupper($_SESSION['user']); ?> ! <i class="icon-user"></i></a>
</li>
<?php } ?>
<li>
<a rel="tooltip" href="admin/" title="Login to Admin Console">ADMIN <i class="icon-lock"></i></a>
</li>
<?php
if (isset($_SESSION['logged_in'])) { ?>
<li>
<a rel="tooltip" href="admin/home.php?logout=true" title="Logout">LOGOUT <i class="icon-off"></i></a>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
<!-- Homepage title -->
<div class="container">
<div class="span4 offset4">
<div class="page-header text-center">
<h1><a href="./">Anuku</a></h1>
<p class="lead">
Content Management Simplicity
</p>
</div>
</div>
<div class="row">
<!-- display the title -->
<div class="span8 offset2">
<div class="articlecontent">
<h2><?php echo "{$row['name']}"; ?></h2>
<?php $postdate = strtotime($row['time']); ?>
<!-- display posted time -->
<span class="label label-inverse">
- posted on <?php echo date('jS F Y, h:i A', $postdate); ?>
</span>
<p><?php echo "{$row['content']}"; ?></p>
<br />
<ul class="pager"><li class="previous"><a href="./"><i class="icon-arrow-left"></i> Back to home</a></li</ul>
</div>
</div>
</div>
</div>
</div>
<!-- footer -->
<div id="footer">
<div class="container text-center">
<p class="text-muted credit">
Anuku | Fork our code at <a href="https://github.com/eanurag/anuku">GitHub</a> | Made with Love & Simplicity
</p>
</div>
</div>
</body>
</html>
<?php
}
?>