X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=bf2249bfd14920d5550c47184bd62ba7bcd57499;hb=60e2ac52bbf649d4b04f91bc731672a94c4373a8;hp=8381c1b505d45ca940673cf55518d21a004cac2d;hpb=99dc53dddd748917bef3d1d7d0ee847c785f6b26;p=dylansserver.git
diff --git a/index.php b/index.php
index 8381c1b..bf2249b 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';
}
}
@@ -86,12 +88,12 @@ abstract class cms {
$this->title
-
+
$stylesheets
$scripts
-
+
@@ -136,7 +138,7 @@ class index extends cms {
$this->scripts = "";
$this->display_head();
$this->display_exhibits();
- echo "";
+ echo "";
$this->list_projects();
echo <<
@@ -161,14 +163,21 @@ class index extends cms {
git://dylansserver.com
+ "/git/">git://dylansserver.com
some notes:
here
+ "/notes/">here [
rss ]
+
+
+ my resume:
+
+
+
[pdf ]
@@ -185,7 +194,7 @@ OTHER_PROJECTS;
protected function display_exhibits() {
echo "
";
- $sql = "SELECT text FROM projects";
+ $sql = "SELECT text FROM projects ORDER BY rank";
$result = $this->db->query($sql);
while ($entry = $result->fetch_object()) {
echo $entry->text;
@@ -199,7 +208,7 @@ OTHER_PROJECTS;
my projects:
HEREDOC;
- $sql = "SELECT title FROM projects";
+ $sql = "SELECT title FROM projects ORDER BY rank";
$result = $this->db->query($sql);
while ($entry = $result->fetch_object()) {
echo "
$entry->title ";
@@ -238,6 +247,24 @@ class page extends cms {
public function __construct() {
parent::__construct();
$this->page_offset();
+ $this->scripts = "
+
+
+
+
+
+ ";
}
private function page_offset() {
@@ -276,10 +303,15 @@ class page extends cms {
$month_posted = $date_posted[1];
$datetime_posted = explode(' ', $date_posted[2]);
$day_posted = $datetime_posted[0];
- echo "
";
- echo "
$year_posted/$month_posted/$day_posted/ $title ";
- echo $entry['text'];
- echo "
";
+ $text = $entry['text'];
+ echo <<
+
+ $year_posted/$month_posted/$day_posted/ $title
+
+ $text
+
+END_NOTE;
}
echo "
";
$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 <<