summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php93
1 files changed, 55 insertions, 38 deletions
diff --git a/index.php b/index.php
index ec81d0a..900918b 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,11 @@
-<?php include_once 'header.php';?>
-<section>
+<?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,
@@ -8,44 +14,55 @@
<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>
+ <h2>Categories</h2>
+ <table>
<tr>
- <th class="left">Category</th>
- <th class="right">Latest Thread</th>
+ <th>Category</th>
+ <th>Threads</th>
+ <th>Posts</th>
+ <th>Latest Thread</th>
</tr>
-<?php
- include_once 'includes/db_inc.php';
- include_once 'includes/functions_display.php';
+ <?php
+ include_once 'includes/db_inc.php';
- $sql = "SELECT cat_id, cat_name, cat_description FROM categories";
- $result = mysqli_query($dbc, $sql);
+ $sql = "SELECT * FROM categories";
+ $result = mysqli_query($dbc, $sql);
+
+ if (!$result) {
+ die('Error trying to display posts: ' . mysqli_error($dbc));
+ }
- 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>
+ 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>
-<?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';?> \ No newline at end of file
+';
+ }
+ }
+ ?>
+ </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> \ No newline at end of file