setPageTitle("Goon Guestbook"); $currBanner->addContent("Goon Guestbook"); $currNavbar->setCustomLinksTitle("Guestbook"); $currNavbar->addCustomLink("/guestbook.php?action=add", "Add Comments"); // add view entries for every person who has a guestbook $query = "SELECT DISTINCT users.id, username FROM users, guestbook WHERE users.id = guestbook.owner ORDER BY users.id ASC"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $currNavbar->addCustomLink("/guestbook.php?action=view&owner=$row[id]","View Guestbook for $row[username]"); } // if the person wants to be added, lets give them a form. if ($_REQUEST["action"] == "add") { if (!$_SESSION["isAnonymous"]) $postername = $_SESSION["name"]; ?>

Add a Comment.

This will let you add a comment to the guestbook.


Your Name:
Guestbook to post in :
Comments:

Note: HTML will be escaped from comments, so don't bother using it.

Comment added successfully!

"); } if (!$result) print("

We could not add that Comment. Here is the exact error: " . mysql_error() . "

"); } else { print("

Sorry, you do not have permission to do that. As usual, you can blame this on a few idiots (or actually, just one from Alberta) ruining it for everybody else.

"); } } // if we're viewing a top or bottom list (which is the default action) elseif ($_REQUEST["action"] == "view") { // if we don't know who we are viewing, then show mine if ($_REQUEST["owner"] < 1) $_REQUEST["owner"] = 1; ?>

This is the guestbook. You are encouraged to write any comments about the site in here, say hi, whatever. Have fun!

Add an entry.

"); print("Poster: $row[postername]\n"); print("
Date: $row[datetimeadded]\n"); $comments = nl2br($row["comments"]); print("

$comments

"); print("\n"); print("
\n"); } } else { ?>

Odd, you shouldn't be here. Go and view someone's guestbook instead! Use the menu on the right to do it.