X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=b95b16d3dc40d1f45063f416f8804c444a793f81;hb=27d39343f641c2f3c63e7699b8de94786aadbfea;hp=dd94e83ff15cc5051423195548e2dd1c131f9c8f;hpb=8cd0bc0d71cd02a8f4921836c8a3089ed6a01c01;p=dylansserver.git
diff --git a/index.php b/index.php
index dd94e83..b95b16d 100644
--- a/index.php
+++ b/index.php
@@ -13,10 +13,10 @@ abstract class cms {
public function __construct() {
$config = parse_ini_file($this->config_file, true);
$this->db = new mysqli(
- $config[database]['domain'],
- $config[database]['user'],
- $config[database]['password'],
- $config[database]['database']);
+ $config['database']['domain'],
+ $config['database']['user'],
+ $config['database']['password'],
+ $config['database']['database']);
if (mysqli_connect_errno()) {
echo "Problem connecting to database: ";
echo mysqli_connect_error();
@@ -40,7 +40,9 @@ abstract class cms {
return 'index';
} else if (isset($_GET['project'])) {
return 'project';
- } else if (isset($_GET['challenge'])) {
+ } else if (isset($_GET['rss'])) {
+ return 'rss';
+ } else if (isset($_GET['challenge'])) {
return 'captcha';
}
}
@@ -91,7 +93,7 @@ abstract class cms {
$scripts
-
+
";
$this->write_navigation();
@@ -288,7 +320,7 @@ class page extends cms {
private function write_navigation() {
echo "";
- echo "
";
+ echo "";
if($this->page > 1){
$previous_page = $this->page - 1;
echo "prev";
@@ -297,7 +329,7 @@ class page extends cms {
$forward_page = $this->page + 1;
echo " next";
}
- echo "
";
+ echo "";
echo "
";
}
@@ -318,8 +350,27 @@ class note extends cms {
public $number_of_comments;
public function __construct() {
- if (isset($_GET['comments'])) {
$this->scripts = "
+
+
+
+
+
+ ";
+
+ if (isset($_GET['comments'])) {
+ $this->scripts .= "
";
}
@@ -391,8 +442,8 @@ class note extends cms {
// and a default author needs to be set
// for no-javascript users.
$stmt->bind_param('sss',
- htmlspecialchars($_POST['name']),
- htmlspecialchars($_POST['text']),
+ $_POST['name'],
+ $_POST['text'],
$this->id);
$stmt->execute();
}
@@ -401,7 +452,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;
@@ -409,16 +460,16 @@ END_OF_NOTE;
private function write_navigation() {
echo <<
+
-
+
END_OF_NAVIGATION;
if (!$this->comments_enabled) {
$this->display_comment_link();
}
echo <<back to notes/
-
+
back to notes/
+
END_OF_NAVIGATION;
}
@@ -447,7 +498,7 @@ END_OF_NAVIGATION;
$date_posted = $entry['date_posted'];
$author = $entry['author'];
$text = htmlspecialchars($entry['text']);
- $head = "$author
";
+ $head = "" . htmlspecialchars($author) . "
";
echo <<