aboutsummaryrefslogtreecommitdiff
path: root/guestbook/commentbox.php
diff options
context:
space:
mode:
Diffstat (limited to 'guestbook/commentbox.php')
-rw-r--r--guestbook/commentbox.php67
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