From 2ae22c4a438dc3c1822b8d909a4b38a211427bee Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 5 Jun 2021 11:57:12 -0600 Subject: Use different syntax for conditions in HTML --- includes/templates/404.php | 20 +++++---- index.php | 104 ++++++++++++++++++++++----------------------- signin.php | 30 ++++++------- viewcategory.php | 71 +++++++++++++++---------------- viewthread.php | 69 +++++++++++++----------------- 5 files changed, 142 insertions(+), 152 deletions(-) diff --git a/includes/templates/404.php b/includes/templates/404.php index d4d5128..74db2d6 100644 --- a/includes/templates/404.php +++ b/includes/templates/404.php @@ -1,12 +1,14 @@ - - cflip.net forum - - - - -

Page Not Found

-

The page you requested does not exist.

- + + cflip.net forum + + + + + + +

Page Not Found

+

The page you requested does not exist.

+ diff --git a/index.php b/index.php index dadef39..ac2dd3e 100644 --- a/index.php +++ b/index.php @@ -1,55 +1,55 @@ - + - - cflip.net forum - - - - -

Welcome to the cflip.net forum!

-

- 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, - for the most part I don't care that much about what is posted here. Some links and buttons may not have any - functionality either! -

-

- If you notice a problem or have an idea for a feature that is missing, reply to this thread! -

-

Categories

- - - - - - - - get_latest_thread(); - - echo ''; - echo ''; - echo ''; - echo ''; - if ($latest_thread->has_value()) { - echo ''; - } else { - echo ''; - } - echo ''; - } - ?> -
CategoryThreadsPostsLatest Thread
'; - echo '' . $category->name . ''; - echo '
' . $category->description . ''; - echo '
' . $category->thread_count . '' . $category->post_count . '' . $latest_thread->subject . '
'; - echo 'by ' . $latest_thread->author->name . ', ' . $latest_thread->date_created . '
No threads yet!
- + + cflip.net forum + + + + + + +

Welcome to the cflip.net forum!

+

+ 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, + for the most part I don't care that much about what is posted here. Some links and buttons may not have any + functionality either! +

+

+ If you notice a problem or have an idea for a feature that is missing, reply to this thread! +

+

Categories

+ + + + + + + + + + + + +get_latest_thread(); if ($latest_thread->has_value()): ?> + + + + + + +
CategoryThreadsPostsLatest Thread
+ name ?> +
description ?> +
thread_count ?>post_count ?> + subject ?> +
+ by author->name ?>, date_created ?> +
No threads yet!
+ diff --git a/signin.php b/signin.php index 0eb492d..ef60750 100644 --- a/signin.php +++ b/signin.php @@ -1,20 +1,20 @@ - - Sign in - cflip.net forum - - - + + Sign in - cflip.net forum + + + -

Sign in

-
" method="post"> -
-
-
-
- -
+

Sign in

+
" method="post"> +
+
+
+
+ +
password)) { echo 'Password does not match!'; } else { - Session::get()->sign_in($user); + Session::get()->sign_in($user); header("Location: index.php"); } } } } ?> - + 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()) { ?> - - <?= $current->name; ?> - cflip.net forum - - - - -

name; ?>

-

description; ?>

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

Threads

- - - - - - get_threads(); - - foreach ($threads as $thread) { - $latest_post = $thread->get_latest_post(); - - echo ''; - echo ''; - - if (!is_null($latest_post)) { - echo ''; - } else { - echo ''; - } - - echo ''; - } - ?> -
Thread NameLatest Post
' . $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!
- + + <?= $current->name; ?> - cflip.net forum + + + + + + +

name; ?>

+

description; ?>

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

Threads

+ + + + + + + +get_threads() as $thread): ?> + + + + +get_latest_post(); if ($latest_post->has_value()): ?> + + + + + + +
ThreadAuthorDateLatest Post
+ subject ?> + author->name ?>date_created ?>by author->name ?> on date_created ?>No posts yet!
+ diff --git a/viewthread.php b/viewthread.php index 12b9429..eb1698d 100644 --- a/viewthread.php +++ b/viewthread.php @@ -1,5 +1,7 @@ has_value()) { ?> - - <?= $current->subject; ?> - cflip.net forum - - - - -

subject; ?>

-created by author->name; ?> -in category->name; ?> -3 days ago -is_signed_in()) { - $user = Session::get()->get_current_user(); - - if ($user->level == USER_LEVEL_MODERATOR) { - echo ' + + <?= $current->subject; ?> - cflip.net forum + + + + + + +

subject; ?>

+ created by author->name; ?> + in category->name; ?>, date_created)); ?> +is_signed_in() and Session::get()->get_current_user()->level == USER_LEVEL_MODERATOR): ?>

Moderator Options - + @@ -49,22 +45,15 @@ if (Session::get()->is_signed_in()) {

- '; - } -} -?> -
-get_posts(); - -foreach ($posts as $post) { + +
+get_posts() as $post) { echo $post->get_content(); -} +} ?> -
-

Reply to this thread

+
+

Reply to this thread

-
- -
- -
- +
+ +
+ +
+ -- cgit v1.2.3