summaryrefslogtreecommitdiff
path: root/index.php
blob: ec81d0a2c62be08744b2d784a6a91428400817ba (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
<?php include_once 'header.php';?>
<section>
	<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>
</section>
<table>
	<tr>
		<th class="left">Category</th>
		<th class="right">Latest Thread</th>
	</tr>
<?php
	include_once 'includes/db_inc.php';
	include_once 'includes/functions_display.php';

	$sql = "SELECT cat_id, cat_name, cat_description FROM categories";
	$result = mysqli_query($dbc, $sql);

	if (!$result) {
		die('Failure trying to display categories: ' . mysqli_error($dbc));
	}

	display_categories($dbc, $result);
?>
</table>
<table>
	<tr>
		<th class="left">Latest Threads <a href="all.php">View All</a></th>
		<th class="right">Latest Post</th>
	</tr>
<?php
	include_once 'includes/db_inc.php';
	include_once 'includes/functions_display.php';

	$sql = "SELECT thread_id, thread_subject, thread_date, user_id, user_name, cat_id, cat_name FROM threads JOIN users ON thread_author = user_id JOIN categories ON thread_cat = cat_id ORDER BY thread_id DESC LIMIT 5";
	$result = mysqli_query($dbc, $sql);

	if (!$result) {
		die('Error trying to display threads: ' . mysqli_error($dbc));
	}

	display_threads($dbc, $result, true);
	mysqli_free_result($result);
?>
</table>
<?php include_once 'footer.php';?>