diff options
author | deva <deva> | 2008-10-06 18:13:56 +0000 |
---|---|---|
committer | deva <deva> | 2008-10-06 18:13:56 +0000 |
commit | 415e90a2e059ea32f6851dfb9b3c018b0a731a81 (patch) | |
tree | a2e7d809f4783f521a3a985716a26a6543acfc9d /pages/guestbook.php | |
parent | cce5e7710295021b41d9aaecc503a60fb99256be (diff) |
Put the webpages in.
Diffstat (limited to 'pages/guestbook.php')
-rw-r--r-- | pages/guestbook.php | 58 |
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&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&show=all">more >></a> +</div> +<?php +} +?>
\ No newline at end of file |