diff options
Diffstat (limited to 'public/emotes')
| -rw-r--r-- | public/emotes/setmanip.php | 18 | ||||
| -rw-r--r-- | public/emotes/upload.php | 28 |
2 files changed, 27 insertions, 19 deletions
diff --git a/public/emotes/setmanip.php b/public/emotes/setmanip.php index 71d922b..8e8d840 100644 --- a/public/emotes/setmanip.php +++ b/public/emotes/setmanip.php @@ -82,8 +82,10 @@ 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]); - $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") - ->execute([$user_id, "EMOTESET_ADD", json_encode($payload)]); + if (ACCOUNT_LOG_ACTIONS) { + $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") + ->execute([$user_id, "EMOTESET_ADD", json_encode($payload)]); + } $db = null; @@ -100,8 +102,10 @@ switch ($action) { exit; } - $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") - ->execute([$user_id, "EMOTESET_REMOVE", json_encode($payload)]); + if (ACCOUNT_LOG_ACTIONS) { + $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") + ->execute([$user_id, "EMOTESET_REMOVE", json_encode($payload)]); + } $db = null; @@ -137,8 +141,10 @@ 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]); - $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") - ->execute([$user_id, "EMOTESET_ALIAS", json_encode($payload)]); + if (ACCOUNT_LOG_ACTIONS) { + $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") + ->execute([$user_id, "EMOTESET_ALIAS", json_encode($payload)]); + } $db = null; diff --git a/public/emotes/upload.php b/public/emotes/upload.php index 42e58c6..96544fd 100644 --- a/public/emotes/upload.php +++ b/public/emotes/upload.php @@ -389,19 +389,21 @@ if ($is_manual) { } } -$db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") - ->execute([ - $uploaded_by, - "EMOTE_CREATE", - json_encode([ - "emote" => [ - "id" => $id, - "code" => $code, - "visibility" => $visibility, - "uploaded_by" => $uploaded_by, - ] - ]) - ]); +if (ACCOUNT_LOG_ACTIONS) { + $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") + ->execute([ + $uploaded_by, + "EMOTE_CREATE", + json_encode([ + "emote" => [ + "id" => $id, + "code" => $code, + "visibility" => $visibility, + "uploaded_by" => $uploaded_by, + ] + ]) + ]); +} $db = null; |
