From 5032ee6dde5b33846570d9ea7af6b508755c708b Mon Sep 17 00:00:00 2001
From: h5p9sl <21267024+h5p9sl@users.noreply.github.com>
Date: Sun, 24 Jan 2021 09:12:33 -0700
Subject: add 'empty category' message
---
index.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
(limited to 'index.php')
diff --git a/index.php b/index.php
index 01acd33..2a1c633 100644
--- a/index.php
+++ b/index.php
@@ -41,8 +41,13 @@ include_once 'header.php';
echo '
';
echo '';
echo $row['cat_description'];
- echo ' | ' . $thread['thread_subject'] . ' ';
- echo 'by ' . $thread['user_name'] . ' |
';
+ if ($thread) {
+ echo '' . $thread['thread_subject'] . ' ';
+ echo 'by ' . $thread['user_name'] . ' | ';
+ } else {
+ $no_threads_msg = 'There are no threads in this category yet.';
+ echo ''. $no_threads_msg .' | ';
+ }
}
mysqli_stmt_close($stmt);
@@ -75,4 +80,4 @@ include_once 'header.php';
\ No newline at end of file
+?>
--
cgit v1.2.3