diff options
author | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-07 11:44:11 -0600 |
---|---|---|
committer | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-07 11:44:11 -0600 |
commit | d61a18a93bc1b39d91725497ebb2fe85c4785ead (patch) | |
tree | 20403b00b2672c2183966989173d9dec2f4523dc /category.php | |
parent | 6dd221f59e4b8fd0c824ee9831b6efdbecb3aee7 (diff) |
Update links, rename files
Diffstat (limited to 'category.php')
-rw-r--r-- | category.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/category.php b/category.php deleted file mode 100644 index b149237..0000000 --- a/category.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -include_once 'includes/db_inc.php'; -include_once 'model/Category.php'; - -session_start(); - -$current = new Category(); - -if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) { - http_response_code(404); - include_once 'templates/404.php'; - die(); -} else { - $result = $current->get_from_database($_GET['id'], $dbc); - if ($result == 0) { - http_response_code(404); - include_once 'templates/404.php'; - die(); - } -} -?> -<!DOCTYPE html> -<html> -<head> - <title><?php echo $current->name; ?> - cflip.net forum</title> -</head> -<body> -<?php include_once 'templates/header.php';?> - <h1><?php echo $current->name; ?></h1> - <p><?php echo $current->description; ?></p> - <?php echo $current->thread_count . ' threads, ' . $current->post_count . ' posts'; ?> - <h2>Threads</h2> - <table width="100%"> - <tr> - <th>Thread Name</th> - <th>Latest Post</th> - </tr> - <?php - function cmp($a, $b) { - $da = strtotime($a->date_lastpost); - $db = strtotime($b->date_lastpost); - - if ($da == $db) return 0; - - return ($da > $db) ? -1 : 1; - } - - $threads = $current->get_threads($dbc); - usort($threads, "cmp"); - - foreach ($threads as $thread) { - $latest_post = $thread->get_latest_post($dbc); - - echo '<tr>'; - echo '<td><b><a href="../thread/' . $thread->id . '">' . $thread->subject . '</a></b><br>'; - echo '<small>by <b><a href="../user/' . $thread->author->name . '">' . $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="../user/' . $latest_post->author->name . '">' . $latest_post->author->name . '</a></b><br><small>on ' . $latest_post->date . '</small></td>'; - } else { - echo '<td>No posts yet!</td>'; - } - - echo '</tr>'; - } - ?> - </table> -</body> -</html>
\ No newline at end of file |