diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/config.php | 2 | ||||
| -rw-r--r-- | lib/partials.php | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/config.php b/lib/config.php index 8705999..73c2efb 100644 --- a/lib/config.php +++ b/lib/config.php @@ -8,6 +8,8 @@ define('DB_URL', "{$c['database']['driver']}:dbname={$c['database']['name']};hos define('DB_USER', $c['database']['user'] ?? null); define('DB_PASS', $c['database']['pass'] ?? null); +define('INSTANCE_NAME', $c['instance']['name'] ?? $_SERVER['HTTP_HOST']); + define('SOUND_DIRECTORY', $c['sound']['directory'] ?? "{$_SERVER['DOCUMENT_ROOT']}/static/userdata/sounds"); define('IS_JSON_REQUEST', isset($_SERVER['HTTP_ACCEPT']) && str_contains($_SERVER['HTTP_ACCEPT'], 'application/json'));
\ No newline at end of file diff --git a/lib/partials.php b/lib/partials.php new file mode 100644 index 0000000..d7026ec --- /dev/null +++ b/lib/partials.php @@ -0,0 +1,22 @@ +<?php +include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/config.php'; + +function html_header() +{ + echo '' ?> + <header> + <section class="brand"> + <a href="/"> + <img src="/static/img/brand/mini.webp" alt=""> + <h1><?= INSTANCE_NAME ?></h1> + </a> + <a href="/sounds/"> + <button>Sounds</button> + </a> + <a href="/sounds/upload.php"> + <button>Upload</button> + </a> + </section> + </header> + <?php ; +}
\ No newline at end of file |
