summaryrefslogtreecommitdiff
path: root/index.php
blob: 900918bf09855dd73d8efc7380f0c567c217cad7 (plain)
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 session_start()?>
<!DOCTYPE html>
<html>
<head>
	<title>cflip.net forum</title>
</head>
<body style="width: 720px;margin: auto;">
	<?php include_once 'templates/header.php'; ?>
	<h2>Welcome to the cflip.net forum!</h2>
	<p>
		This is the beta test of the forum website, so there are lots of features missing. Since there are no moderation features built into the website,
		<i>for the most part</i> I don't care that much about what is posted here. Some links and buttons may not have any functionality either!
	</p>
	<p>
		If you notice a problem or have an idea for a feature that is missing, <a href="http://51.195.90.7/forum/thread.php?id=40">reply to this thread!</a>
	</p>
	<h2>Categories</h2>
	<table>
	<tr>
		<th>Category</th>
		<th>Threads</th>
		<th>Posts</th>
		<th>Latest Thread</th>
	</tr>
	<?php
		include_once 'includes/db_inc.php';

		$sql = "SELECT * FROM categories";
		$result = mysqli_query($dbc, $sql);
		
		if (!$result) {
			die('Error trying to display posts: ' . mysqli_error($dbc));
		}

		if (mysqli_num_rows($result) == 0) {
			echo 'No categories found!';
		} else {
			while ($row = mysqli_fetch_assoc($result)) {
				echo '	<tr>
		<td>	
			<b><a href="category/' . $row['cat_id'] . '">' . $row['cat_name'] . '</a></b>
			<br>
			' . $row['cat_description']  . '
		</td>
		<td>' . $row['cat_thread_count'] . '</td>
		<td>' . $row['cat_post_count'] . '</td>
		<td><b>my supercool thread</b><br><small>by <b>cflip</b>, 3 days ago</small></td>			
	</tr>
';
			}
		}
	?>
	</table>
	<h2>More from the forum</h2>
	<table width="100%">
		<tr>
			<th>Recent Posts</th>
			<th>Recent Threads</th>
			<th>Popular Threads</th>
		</tr>
		<tr>
			<td>test<br>test<br>test<br>test<br></td>
			<td>test<br>test<br>test<br>test<br></td>
			<td>test<br>test<br>test<br>test<br></td>
		</tr>
	</table>
</body>
</html>