diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 104 |
1 files changed, 52 insertions, 52 deletions
@@ -1,55 +1,55 @@ -<?php session_start() ?> +<?php +include_once './includes/model/Category.php'; +session_start(); +?> <!DOCTYPE html> <html lang="en"> -<head> - <title>cflip.net forum</title> - <link rel="stylesheet" href="styles/style.css"> -</head> -<body> -<?php include('includes/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/model/Category.php'; - - $categories = Category::get_all_categories(); - - foreach ($categories as $category) { - $latest_thread = $category->get_latest_thread(); - - echo '<tr>'; - echo '<td>'; - echo '<b><a href="viewcategory.php?id=' . $category->id . '">' . $category->name . '</a></b>'; - echo '<br><small>' . $category->description . '</small>'; - echo '</td>'; - echo '<td>' . $category->thread_count . '</td>'; - echo '<td>' . $category->post_count . '</td>'; - if ($latest_thread->has_value()) { - echo '<td><b><a href="viewthread.php?id=' . $latest_thread->id . '">' . $latest_thread->subject . '</a></b><br>'; - echo '<small>by <b><a href="viewuser.php?id=' . $latest_thread->author->id . '">' . $latest_thread->author->name . '</a></b>, ' . $latest_thread->date_created . '</small></td>'; - } else { - echo '<td>No threads yet!</td>'; - } - echo '</tr>'; - } - ?> -</table> -</body> + <head> + <title>cflip.net forum</title> + <link rel="stylesheet" href="styles/style.css"> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + </head> + <body> +<?php include_once 'includes/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 foreach (Category::get_all_categories() as $category): ?> + <tr> + <td> + <b><a href="viewcategory.php?id=<?= $category->id ?>"><?= $category->name ?></a></b> + <br><small><?= $category->description ?></small> + </td> + <td><?= $category->thread_count ?></td> + <td><?= $category->post_count ?></td> +<?php $latest_thread = $category->get_latest_thread(); if ($latest_thread->has_value()): ?> + <td> + <b><a href="viewthread.php?id=<?= $latest_thread->id ?>"><?= $latest_thread->subject ?></a></b> + <br> + <small>by <b><a href="viewuser.php?id=<?= $latest_thread->author->id ?>"><?= $latest_thread->author->name ?></a></b>, <?= $latest_thread->date_created ?></small> + </td> +<?php else: ?> + <td>No threads yet!</td> +<?php endif ?> + </tr> +<?php endforeach ?> + </table> + </body> </html> |