-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewpost-category-body.php
83 lines (39 loc) · 1.37 KB
/
viewpost-category-body.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
<?php
require 'connection.php';
mysqli_set_charset($con,'utf8');
$get_cat_id = $_GET['id'];
$sql = "SELECT * FROM blog_post JOIN users ON(users.user_id = blog_post.author_id) JOIN blog_categories ON(blog_categories.category_id = blog_post.category_id) WHERE blog_post.category_id = '$get_cat_id' AND approved";
$result = mysqli_query($con, $sql);
$display_header = 'true';
if (mysqli_num_rows($result) > 0);
while ($row = mysqli_fetch_assoc($result)){
extract($row);
$name = strtolower($name);
$name = ucfirst($name);
if($display_header == 'true'){
echo "
<div class='breadcrumb-container'>
<ol class='breadcrumb'>
<li><a href='/capstone2/'>Home</a></li>
<li class='active'>$name</li>
</ol>
</div>
<div class='page-category-header'>
";
echo " <div class='page-category-title clearfix'>
$name
</div>
<div class='page-category-desc'>
This is a category description. This is a category description. This is a category description. This is a category description.
</div>
";
$display_header = 'false';
$name = strtoupper($name);
} else {
$display_header = 'false';
$name = strtoupper($name);
}
require 'article-pages/display-categories.php';
} // end of while loop
?>
</div>