From 6c9369ad85f2fb3dc61234b54db7e7079cdc0c4e Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Fri, 23 Apr 2021 18:43:12 -0600 Subject: Refactoring part 1 --- viewcategory.php | 68 +++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 35 deletions(-) (limited to 'viewcategory.php') diff --git a/viewcategory.php b/viewcategory.php index e10797a..70733da 100644 --- a/viewcategory.php +++ b/viewcategory.php @@ -1,6 +1,6 @@ get_from_database($_GET['id'], $dbc); if ($result == 0) { http_response_code(404); - include_once 'templates/404.php'; + include('includes/templates/404.php'); die(); } } ?> - + - <?= $current->name; ?> - cflip.net forum - + <?= $current->name; ?> - cflip.net forum + - -

name; ?>

-

description; ?>

- - thread_count . ' threads, ' . $current->post_count . ' posts'; ?> - -

Threads

- - - - - - get_threads($dbc); + +

name; ?>

+

description; ?>

+thread_count . ' threads, ' . $current->post_count . ' posts'; ?> +

Threads

+
Thread NameLatest Post
+ + + + + get_threads($dbc); - foreach ($threads as $thread) { - $latest_post = $thread->get_latest_post($dbc); + foreach ($threads as $thread) { + $latest_post = $thread->get_latest_post($dbc); - echo ''; - echo ''; + echo ''; + echo ''; - if (!is_null($latest_post)) { - echo ''; - } else { - echo ''; - } - - echo ''; + if (!is_null($latest_post)) { + echo ''; + } else { + echo ''; } - ?> -
Thread NameLatest Post
' . $thread->subject . ''; - echo ' by ' . $thread->author->name . ' on ' . date('M d, Y', strtotime($thread->date_created)) . '
' . $thread->subject . ''; + echo ' by ' . $thread->author->name . ' on ' . date('M d, Y', strtotime($thread->date_created)) . 'by ' . $latest_post->author->name . ' on ' . $latest_post->date_created . 'No posts yet!
by ' . $latest_post->author->name . ' on ' . $latest_post->date_created . 'No posts yet!
+ + echo ''; + } + ?> + -- cgit v1.2.3