-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathblog.php
56 lines (52 loc) · 1.66 KB
/
blog.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
<?php
require 'lib/site.inc.php';
$view = new ProximityRacing\GeneralView();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo $view->presentHeader("Blog | Proximity Racing"); ?>
</head>
<body>
<?php echo $view->presentNavbar(); ?>
<?php
$id = $_GET['id'];
include_once('../config/db_conn.php');
$sql = "SELECT * FROM proximityracing.blogs WHERE id = $id ORDER BY id DESC";
$res = mysqli_query($con, $sql);
if (mysqli_num_rows($res) > 0) {
while ($row = mysqli_fetch_assoc($res)) {
$title = $row['title'];
$content = $row['content'];
$date = $row['date'];
$blogger = $row['blogger'];
$status = $row['status'];
$readtime = $row['readtime'];
$mainpic = $row['mainpic'];
$label = $row['label'];
$admin = "";
}
}
?>
<header class="masthead" style="
background-image: url(<?php echo './blogpics/blogpics' . $id . '/' . $mainpic ?>);
width: auto;
height: auto;">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="post-heading">
<h1 style="color: white"><?php echo $title; ?></h1>
<h2 class="subheading ignite"><?php echo $label; ?></h2>
<span class="meta" style="color: white">Posted by <?php echo $blogger; ?>
on <?php echo $date; ?></span>
</div>
</div>
</div>
</div>
</header>
<?php echo iconv("UTF-8", "ISO-8859-1//IGNORE", $content), PHP_EOL; ?>
<?php echo $view->footer(); ?>
</body>
</html>