X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=index.php;h=e1d23766a83835f18cc7561f2d9cd820592bb305;hb=2fa993033259cb3045dbe02b194e7ac888c40953;hp=7feaa03f350727c58baeed4edf7c45538ab7bf32;hpb=9da61e74c9ee47a13e7e5d13ab951429d51e8629;p=dylansserver.git diff --git a/index.php b/index.php index 7feaa03..e1d2376 100644 --- a/index.php +++ b/index.php @@ -2,10 +2,11 @@ abstract class cms { - private $config_file = '/etc/dylanstestserver.ini'; + private $config_file = '/etc/dylansserver.ini'; protected $db; protected $recaptcha_publickey; protected $recaptcha_privatekey; + protected $scripts; public $title; public $home_link; @@ -69,19 +70,11 @@ abstract class cms { return $return; } - public function display_head($title = "dylanstestserver", + public function display_head($title = "dylansserver", $home_link = "/") { - $scripts = ""; + $scripts = $this->scripts; $stylesheets = ""; - if (cms::determine_type() == "index") { - $scripts = ""; - $home_link = "http://validator.w3.org/unicorn/check?ucn_uri=dylanstestserver.com&ucn_task=conformance#"; - } else if ($this->determine_type() == 'note') { - $scripts = ""; - $scripts .= ""; - $scripts .= ""; - $scripts .= ""; - } + $home_link = "http://validator.w3.org/unicorn/check?ucn_uri=dylansserver.com&ucn_task=conformance#"; echo << @@ -102,7 +95,7 @@ abstract class cms {
@@ -140,6 +133,7 @@ END_OF_CLOSE; class index extends cms { public function display() { + $this->scripts = ""; $this->display_head(); $this->display_exhibits(); echo "
END_OF_NOTE; @@ -413,14 +411,14 @@ END_OF_NOTE; echo << END_OF_NAVIGATION; } @@ -441,20 +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']); - if ($email == '') { - $head = "

$author

"; - } else { - $head = "

$author

"; - } + $head = "

$author

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

name:

-

email:

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

@@ -510,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; - } } } @@ -585,9 +588,9 @@ class archive extends cms { $datetime_posted = explode(' ', $date_posted[2]); $day_posted = $datetime_posted[0]; echo "
"; - echo "

"; + echo "

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

"; + echo "
$title

"; echo $entry['text']; echo "
"; } @@ -595,7 +598,7 @@ class archive extends cms { $this->write_navigation(); } else { echo "
"; - echo "

sorry, nothing here

"; + echo "

sorry, nothing here

"; echo "
Empty set (0.00 sec)
"; } $this->display_close(); @@ -604,9 +607,7 @@ class archive extends cms { private function write_navigation() { echo "
"; echo ""; }