diff --git a/www/src/db_handler/analytics_interface.php b/www/src/db_handler/analytics_interface.php index fbe3400..de629c9 100644 --- a/www/src/db_handler/analytics_interface.php +++ b/www/src/db_handler/analytics_interface.php @@ -1,4 +1,3 @@ - data; + $out_data = array_merge($this->site_defaults, $this->data); if(isset($options['markdown'])) { $out_data['markdown'] = $this->get_markdown(); @@ -189,7 +188,14 @@ class Post implements ArrayAccess { $out_data['html'] = $this->get_html(); } if(isset($options['children'])) { - die(); + $children = $this->get_child_posts(); + $child_arrays = []; + + foreach($children AS $child) { + array_push($child_arrays, $child->to_array()); + } + + $out_data['children'] = $child_arrays; } return $out_data; diff --git a/www/src/dergdown.php b/www/src/dergdown.php index 8380be7..0405127 100644 --- a/www/src/dergdown.php +++ b/www/src/dergdown.php @@ -1,5 +1,3 @@ - - get_post($match[1]); + + echo $post->to_json($REQUEST_QUERY); + +} + +?> \ No newline at end of file diff --git a/www/src/setup_db.php b/www/src/setup/db.php similarity index 100% rename from www/src/setup_db.php rename to www/src/setup/db.php diff --git a/www/src/setup/permissions.php b/www/src/setup/permissions.php new file mode 100644 index 0000000..272d986 --- /dev/null +++ b/www/src/setup/permissions.php @@ -0,0 +1,17 @@ + true, + "upload" => false +]; + +$ACCESS_KEY = $REQUEST_QUERY['ACCESS_KEY'] ?? $_COOKIE['ACCESS_KEY'] ?? ''; + +if($ACCESS_KEY == $SITE_CONFIG['ACCESS_KEY']) { + $ACCESS_PERMISSIONS = [ + "read" => true, + "upload" => true + ]; +} + +?> \ No newline at end of file diff --git a/www/src/setup_site_config.php b/www/src/setup/site_config.php similarity index 100% rename from www/src/setup_site_config.php rename to www/src/setup/site_config.php diff --git a/www/src/setup_twig.php b/www/src/setup/twig.php similarity index 100% rename from www/src/setup_twig.php rename to www/src/setup/twig.php