-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
59 lines (55 loc) · 1.48 KB
/
index.php
File metadata and controls
59 lines (55 loc) · 1.48 KB
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
<?php require_once("includes/init.php"); ?>
<!DOCTYPE html>
<html>
<head>
<?php include("includes/standard_head.php"); ?>
<title>Forum</title>
</head>
<body>
<?php include("includes/navbar.php"); ?>
<!-- Content start -->
<div class="container">
<?php displayAlerts(); ?>
<?php
$categories = category::getAllCategories();
if(!empty($categories))
{
foreach ($categories as $category)
{
$forums = $category->getForums(3);
if(!empty($forums))
{
echo '<div class="row category">';
echo '<h3 class="category-title"><a href="category.php?id='.$category->id.'">'.$category->name.'</a></h3>';
foreach($forums as $forum)
{
if(!$currentUser->isLoggedIn() && !$forum->guestAccess)
continue;
echo '<a href="forum.php?id='.$forum->id.'">';
echo '<div class="col-lg-12 forum">';
echo '<div class="col-lg-10">';
echo '<h4 class="forum-title">'.htmlspecialchars($forum->name).'</h4>';
echo '<p class="forum-desc">'.htmlspecialchars($forum->description).'</p>';
echo '</div>';
echo '<div class="col-lg-1">';
echo '<p>Posts:<br> '.$forum->getNumberOfPosts().'</p>';
echo '</div>';
echo '<div class="col-lg-1">';
echo '<p>Views:<br>'. $forum->getNumberOfviews() .'</p>';
echo '</div>';
echo '</div>';
echo '</a>';
}
echo '</div>';
}
}
}
else
{
echo 'No categories? Something is wrong here.';
}
?>
</div>
<?php require_once("includes/standard_footer.php"); ?>
</body>
</html>