From 579ea26d06c7033a0ebcb23d893a9eda476d930f Mon Sep 17 00:00:00 2001 From: "Evan G." Date: Sat, 18 May 2024 17:56:10 -0500 Subject: [PATCH] Update submodule --- .gitmodules | 3 ++ static/guestbook | 1 + static/guestbook/guestbook.css | 21 ---------- static/guestbook/index.html | 48 --------------------- static/guestbook/index.xml | 18 -------- static/guestbook/submit.php | 76 ---------------------------------- 6 files changed, 4 insertions(+), 163 deletions(-) create mode 160000 static/guestbook delete mode 100644 static/guestbook/guestbook.css delete mode 100644 static/guestbook/index.html delete mode 100644 static/guestbook/index.xml delete mode 100644 static/guestbook/submit.php diff --git a/.gitmodules b/.gitmodules index 19c7c1c..616f9a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "themes/readable"] path = themes/readable url = https://git.fbievan.live/fbievan/hugo-theme-readable +[submodule "static/guestbook"] + path = static/guestbook + url = https://git.fbievan.live/fbievan/guestbook.git diff --git a/static/guestbook b/static/guestbook new file mode 160000 index 0000000..3c7bd7a --- /dev/null +++ b/static/guestbook @@ -0,0 +1 @@ +Subproject commit 3c7bd7aa909519d9b927a8053b135b5305a91de1 diff --git a/static/guestbook/guestbook.css b/static/guestbook/guestbook.css deleted file mode 100644 index 1562ea5..0000000 --- a/static/guestbook/guestbook.css +++ /dev/null @@ -1,21 +0,0 @@ -.guestbookpost { - padding: 10px; - border: var(--line-width) solid; - border-left-style: none; - border-right-style: none; - border-top-style: solid; - border-bottom-style: none; - text-align: left; - padding-bottom: 20px; - padding-top: 10px; - } -.date { - padding-top: 0px; - padding-bottom: 15px; -} -h4 { - margin-top: 0px; -} -p { - padding-left: 4px; -} diff --git a/static/guestbook/index.html b/static/guestbook/index.html deleted file mode 100644 index b205192..0000000 --- a/static/guestbook/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - My Cool Guestbook! - - - - - -
-

Guestbook

-

This is a guestbook, made by fbievan

-
- -
-
- - - -
- "; - foreach($data as $post) { - echo '
'; - echo "

"; - echo $post["name"] . "
"; - echo "

"; - echo '

'; - echo $post["date"] . "
"; - echo "

"; - echo "

"; - echo $post["message"] . "
"; - echo "

"; - echo "
"; - } - echo ""; - - ?> -
- - - diff --git a/static/guestbook/index.xml b/static/guestbook/index.xml deleted file mode 100644 index 9c671f7..0000000 --- a/static/guestbook/index.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Fbi's Epic Guestbook RSS Feed - https://www.w3schools.com - A cool Guestbook made by fbievan - - - - <?php echo $post["name"];?> - - - - - diff --git a/static/guestbook/submit.php b/static/guestbook/submit.php deleted file mode 100644 index b02516d..0000000 --- a/static/guestbook/submit.php +++ /dev/null @@ -1,76 +0,0 @@ -date = date("Y M d"); - } - function set_mlength() { - $this->mlength = strlen($this->message); - } - function set_nlength() { - $this->nlength = strlen($this->name); - } -} -$ndata = new data(); - - - - -$name = $ndata->name = htmlspecialchars($_POST["fname"]); -$message = $ndata->message = htmlspecialchars($_POST["fmessage"]); -$ndata->set_date(); -$ndata->set_mlength(); -$ndata->set_nlength(); -$mlength = $ndata->mlength; -$nlength = $ndata->nlength; - -# Setup JSON - -$newURL = "https://" . $_SERVER['SERVER_NAME'] . "/guestbook/index.html"; - -# Check name and message -if ($name == "") { - header('Refresh:2; url=' . $newURL ); - echo "There is no name, Try again with a name"; - exit(); -} -if ($message == "") { - header('Refresh:2; url=' . $newURL ); - echo "There is no message, Try again with a message"; - exit(); -} -if($mlength > 200) { - header('Refresh:2; url=' . $newURL ); - echo "This message is too long"; - exit(); -} -if($nlength > 25 ) { - header('Refresh:2; url=' . $newURL ); - echo "The name is too long"; - exit(); -} - - - -$data = json_decode(file_get_contents('test.json'), true); - - -foreach($data as $post) { - if ($post["message"] == $message) { - echo "Another message with this text already exists"; - header('Refresh:2; url=' . $newURL ); - exit(); - } -} - - -array_unshift($data , $ndata); -file_put_contents('test.json', json_encode($data, JSON_PRETTY_PRINT)); - -header('Refresh:2; url=' . $newURL ); -echo "Your submisson has been added"; -exit();