From 1cdfd93e1f02739a685d1cdb131b3efe13adc06b Mon Sep 17 00:00:00 2001 From: nathansmith Date: Sat, 24 May 2025 11:52:12 -0600 Subject: No more tables in guest book --- lighttpd-test.conf | 13 +++++++ org/cgi-bin/guest-book.cgi | 92 +++++++++++++++++----------------------------- org/css/guest-book.css | 15 ++++++++ test-server.sh | 2 + 4 files changed, 64 insertions(+), 58 deletions(-) create mode 100644 lighttpd-test.conf create mode 100644 org/css/guest-book.css create mode 100755 test-server.sh diff --git a/lighttpd-test.conf b/lighttpd-test.conf new file mode 100644 index 0000000..03dc5b0 --- /dev/null +++ b/lighttpd-test.conf @@ -0,0 +1,13 @@ +server.document-root = "/home/nathan/Documents/dev/shittyweb/xhtml/" +server.port = 8000 +index-file.names = ("index.xhtml") +server.error-handler-404 = "/error/404.xhtml" + +# Modules +server.modules += ("mod_cgi") + +$HTTP["url"] =~ "^/cgi-bin" { + cgi.assign = ( "" => "" ) +} + +cgi.execute-x-only = "enable" \ No newline at end of file diff --git a/org/cgi-bin/guest-book.cgi b/org/cgi-bin/guest-book.cgi index bfad47b..4c4d4fd 100755 --- a/org/cgi-bin/guest-book.cgi +++ b/org/cgi-bin/guest-book.cgi @@ -127,77 +127,55 @@ (message (cdr (list-ref guest 1))) (url (cdr (list-ref guest 2))) (name (cdr (list-ref guest 3)))) - (format #t " \n\ - \n\ -
\n\ - ~a ~a --- signed ~a\n\ -
\n\ -

~a

\n\ -
\n\n" name url url date message))) + (format #t "
+ ~a ~a --- signed ~a\n\ +

~a

\n\ +
\n
\n" name url url date message))) ;; Display pretty much everything (define (display-guest-book) (display "Content-Type: text/html\n\n\ -\n\ -\n\ +\n\ +\n\ \n\ Guest Book\n\ - \n\ + + \n\ \n\ \n\ \"Back\n\ -
\n\ - \n\ - \n\ - \n\ - \n\ -
\n\ -

Sign my fucking guest book

\n\ -
\n\ - Name\n\ - \n\ -
\n\ - Website (Optional)\n\ - \n\ - \n\ -

\n\ - Write a little silly something\n\ -
\n\ - \n\ -
\n\ - \n\ - You can't delete/edit it afterwards\n\ -
\n\ -

\n\ - Be nice! Dont be a fucking ass.\n\ -

\n") +
\n\ +

Sign my fucking guest book

\n\ +
\n\ + Name\n\ + \n\ +
\n\ + Website (Optional)\n\ + \n\ + \n\ +

\n\ + Write a little silly something\n\ +
\n\ + \n\ +
\n\ + \n\ + You can't delete/edit it afterwards\n\ +
\n\ +

\n\ + Be nice! Dont be a fucking ass.\n\ +

\n") (handle-fields) - (display "
\n\n") + (display " \n
\n") ;; Try to read the guest book json (with-exception-handler (lambda (error) - (display " \n\ - \n\ -
\n\ + (display "
\n\

No guest(s) have been added ): But you can be the first!

\n\ -
\n")) + \n")) (lambda () (call-with-input-file guest-book-json-file (lambda (fp) @@ -210,9 +188,7 @@ table {\n\ (guest-loop (- (vector-length guest-book) 1)))))) #:unwind? #t) - (display "
\n\ -\n\ -\n")) + (display "\n\n")) (define (main args) (display-guest-book)) diff --git a/org/css/guest-book.css b/org/css/guest-book.css new file mode 100644 index 0000000..9d483b4 --- /dev/null +++ b/org/css/guest-book.css @@ -0,0 +1,15 @@ +body { + background-color: #dcd1ba; + background-image: url('../images/guest-book-background.png'); +} + +.container { + background-color: #bebebe; + width: 60%; + margin: auto; + border: 1px solid black; +} + +.silly-something { + border: 1px dotted black; +} diff --git a/test-server.sh b/test-server.sh new file mode 100755 index 0000000..d8076a1 --- /dev/null +++ b/test-server.sh @@ -0,0 +1,2 @@ +#! /usr/bin/sh +lighttpd -D -f lighttpd-test.conf -- cgit v1.2.3