-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforum.php
More file actions
58 lines (56 loc) · 2.45 KB
/
Copy pathforum.php
File metadata and controls
58 lines (56 loc) · 2.45 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
<?php
$page = 'Forum';
include 'php/includes/head.php';
include 'php/scripts/forum.php';
include 'php/includes/navbar.php';
?>
<!-- body -->
<div class="container">
<div class="row">
<div class="col-12">
<div class="d-flex py-3 justify-content-between align-items-center">
<h2 class="my-0">Forum</h2>
<?php include './php/includes/forum_add.php'; ?>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-9">
<div class="box p-3 bg-primary text-white mb-3">
<h4>Topics</h4>
</div>
<div class="topics-list">
<?php
$topics = $db->query('SELECT * FROM forumtopics ORDER BY createdat DESC');
while($topic = $topics->fetch()) { ?>
<div class="box p-3 bg-white my-3 topic">
<div class="d-flex justify-content-between">
<h5><a href="topic.php?id=<?php echo $topic['id'] ?>"> <?php echo $topic['title'] ?></a></h5>
<p class="date-<?php echo $topic['id'] ?>"></p>
<script>
jQuery(document).ready(function(){
$('.date-<?php echo $topic['id'] ?>').text(moment("<?php echo $topic['createdat'] ?>").from());
})
</script>
</div>
<p class="mb-0">
<?php $counts = $db->prepare('SELECT COUNT(*) AS total FROM forummessages WHERE madeon = ?');
$counts->execute(array($topic['id']));
$count = $counts->fetch(); ?>
Messages: <b><?php echo $count['total'] ?>, </b>
Type: <b><?php echo $topic['status'] ?></b>
</p>
</div>
<?php } ?>
</div>
</div>
<div class="col-3">
<div class="box p-3 bg-white">
<?php include 'php/includes/rss.php'; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'php/includes/foot.php' ?>