-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
85 lines (82 loc) · 4.14 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>iDiscuss-Forum</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous">
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<?php include 'partials/dbconnect.php';?>
<?php include 'partials/header.php';?>
<!-- Slider Start Here -->
<div id="carouselExampleIndicators" class="carousel slide">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active"
aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1"
aria-label="Slide 2"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2"
aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://source.unsplash.com/random/2400x700?coding,python" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/random/2400x700?coding,django" class="d-block w-100" alt="...">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/random/2400x700?coding,javascript" class="d-block w-100"
alt="...">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators"
data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators"
data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<!-- Category Container Start Here -->
<div class="container my-3">
<h1 class="text-center my-3">iDiscuss-Browse Categories</h1>
<div class="row">
<?php
$sql="SELECT * FROM `categories`";
$result=mysqli_query($connect,$sql);
$rows=mysqli_num_rows($result);
if($rows>0){
while($data=mysqli_fetch_assoc($result)){
$id=$data['Category_id'];
$cat=$data['Category_name'];
$desc=$data['Category_description'];
echo '<div class="col-md-4 my-2">
<div class="card" style="width: 18rem;">
<img src="https://source.unsplash.com/random/500x300?'.$cat.',coding" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title"><a href="threadlist.php?catid='.$id.'">'.$cat.'</a></h5>
<p class="card-text">'.substr($desc,0,80).'...</p>
<a href="threadlist.php?catid='.$id.'" class="btn btn-primary">Explore More</a>
</div>
</div>
</div>';
}
}
?>
</div>
</div>
<?php include 'partials/footer.php';?>
</body>
</html>