forked from adeleyeayodeji/Simple-PHP-Blog-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
213 lines (196 loc) · 8.15 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php include 'include/header.php'; ?>
<div class="more">
<!-- Featured post begins here -->
<div class="featured">
<h2 class="h2">Featured Post</h2>
<?php
$query = mysqli_query($con, "SELECT * FROM post ORDER BY id DESC");
$row = mysqli_fetch_assoc($query);
?>
<a href="article/<?php echo $row['id']; ?>/<?php echo strtolower(str_replace(' ', '-', trim($row['title'])))."/"; ?>">
<!-- Featured post layer 1 -->
<div class="featured1" style="background-image: url('image/<?php echo $row['image']; ?>');">
<small class="small1"><?php echo $row["category"]; ?></small>
<div class="featuredtext">
<h2><?php echo $row['title']; ?></h2>
<p>
<?php echo substr($row['text'],0,170)."..."; ?>
</p>
</div>
</div>
</a>
<!-- Featured post layer 1 ends here -->
<!-- Featured post layer 2 -->
<div class="featured2">
<?php
$query = mysqli_query($con, "SELECT * FROM post WHERE id = 14 ORDER BY id DESC");
$row = mysqli_fetch_assoc($query);
?>
<!-- Featured post layer-inner 1 -->
<a href="article/<?php echo $row['id']; ?>/<?php echo strtolower(str_replace(' ', '-', trim($row['title'])))."/"; ?>">
<div class="inner two" style="background-image: url('image/<?php echo $row['image']; ?>');">
<small class="innersmall"><?php echo $row["category"]; ?></small>
<div class="featuredtext2">
<h2><?php echo $row['title']; ?></h2>
<p>
<?php echo substr($row['text'],0,100)."..."; ?>
</p>
</div>
</div>
</a>
<!-- Featured post layer-inner 1 ends here-->
<?php
$query = mysqli_query($con, "SELECT * FROM post WHERE id = 12 ORDER BY id DESC");
$row = mysqli_fetch_assoc($query);
?>
<!-- Featured post layer-inner 2 -->
<a href="article/<?php echo $row['id']; ?>/<?php echo strtolower(str_replace(' ', '-', trim($row['title'])))."/"; ?>">
<div class="inner2 t3" style="background-image: url('image/<?php echo $row['image']; ?>');">
<small class="small4"><?php echo $row["category"]; ?></small>
<div class="featuredtext3">
<h2 class="title"><?php echo $row['title']; ?></h2>
<p>
<?php echo substr($row['text'],0,100)."..."; ?>
</p>
</div>
</div>
</a>
<!-- Featured post layer-inner 2 ends here -->
</div>
</div>
<!-- Featured post ends here -->
<!-- Featured post seperator start here -->
<div class="clearfix">
<span>. . .</span>
</div>
<!-- Featured post seperator ends here -->
<div class="mainbody">
<!-- body post start here -->
<div class="body1">
<?php
$query = mysqli_query($con, "SELECT * FROM post ORDER BY id DESC LIMIT 3");
while ($row = mysqli_fetch_assoc($query)) {
?>
<div class="thumbnailh">
<!-- Post title start here -->
<h3 class="posttitle">
<?php echo $row['title']; ?>
</h3>
<!-- Post title ends here -->
<a href="article/<?php echo $row['id']; ?>/<?php echo strtolower(str_replace(' ', '-', trim($row['title'])))."/"; ?>">
<!-- Post thumbnail start here -->
<div class="postimage sidebarimage" style="background-image: url('image/<?php echo $row['image']; ?>');">
</div>
</a>
<!-- Post thumbnail ends here -->
<!-- Post date start here -->
<small class="belowpost">Date: <?php echo $row["date"]; ?></small>
<!-- Post date ends here -->
<!-- Post category start here -->
<small class="belowpost">Category: <?php echo $row["category"]; ?></small>
<!-- Post date ends here -->
<!-- Post contents start here -->
<p>
<?php echo substr($row['text'],0,200)."..."; ?>
</p>
<!-- Post contents ends here -->
<!-- Post read more start here -->
<p>
<a class="link" href="article/<?php echo $row['id']; ?>/<?php echo strtolower(str_replace(' ', '-', trim($row['title'])))."/"; ?>">Read More</a>
</p>
<!-- Post read more ends here -->
<hr>
</div>
<?php
}
?>
</div>
<!-- body post ends here -->
<!-- Sidebar Started here -->
<div class="body2">
<!-- Sidebar Search begin here -->
<div class="sidebar1">
<h3 class="sidebartitle">
Search Post:
</h3>
<p>
<form action="" method="post">
<input class="search" type="text" placeholder="Enter full title to search" onkeyup="showHint(this.value)">
<div id="txtHint" class="searchbox">
</div>
</form>
</p>
</div>
<!-- Sidebar Search ends here -->
<!-- Sidebar Recent Post start here -->
<div class="sidebar2">
<h3 class="sidebartitle">
Recent Post:
</h3>
<?php
$query = mysqli_query($con, "SELECT * FROM post ORDER BY id DESC LIMIT 3");
while ($row = mysqli_fetch_assoc($query)) {
?>
<a href="article/<?php echo $row['id']; ?>/<?php echo strtolower(str_replace(' ', '-', trim($row['title'])))."/"; ?>">
<div class="sidediv">
<div class="postdiv">
<div class="postimagee sidepic" style="background-image: url('image/<?php echo $row['image']; ?>');"></div>
</div>
<div class="sidediv2">
<h3 class="sidedivh3">
<?php echo $row['title']; ?>
</h3>
<small class="sidedivsmall">Date: <?php echo $row["date"]; ?></small>
<p class="sidedivp">
<?php echo substr($row['text'],0,60)."..."; ?>
<a class="sidediva" href="article/<?php echo $row['id']; ?>/<?php echo strtolower(str_replace(' ', '-', trim($row['title'])))."/"; ?>"></a>
</p>
</div>
</div>
</a>
<br><hr><br>
<?php
}
?>
</div>
<!-- Sidebar Recent Post ends here -->
<!-- Sidebar Post category start here -->
<div class="sidebar3">
<h3 class="sidebartitle">
Facebook
</h3>
<div style="padding-top: 5px;">
<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2Fbiggidroid%2F&tabs&width=440&height=214&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&appId=228190737761400" width="100%" height="224" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
</div>
</div>
<!-- Sidebar Post category ends here -->
<!-- Sidebar Recent Post start here -->
<div class="sidebar2">
<h3 class="sidebartitle" style="margin-top: 1px;">
Ads Space:
</h3>
<img class="ads" src="image/Google Ads Logo.png" width="98%" height="auto" style="margin: 0px;margin-top: 5px;">
</div>
<!-- Sidebar Recent Post ends here -->
<!-- Sidebar Post category start here -->
<div class="sidebar3">
<h3 class="sidebartitle" style="margin-bottom: 10px;">
Category:
</h3>
<?php
$query = mysqli_query($con, "SELECT * FROM post ORDER BY id ASC LIMIT 4");
while ($row = mysqli_fetch_assoc($query)) {
?>
<a class="catlink" href="category/<?php echo strtolower($row['category']); ?>">
<small style="border: 1px solid blueviolet;border-radius:3px;padding: 5px;color: blueviolet;margin: 2px;background: white;">
<?php echo $row["category"]; ?>
</small>
</a>
<?php } ?>
</div>
<!-- Sidebar Post category ends here -->
</div>
<!-- Sidebar ends here -->
</div>
</div>
<?php include 'include/footer.php'; ?>