X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=index.php;h=de2747353f677915f413a8b955f2dedba2039e93;hb=38d1198a5c9356142c64115d8c38b463385c5266;hp=687fc690f68cdc323d792cdf97bdeafd960273eb;hpb=8531410ff5fb89df84d28fb097c236e6c5cb894c;p=dylansserver.git diff --git a/index.php b/index.php index 687fc69..de27473 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 << @@ -93,7 +86,7 @@ abstract class cms { $this->title - + $stylesheets $scripts @@ -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_NOTE; } echo ""; $this->write_navigation(); @@ -294,7 +293,7 @@ class page extends cms { private function write_navigation() { echo ""; } @@ -324,6 +323,11 @@ class note extends cms { public $number_of_comments; public function __construct() { + if (isset($_GET['comments'])) { + $this->scripts = " + + "; + } parent::__construct(); if (isset($_GET['comments'])) { $this->comments_enabled = true; @@ -402,7 +406,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; @@ -412,14 +416,14 @@ END_OF_NOTE; echo << END_OF_NAVIGATION; } @@ -589,9 +593,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 "
"; } @@ -599,7 +603,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(); @@ -608,9 +612,7 @@ class archive extends cms { private function write_navigation() { echo "
"; echo ""; }