X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;ds=sidebyside;f=index.php;h=516089e056816089995fced1e48f4219dea7626b;hb=5b70780eb304ed68645d48f06f65034499d7a515;hp=a4c56ec1fd99179bf0fac0537954f35d0dfa79a7;hpb=897b1bc37445421a3404ace1c02b529b0ea843e5;p=dylansserver.git
diff --git a/index.php b/index.php
index a4c56ec..516089e 100644
--- a/index.php
+++ b/index.php
@@ -1,3 +1,75 @@
+config_file, true);
+ $this->db = new mysqli(
+ $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'] == '/') {
+ return 'index';
+ } else if (isset($_GET['project'])) {
+ return 'project';
+ }
+ }
+
+ public function query() {
+ $args = func_get_args();
+ $statement = $this->db->prepare($args[0]);
+ $args = array_slice($args, 1);
+ call_user_func_array(array($statement, 'bind_param'), &$args);
+ $statement->execute();
+ $return = array();
+ $statement->store_result();
+ $row = array();
+ $data = $statement->result_metadata();
+ $fields = array();
+ $fields[0] = &$statement;
+ while($field = $data->fetch_field()) {
+ $fields[] = &$row[$field->name];
+ }
+ call_user_func_array("mysqli_stmt_bind_result", $fields);
+ $i = 0;
+ while ($statement->fetch()) {
+ foreach ($row as $key1=>$value1) $return[$i][$key1] = $value1;
+ $i++;
+ }
+ $statement->free_result();
+ return $return;
+ }
+
+ public function display_head($title = "dylanstestserver",
+ $home_link = "/") {
+ $scripts = "";
+ $stylesheets = " ";
+ if (cms::determine_type() == "index") { $scripts = "
-
-
-
-
-
3D printing is a form of
- additive manufacturing technology where a three
- dimensional object is created by successive layers of
- material. [1]:http://en.wikipedia.org/wiki/3D_printing
-
-
- reprap is a free
- desktop 3D printer capable of printing plastic
- objects.
-
- repthis.info is the account of a friend and I learning to build our own.
-
-
-
-
-
-
-
-
-
-
-
a firefox addon, to load linked images inline (like on reddit ).
-
- here's the repo for the source code.
-
-
-
drawcss
- writing markup for website wireframes always seemed silly.
- this is a tool to draw them (it's not done).
- check out the invisible divs this page is built on.
- then get the code .
-
-
-
-
-
readoo helps you find search keywords to target.
- it reads your IIS logs, and finds successful keywords worth focusing on.
- it's not done yet! here's the source code .
-
-
-
-
-
-
-
-
-
-
+END_OF_CONTACT;
+ }
+
+ public function display_close($show_contact = true) {
+ if ($show_contact) {
+ $this->display_contact();
+ }
+ echo <<
+
+
+
+
+