-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadhotsort.php
74 lines (64 loc) · 4.92 KB
/
loadhotsort.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
<?php
include "connection.php";
$sql = "select title, post_count, report_count, thread_id,up_votes,down_votes,category from thread where status=0 ORDER BY post_count DESC LIMIT 4";
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) > 0) {
while ($rows = mysqli_fetch_assoc($result)) {
$sql1 = 'SELECT subject FROM category WHERE cat_id = ' . $rows["category"] . ';';
$result1 = mysqli_query($con, $sql1);
$rows1 = mysqli_fetch_assoc($result1);
echo '<div class="card bg-light mt-2"
style=" box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); border:none;">
<div class="card-header pb-0 px-1">
<h3 class="text-capitalize" style=" font-size:2.5vw"><a href="thread.php?title=' . $rows["title"] . '&id=' . $rows["thread_id"] . '" style="text-decoration: none;">' . $rows["title"] . '</a></h3>
</div>
<div class="card-body px-1 py-0" >
<span class = "text-danger ml-1" style = "font-style:italic;display:block;font-size:1.2vw">Category: ' . $rows1["subject"] . '</span>
</div>
<div class="card-footer bg-secondary" style="border:none;padding:0">
<p class="m-0">
<div class="d-flex justify-content-between py-1 px-1">
<div class="">
<i id = "thumbsup" class="fas fa-arrow-up fa-2x text-success" onclick="upvote('.$rows["thread_id"].'0);" style="font-size:2vw;"></i>
<h3 id="'.$rows["thread_id"].'0" class="text-white ml-1" style="display:inline;font-size:2vw;;margin-bottom:0;">'.$rows["up_votes"].'</h3>
<i id = "thumbsup" class="fas fas fa-arrow-down fa-2x text-danger ml-4" onclick="downvote('.$rows["thread_id"].'1);" style="font-size:2vw;"></i>
<h3 id="'.$rows["thread_id"].'1" class="text-white ml-1" style="display:inline;font-size:2vw;">' . $rows["down_votes"] . '</h3>
</div>
<div class="delete">
<i class="fas fa-times fa-2x text-danger" onclick="threaddlt('.$rows["thread_id"].')" style="font-size:2vw;"></i>
</div>
<div class="">
<i class="fa fa-list-ol fa-2x text-info" style="font-size:2vw;"></i>
<h3 class="text-white ml-1 " style="display:inline;font-size:2vw;">' . $rows["post_count"] . '</h3>
</div>
</div>
</p>
</div>
</div>';
}
} else {
echo "<p>THERE ARE NO THREADS !</p>";
}
/* <div class="card bg-light"
style=" box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); border:none; ">
<div class="card-body">
<h3><a href="#" style="text-decoration: none;font-size:3.5vw;">THREAD 1</a></h3>
</div>
<div class="card-footer bg-secondary py-0 px-2" style="border:none;">
<div class="d-flex justify-content-between">
<div class="">
<i class="fa fa-eye" style="font-size: 3vw"></i>
<h3 class="text-white ml-0" style="display:inline;font-size:3vw">100</h3>
</div>
<div class="">
<i class="fas fa-exclamation-triangle ml-2 text-warning" style="font-size: 3vw"></i>
<h3 class="text-white ml-0" style="display:inline;font-size:3vw">10</h3>
</div>
<div class="">
<i class="fa fa-list-ol ml-2 text-info" style="font-size: 3vw"></i>
<h3 class="text-white ml-0 " style="display:inline;font-size:3vw">10</h3>
</div>
</div>
</div>
</div>*/
?>