X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=c6914b164cb609199462699d53eb6ca8777418ba;hb=be5a0cbae65d695ff538d62af97a57637ff00d86;hp=7feaa03f350727c58baeed4edf7c45538ab7bf32;hpb=9da61e74c9ee47a13e7e5d13ab951429d51e8629;p=dylansserver.git
diff --git a/index.php b/index.php
index 7feaa03..c6914b1 100644
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
abstract class cms {
- private $config_file = '/etc/dylanstestserver.ini';
+ private $config_file = '/etc/dylansserver.ini';
protected $db;
protected $recaptcha_publickey;
protected $recaptcha_privatekey;
@@ -69,13 +69,13 @@ abstract class cms {
return $return;
}
- public function display_head($title = "dylanstestserver",
+ public function display_head($title = "dylansserver",
$home_link = "/") {
$scripts = "";
$stylesheets = "";
if (cms::determine_type() == "index") {
$scripts = "";
- $home_link = "http://validator.w3.org/unicorn/check?ucn_uri=dylanstestserver.com&ucn_task=conformance#";
+ $home_link = "http://validator.w3.org/unicorn/check?ucn_uri=dylansserver.com&ucn_task=conformance#";
} else if ($this->determine_type() == 'note') {
$scripts = "";
$scripts .= "";
@@ -102,7 +102,7 @@ abstract class cms {
@@ -167,7 +167,7 @@ class index extends cms {
git://dylanstestserver.com
+ "git">git://dylansserver.com
some notes:
@@ -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() {
@@ -283,7 +283,7 @@ class page extends cms {
$datetime_posted = explode(' ', $date_posted[2]);
$day_posted = $datetime_posted[0];
echo "";
- echo "
$year_posted/$month_posted/$day_posted/$title
";
+ echo "
$year_posted/$month_posted/$day_posted/$title
";
echo $entry['text'];
echo "
";
}
@@ -294,7 +294,7 @@ class page extends cms {
private function write_navigation() {
echo "";
- echo "
";
+ echo "";
if($this->page > 1){
$previous_page = $this->page - 1;
echo "prev";
@@ -303,7 +303,7 @@ class page extends cms {
$forward_page = $this->page + 1;
echo " next";
}
- echo "
";
+ echo "";
echo "
";
}
@@ -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();
@@ -403,7 +402,7 @@ class note extends cms {
private function display_note() {
echo <<
- $this->year_posted/$this->month_posted/$this->day_posted/$this->title
+ $this->year_posted/$this->month_posted/$this->day_posted/$this->title
$this->text
END_OF_NOTE;
@@ -413,14 +412,14 @@ END_OF_NOTE;
echo <<
-
+
END_OF_NAVIGATION;
if (!$this->comments_enabled) {
$this->display_comment_link();
}
echo <<back to notes/
-
+
END_OF_NAVIGATION;
}
@@ -441,20 +440,15 @@ END_OF_NAVIGATION;
private function display_comments() {
echo "
-END_OF_FORM;
+END_OF_ERRORS;
} else {
- echo <<
+ reCAPTCHA said you're not human,
+ try again?
+
+
+END_OF_ERRORS;
+ }
+ echo <<
END_OF_FORM;
- }
}
}
@@ -585,9 +589,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 +599,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 +608,7 @@ class archive extends cms {
private function write_navigation() {
echo "
";
echo "
";
- echo "
";
// fill me in!
- echo "
";
echo "";
}
$author
"; - } else { - $head = "$author
"; - } + $head = "$author
"; echo <<name:
-email:
-@@ -510,19 +502,31 @@ END_CAPTCHA_STYLE; END_OF_FORM; echo recaptcha_get_html($this->recaptcha_publickey); if ($this->failed_captcha) { - echo <<
+ try again? +