summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCflip <36554078+cflip@users.noreply.github.com>2021-01-25 20:44:13 -0700
committerCflip <36554078+cflip@users.noreply.github.com>2021-01-25 20:44:13 -0700
commit7ebd3e341eca0eb01c1a93e6f3f2007218c0d8cc (patch)
tree441ba1f8b567eec054a32f203f5b85a50349dad7
parent3598ab4ca42d1caf759ba74dbafa175fb63b05d9 (diff)
Add page to show all posts
-rw-r--r--all.php28
-rw-r--r--index.php22
-rw-r--r--styles/style.css10
3 files changed, 50 insertions, 10 deletions
diff --git a/all.php b/all.php
new file mode 100644
index 0000000..2588a38
--- /dev/null
+++ b/all.php
@@ -0,0 +1,28 @@
+<?php include_once 'header.php';?>
+
+<table>
+<tr>
+ <th class="left">Latest Threads</th>
+ <th class="right">Latest Post</th>
+</tr>
+
+<?php
+
+include_once 'includes/db_inc.php';
+include_once 'includes/functions_inc.php';
+
+$sql = "SELECT thread_id, thread_subject, thread_date, user_id, user_name, cat_id, cat_name FROM threads JOIN users ON thread_author = user_id JOIN categories ON thread_cat = cat_id ORDER BY thread_id DESC";
+$result = mysqli_query($dbc, $sql);
+
+if (!$result) {
+ die('Error trying to display threads: ' . mysqli_error($dbc));
+}
+
+display_threads($dbc, $result, true);
+mysqli_free_result($result);
+
+?>
+
+</table>
+
+<?php include_once 'footer.php';?> \ No newline at end of file
diff --git a/index.php b/index.php
index 3672dbe..a3d6fce 100644
--- a/index.php
+++ b/index.php
@@ -53,12 +53,14 @@ include_once 'header.php';
mysqli_stmt_close($stmt);
mysqli_free_result($result);
?>
- </table>
- <table>
- <tr>
- <th class="left">Latest Threads</th>
- <th class="right">Latest Post</th>
- </tr>
+
+</table>
+<table>
+ <tr>
+ <th class="left">Latest Threads <a href="all.php">View All</a></th>
+ <th class="right">Latest Post</th>
+ </tr>
+
<?php
include_once 'includes/db_inc.php';
include_once 'includes/functions_inc.php';
@@ -73,7 +75,7 @@ include_once 'header.php';
display_threads($dbc, $result, true);
mysqli_free_result($result);
?>
- </table>
-<?php
-include_once 'footer.php';
-?>
+
+</table>
+
+<?php include_once 'footer.php';?> \ No newline at end of file
diff --git a/styles/style.css b/styles/style.css
index 29ed200..8177684 100644
--- a/styles/style.css
+++ b/styles/style.css
@@ -55,6 +55,16 @@ a:hover {
text-decoration: none;
}
+th a {
+ color: white;
+ font-style: italic;
+}
+
+th a:hover {
+ color:#ddd;
+ text-decoration: none;
+}
+
#title {
color: #eee;
margin: 20px;