diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-09 01:43:12 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-09 01:43:12 +0500 |
| commit | 29477e67ede12347b153e2255325327374e1b073 (patch) | |
| tree | be9170a20d332eab1fcc8b380f70f231921aac45 /emotes/setmanip.php | |
| parent | 28bb4f3618e2e947d14a05a24e99d826c26c0ce3 (diff) | |
feat: new configuration
Diffstat (limited to 'emotes/setmanip.php')
| -rw-r--r-- | emotes/setmanip.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/emotes/setmanip.php b/emotes/setmanip.php index cf8add6..d6a5f4f 100644 --- a/emotes/setmanip.php +++ b/emotes/setmanip.php @@ -18,7 +18,7 @@ if (!isset($_POST["id"], $_POST["action"], $_POST["emote_set_id"])) { exit; } -$db = new PDO(DB_URL, DB_USER, DB_PASS); +$db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']); // checking emote $emote_id = $_POST["id"]; @@ -62,7 +62,7 @@ switch ($action) { $stmt = $db->prepare("INSERT INTO emote_set_contents(emote_set_id, emote_id, added_by) VALUES (?, ?, ?)"); $stmt->execute([$emote_set_id, $emote_id, $user_id]); - if (ACCOUNT_LOG_ACTIONS) { + if (CONFIG['account']['log']) { $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") ->execute([$user_id, "EMOTESET_ADD", json_encode($payload)]); } @@ -82,7 +82,7 @@ switch ($action) { exit; } - if (ACCOUNT_LOG_ACTIONS) { + if (CONFIG['account']['log']) { $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") ->execute([$user_id, "EMOTESET_REMOVE", json_encode($payload)]); } @@ -98,7 +98,7 @@ switch ($action) { exit; } - $value = str_safe($_POST["value"], EMOTE_NAME_MAX_LENGTH); + $value = str_safe($_POST["value"], CONFIG['emote']['maxnamelength']); $stmt = $db->prepare("SELECT esc.code AS alias_code, e.code FROM emote_set_contents esc INNER JOIN emotes e ON e.id = esc.emote_id @@ -121,7 +121,7 @@ switch ($action) { $stmt = $db->prepare("UPDATE emote_set_contents SET code = ? WHERE emote_set_id = ? AND emote_id = ?"); $stmt->execute([$value, $emote_set_id, $emote_id]); - if (ACCOUNT_LOG_ACTIONS) { + if (CONFIG['account']['log']) { $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") ->execute([$user_id, "EMOTESET_ALIAS", json_encode($payload)]); } |
