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
---
includes/templates/header.php | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 includes/templates/header.php
(limited to 'includes/templates/header.php')
diff --git a/includes/templates/header.php b/includes/templates/header.php
new file mode 100644
index 0000000..4eb17e3
--- /dev/null
+++ b/includes/templates/header.php
@@ -0,0 +1,14 @@
+
cflip.net forumbeta
+[Home]
+[All Threads]
+[All Posts]
+[Create a thread]
+
+ ' . $_SESSION['user_name'] . '\'s Profile] [Log out]';
+ } else {
+ echo '[Sign in] or [Register an account]';
+ }
+ ?>
+
--
cgit v1.2.3
From 7c3f2e348c015ea93563d866f89ec8cea9159ea0 Mon Sep 17 00:00:00 2001
From: cflip <36554078+cflip@users.noreply.github.com>
Date: Sat, 24 Apr 2021 09:40:20 -0600
Subject: Refactoring part 2
Starting to move some functionality such as the session and database connection into singleton classes to manage them. Functions for modifying posts and threads are being put in one place as well.
---
includes/templates/header.php | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'includes/templates/header.php')
diff --git a/includes/templates/header.php b/includes/templates/header.php
index 4eb17e3..35d9848 100644
--- a/includes/templates/header.php
+++ b/includes/templates/header.php
@@ -5,8 +5,12 @@
[Create a thread]
' . $_SESSION['user_name'] . '\'s Profile] [Log out]';
+ include_once './includes/Session.php';
+ include_once './includes/model/User.php';
+
+ if (Session::get()->is_signed_in()) {
+ $user = Session::get()->get_current_user();
+ echo '[' . $user->name . '\'s Profile] [Log out]';
} else {
echo '[Sign in] or [Register an account]';
}
--
cgit v1.2.3
From 2d5cf9448edb1eb6785c1532ccb031b0ba0d1ef0 Mon Sep 17 00:00:00 2001
From: cflip <36554078+cflip@users.noreply.github.com>
Date: Sun, 25 Apr 2021 17:43:37 -0600
Subject: Remove old signout_inc.php file
---
includes/templates/header.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'includes/templates/header.php')
diff --git a/includes/templates/header.php b/includes/templates/header.php
index 35d9848..1db9cda 100644
--- a/includes/templates/header.php
+++ b/includes/templates/header.php
@@ -10,7 +10,7 @@
if (Session::get()->is_signed_in()) {
$user = Session::get()->get_current_user();
- echo '[' . $user->name . '\'s Profile] [Log out]';
+ echo '[' . $user->name . '\'s Profile] [Log out]';
} else {
echo '[Sign in] or [Register an account]';
}
--
cgit v1.2.3