summaryrefslogtreecommitdiff
path: root/pages/guestbook.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/guestbook.php')
-rw-r--r--pages/guestbook.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/pages/guestbook.php b/pages/guestbook.php
new file mode 100644
index 0000000..e3af7ba
--- /dev/null
+++ b/pages/guestbook.php
@@ -0,0 +1,58 @@
+<div class="header">
+ <div class="header_guestbook">
+ <div class="header_text">Guestbook</div>
+ </div>
+</div>
+<?php
+include_once($UTIL_DIR . "/guestbook.php");
+include_once($UTIL_DIR . "/convert.php");
+
+if($action == "post") {
+ // Check is the message is SPAM
+ if(filtermessage($name, $email, $message, $name_hidden, $email_hidden, $message_hidden)) {
+ // It was not... now add it to the book.
+ $entry = new GuestbookEntry($name_hidden,
+ $email_hidden,
+ time(),
+ $_SERVER['REMOTE_ADDR'],
+ convert($message_hidden));
+ $guestbook = new Guestbook($DATA_DIR . "/guestbook.xml");
+ $guestbook->add($entry);
+ $guestbook->write();
+ }
+}
+
+?>
+<div class="small_header">Post new entry</div>
+<div class="guestbook_form">
+<form action="?page=guestbook&amp;action=post" method="post">
+<p>
+Name: <input style="display: none" name="name"/><input name="name_hidden"/>
+Email: <input style="display: none" name="email"/><input name="email_hidden"/><br/>
+Message:<br/>
+<textarea style="display: none" rows="2" cols="74" name="message"></textarea>
+<textarea rows="2" cols="74" name="message_hidden"></textarea><br/>
+<button type="submit">Post</button><br/>
+</p>
+<p>
+<strong>Note</strong>:<br/>
+<em>Inappropriate, unwarranted or self-aggrandizementing comments may suffer
+redaction. Or, deletion.</em>
+</p>
+</form>
+</div>
+
+<div class="small_header">Entries</div>
+<?php
+$guestbook = new Guestbook($DATA_DIR . "/guestbook.xml");
+if($show == "all") {
+ $guestbook->show(-1);
+} else {
+ $guestbook->show(6);
+?>
+<div class="more">
+<a href="?page=guestbook&amp;show=all">more &gt;&gt;</a>
+</div>
+<?php
+}
+?> \ No newline at end of file