diff options
| author | Hannah Isopod <me@bathynomus.xyz> | 2026-02-15 22:42:27 -0700 |
|---|---|---|
| committer | Hannah Isopod <me@bathynomus.xyz> | 2026-02-15 22:42:27 -0700 |
| commit | 3b606bcc096a6d9860672e6d0d003ca9e80c067e (patch) | |
| tree | 17746584c25a0d165c0feaf884f33c1578aa4f04 /guestbook/commentbox.php | |
| parent | 16e48ed8655528a81cbec84f0cbc1a211d663b37 (diff) | |
THE BIG ONE
Total website redesign.
Multiple new blog posts.
Routine updates on several pages.
Too much to list, even if I remembered it all.
Remind me not to put this git repo on any portfolios.
Diffstat (limited to 'guestbook/commentbox.php')
| -rw-r--r-- | guestbook/commentbox.php | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/guestbook/commentbox.php b/guestbook/commentbox.php new file mode 100644 index 0000000..9ba6586 --- /dev/null +++ b/guestbook/commentbox.php @@ -0,0 +1,67 @@ +<section> <!-- If I did it right, this <section> should be everything needed to give any page a comment box --> + <?php + $root = $_SERVER['DOCUMENT_ROOT']; + + //Boilerplate for Parsedown + include_once($root."/Parsedown.php"); + $Parsedown = new Parsedown(); + $Parsedown->setSafeMode(true); + + //Boilerplate for comments + include_once($root . '/common.php'); + $return = $_GET["return"]; + $cwd = preg_replace("/^.*\//","",getcwd()); + + $ismaingb = false; + if($cwd != "guestbook") { + echo('<h2>Comments</h2>'); + } else { + $ismaingb = true; + } + + ?> + + <form action="/guestbook/submit.php" method="post" autocomplete="off" class="commentform"> + <?php echo "<input type='text' name='entry' value='$cwd' style='display: none;' readonly>"; ?> + <textarea name="msg" placeholder="I know what you are." style="opacity: 0; position: absolute; left: -10000rem; height: 0; width: 0; overflow: clip;"></textarea> + <div class="commentform-top"> + <div class="commentform-field"> + <label for="name">Name<span style="color:red;">*</span></label> + <input type="text" name="name" id="name" placeholder="Hannah"> + </div> + <div class="commentform-field"> + <label for="website">Website</label> + <input type="text" name="website" id="website" placeholder="https://"> + </div> + </div> + + <?php if($ismaingb) { echo("<div class='commentform-field'> + <label for='cool'>Link something cool</label> + <input type='text' name='cool' id='cool' placeholder='https://'> + </div> + <div class='commentform-field'> + <textarea name='found' id='found'></textarea> + <label for='found'>How did you find me?</label> + </div>"); } ?> + <div class="commentform-field"> + <textarea name="message" id="message" placeholder="Supports Markdown!"></textarea> + <label for="message">Message<span style="color:red;">*</span></label> + </div> + <div class="commentform-field"> + <label for="botcheck">Bot test (6-letter term for roly-poly)<span style="color:red;">*</span></label> + <input type="text" name="botcheck" placeholder="[_].cool"> + </div> + <div class="commentform-bottom"> + <input type="submit" value="Submit"> + <?php + if($return) { + echo($gbform_messages[$return]); + } + ?> + </div> + </form> + <?php + //Displays comments + include($root.'/guestbook/comments.php'); echo_comments($cwd, $Parsedown); + ?> +</section>
\ No newline at end of file |
