X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=index.php;h=424f8504ab4d03fb8543098316d628ee6cafa134;hb=8170ae8225a45092867ac0b0d6914282c02334a6;hp=bbd22540865f8eb3812a38893325c11437fe8f9f;hpb=f9f5098e264fd94ce501df8776fc80caf97bbd3b;p=dylansserver.git diff --git a/index.php b/index.php index bbd2254..424f850 100644 --- a/index.php +++ b/index.php @@ -145,7 +145,6 @@ class index extends cms { echo ""; $this->display_close($show_contact = false); } 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 +384,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,15 +439,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']); + $head = "

$author

"; echo << $head @@ -482,8 +480,6 @@ END_CAPTCHA_STYLE;

name:

-

email:

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

@@ -505,19 +501,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; - } } } @@ -565,7 +573,7 @@ class archive extends cms { AND DAY(date_posted) = ? ORDER BY date_posted DESC"; $result = $this->query($sql, "ddd", - $_GET['year'], $_GET['month'], + $_GET['year'], $_GET['month'], $_GET['day']); break; } @@ -581,8 +589,8 @@ class archive extends cms { $day_posted = $datetime_posted[0]; echo "
"; echo "

"; - echo "$year_posted/$month_posted/$day_posted/"; - echo "$title

"; + echo "$year_posted/$month_posted/$day_posted/"; + echo "$title"; echo $entry['text']; echo "
"; }