summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/index.php b/index.php
index b443df7..1a6d19d 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,11 @@
<?php
include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/config.php";
+
+if (!file_exists(CFG_PATH)) {
+ header('Location: /system/config.php');
+ exit("You have to set up the instance first!");
+}
+
include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/accounts.php";
include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/version.php";
@@ -9,7 +15,7 @@ authorize_user();
<html>
<head>
- <title><?php echo INSTANCE_NAME ?></title>
+ <title><?php echo CONFIG['instance']['name'] ?></title>
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
</head>
@@ -17,20 +23,20 @@ authorize_user();
<body>
<div class="container">
<div class="wrapper center big-gap">
- <h1><img src="/static/img/brand/big.webp" alt="<?php echo INSTANCE_NAME; ?>"></h1>
+ <h1><img src="/static/img/brand/big.webp" alt="<?php echo CONFIG['instance']['name']; ?>"></h1>
<div class="items row" style="gap:32px;">
<a href="/emotes">Emotes</a>
- <?php if (EMOTESET_PUBLIC_LIST): ?>
+ <?php if (CONFIG['emoteset']['public']): ?>
<a href="/emotesets.php">Emotesets</a>
<?php endif; ?>
- <?php if (ACCOUNT_PUBLIC_LIST): ?>
+ <?php if (CONFIG['account']['publiclist']): ?>
<a href="/users.php">Users</a>
<?php endif; ?>
- <?php if (EMOTE_UPLOAD && (ANONYMOUS_UPLOAD || (isset($_SESSION["user_role"]) && $_SESSION["user_role"]["permission_upload"]))) {
+ <?php if (CONFIG['emote']['upload'] && (CONFIG['anonymous']['upload'] || (isset($_SESSION["user_role"]) && $_SESSION["user_role"]["permission_upload"]))) {
echo '<a href="/emotes/upload.php">Upload</a>';
} ?>
<a href="/account">Account</a>
@@ -44,7 +50,7 @@ authorize_user();
<div class="counter">
<?php
- $db = new PDO(DB_URL, DB_USER, DB_PASS);
+ $db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']);
$results = $db->query("SELECT COUNT(*) FROM emotes WHERE visibility = 1");
$count = $results->fetch()[0];