summaryrefslogtreecommitdiff
path: root/viewcategory.php
diff options
context:
space:
mode:
Diffstat (limited to 'viewcategory.php')
-rw-r--r--viewcategory.php71
1 files changed, 35 insertions, 36 deletions
diff --git a/viewcategory.php b/viewcategory.php
index e68bab2..e9927f9 100644
--- a/viewcategory.php
+++ b/viewcategory.php
@@ -18,40 +18,39 @@ if (!$current->has_value()) {
?>
<!DOCTYPE html>
<html lang="en">
-<head>
- <title><?= $current->name; ?> - cflip.net forum</title>
- <link rel="stylesheet" href="styles/style.css">
-</head>
-<body>
-<?php include('includes/templates/header.php'); ?>
-<h1><?= $current->name; ?></h1>
-<p><?= $current->description; ?></p>
-<span class="info"><?= $current->thread_count . ' threads, ' . $current->post_count . ' posts'; ?></span>
-<h2>Threads</h2>
-<table>
- <tr>
- <th>Thread Name</th>
- <th>Latest Post</th>
- </tr>
- <?php
- $threads = $current->get_threads();
-
- foreach ($threads as $thread) {
- $latest_post = $thread->get_latest_post();
-
- echo '<tr>';
- echo '<td><b><a href="viewthread.php?id=' . $thread->id . '">' . $thread->subject . '</a></b>';
- echo '<small> by <b><a href="viewuser.php?id=' . $thread->author->id . '">' . $thread->author->name . '</a></b> on ' . date('M d, Y', strtotime($thread->date_created)) . '</small></td>';
-
- if (!is_null($latest_post)) {
- echo '<td>by <b><a href="viewuser.php?id=' . $latest_post->author->id . '">' . $latest_post->author->name . '</a></b><small> on ' . $latest_post->date_created . '</small></td>';
- } else {
- echo '<td>No posts yet!</td>';
- }
-
- echo '</tr>';
- }
- ?>
-</table>
-</body>
+ <head>
+ <title><?= $current->name; ?> - 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'; ?>
+ <h1><?= $current->name; ?></h1>
+ <p><?= $current->description; ?></p>
+ <span class="info"><?= $current->thread_count . ' threads, ' . $current->post_count . ' posts'; ?></span>
+ <h2>Threads</h2>
+ <table>
+ <tr>
+ <th>Thread</th>
+ <th>Author</th>
+ <th>Date</th>
+ <th>Latest Post</th>
+ </tr>
+<?php foreach ($current->get_threads() as $thread): ?>
+ <tr>
+ <td>
+ <b><a href="viewthread.php?id=<?= $thread->id ?>"><?= $thread->subject ?></a></b>
+ </td>
+ <td><?= $thread->author->name ?></td>
+ <td><?= $thread->date_created ?></td>
+<?php $latest_post = $thread->get_latest_post(); if ($latest_post->has_value()): ?>
+ <td>by <b><a href="viewuser.php?id=<?= $latest_post->author->id ?>"><?= $latest_post->author->name ?></a></b><small> on <?= $latest_post->date_created ?></small></td>
+<?php else: ?>
+ <td>No posts yet!</td>
+<?php endif ?>
+ </tr>
+<?php endforeach ?>
+ </table>
+ </body>
</html>