X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=index.php;h=740157b9ceacc8a29d2ae119ab83d37f5e7eea7d;hb=c2c4a56c5d3b6ccc549539bf99e0d9c0d50473b6;hp=7feaa03f350727c58baeed4edf7c45538ab7bf32;hpb=9da61e74c9ee47a13e7e5d13ab951429d51e8629;p=dylansserver.git diff --git a/index.php b/index.php index 7feaa03..740157b 100644 --- a/index.php +++ b/index.php @@ -190,13 +190,13 @@ OTHER_PROJECTS; } protected function display_exhibits() { + echo "
"; $sql = "SELECT text FROM projects"; $result = $this->db->query($sql); while ($entry = $result->fetch_object()) { - echo "
"; echo $entry->text; - echo "
"; } + echo "
"; } private function list_projects() { @@ -385,15 +385,14 @@ class note extends cms { } if (isset($_POST['captcha']) || $resp->is_valid) { $sql = ("INSERT INTO comments (date_posted, author, - email, text, note) - VALUES(NOW(), ?, ?, ?, ?)"); + text, note) + VALUES(NOW(), ?, ?, ?)"); $stmt = $this->db->prepare($sql); // Checks are needed here (no blank text, - // and a default author / email need to be set + // and a default author needs to be set // for no-javascript users. - $stmt->bind_param('ssss', + $stmt->bind_param('sss', htmlspecialchars($_POST['name']), - htmlspecialchars($_POST['email']), htmlspecialchars($_POST['text']), $this->id); $stmt->execute(); @@ -441,20 +440,15 @@ END_OF_NAVIGATION; private function display_comments() { echo "
"; - $sql= "SELECT date_posted, author, email, text + $sql= "SELECT date_posted, author, text FROM comments WHERE note = ? ORDER BY date_posted DESC"; $result = $this->query($sql, 'd', $this->id); foreach ($result as $row => $entry) { $date_posted = $entry['date_posted']; $author = $entry['author']; - $email = $entry['email']; $text = htmlspecialchars($entry['text']); - if ($email == '') { - $head = "

$author

"; - } else { - $head = "

$author

"; - } + $head = "

$author

"; echo << $head @@ -487,8 +481,6 @@ END_CAPTCHA_STYLE;

name:

-

email:

-
@@ -497,7 +489,7 @@ END_CAPTCHA_STYLE; ( another / audio / - Get an image CAPTCHAhelp ) + imagehelp )

@@ -510,19 +502,31 @@ END_CAPTCHA_STYLE; END_OF_FORM; echo recaptcha_get_html($this->recaptcha_publickey); if ($this->failed_captcha) { - echo <<reCAPTCHA said you're not human, - + echo << + reCAPTCHA said you're not human,
+ try again? +
+
-END_OF_FORM; +END_OF_ERRORS; } else { - echo << + reCAPTCHA said you're not human,
+ try again? + +
+ but you didn't write anything!
+
+END_OF_ERRORS; + } + echo << END_OF_FORM; - } } }