diff options
Diffstat (limited to 'emotes/index.php')
| -rw-r--r-- | emotes/index.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/emotes/index.php b/emotes/index.php index 80a8c1d..3999d8e 100644 --- a/emotes/index.php +++ b/emotes/index.php @@ -8,7 +8,7 @@ include "{$_SERVER['DOCUMENT_ROOT']}/lib/alert.php"; authorize_user(); -$db = new PDO(DB_URL, DB_USER, DB_PASS); +$db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']); $user_id = $_SESSION["user_id"] ?? ""; @@ -126,7 +126,7 @@ if (CLIENT_REQUIRES_JSON) { <head> <title><?php - echo ($emote != null ? "Emote " . $emote->get_code() : "Emotes") . ' - ' . INSTANCE_NAME + echo ($emote != null ? "Emote " . $emote->get_code() : "Emotes") . ' - ' . CONFIG['instance']['name'] ?></title> <link rel="stylesheet" href="/static/style.css"> <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"> @@ -302,9 +302,9 @@ if (CLIENT_REQUIRES_JSON) { if ($row = $stmt->fetch()) { echo 'You gave <img src="/static/img/icons/ratings/' . $row["rate"] . '.png" width="16" height="16"'; - echo 'title="' . RATING_NAMES[$row["rate"]] . '">'; + echo 'title="' . CONFIG['rating']['names'][$row["rate"]] . '">'; } else { - foreach (RATING_NAMES as $key => $value) { + foreach (CONFIG['rating']['names'] as $key => $value) { echo '<form action="/emotes/rate.php" method="POST">'; echo '<input type="text" name="id" value="' . $emote->get_id() . '"style="display: none;">'; echo "<input type=\"text\" name=\"rate\" value=\"$key\" style=\"display:none;\">"; @@ -316,7 +316,7 @@ if (CLIENT_REQUIRES_JSON) { } } } - if (REPORTS_ENABLE && $_SESSION["user_role"]["permission_report"]) { + if (CONFIG['reports']['enable'] && $_SESSION["user_role"]["permission_report"]) { echo "<a class='button red' href='/report?emote_id={$emote->id}'>Report emote</a>"; } } @@ -348,7 +348,7 @@ if (CLIENT_REQUIRES_JSON) { <tr> <th>Uploader</th> <td><?php - $username = ANONYMOUS_DEFAULT_NAME; + $username = CONFIG['anonymous']['defaultname']; $link = "#"; $show_private_badge = false; $badge = null; @@ -411,11 +411,11 @@ if (CLIENT_REQUIRES_JSON) { echo '</span></td></tr>'; } - if (RATING_ENABLE): ?> + if (CONFIG['rating']['enable']): ?> <tr> <th>Rating</th> <?php - if ($emote->get_rating()["total"] < RATING_EMOTE_MIN_VOTES) { + if ($emote->get_rating()["total"] < CONFIG['rating']['minvotes']) { echo '<td>Not rated (' . $emote->get_rating()["total"] . ')</td>'; } else { |
