X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=index.php;h=16a01ec0fc051c7a87a63c42fd45a12b536bca81;hb=d4adeb654507e6cd75aac3f264ae21ed5d16bfab;hp=29e4076463cc821d8fdda546f037b2436c5c6adb;hpb=6f04d2b1c7461b1c50dd3c9f895baabafc4d6db4;p=dylansserver.git diff --git a/index.php b/index.php index 29e4076..16a01ec 100644 --- a/index.php +++ b/index.php @@ -3,25 +3,31 @@ abstract class cms { private $config_file = '/etc/dylanstestserver.ini'; protected $db; + protected $recaptcha_publickey; + protected $recaptcha_privatekey; public function __construct() { - $config = parse_ini_file($this->config_file); + $config = parse_ini_file($this->config_file, true); $this->db = new mysqli( - $config['domain'], - $config['user'], - $config['password'], - $config['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(); exit(); } + $this->recaptcha_publickey = $config[recaptcha]['publickey']; + $this->recaptcha_privatekey = $config[recaptcha]['privatekey']; ob_start(); } public static function determine_type() { if (isset($_GET['page']) && is_numeric($_GET['page'])) { return 'page'; + } else if (isset($_GET['year'])) { + return 'archive'; } else if (isset($_GET['note'])) { return 'note'; } else if ($_SERVER['REQUEST_URI'] == '/') { @@ -60,8 +66,7 @@ abstract class cms { $home_link = "/") { $scripts = ""; $stylesheets = ""; - if (cms::determine_type() == "index") { - $scripts = "