prepare("DELETE FROM mods_pending WHERE slug = ?"); if (!$statement) { $errorMessage = "An unexpected error occurred while removing the mod."; } else { $modSlug = $modDataToDiscard['slug']; $statement->bind_param('s', $modSlug); if (!$statement->execute()) { $errorMessage = "An unexpected error occurred while removing the mod."; } else { $statement = $connection->prepare("UPDATE mods SET is_removed = 1 WHERE slug = ?"); if (!$statement) { $errorMessage = "An unexpected error occurred while removing the mod."; } else { $modSlug = $modDataToRemove['slug']; $statement->bind_param('s', $modSlug); if (!$statement->execute()) { $errorMessage = "An unexpected error occurred while removing the mod."; } else { $modRemoved = true; } $statement->close(); } } } } } } if (!$modRemoved) { $pageTitle = "Remove mod"; $pageDescription = "Remove a pending SVR.JS mod in SVR.JS Mods directory."; } else { $pageTitle = "Mod removed"; $pageDescription = "The mod has been removed."; } include 'header.php'; ?>

Mod removed

The mod has been removed.

View mods

Remove mod

Are you sure to remove the mod?

' . htmlspecialchars($errorMessage) . '

'; ?>
query("SELECT email AS address, username AS name FROM users WHERE is_moderator = 1;"); if ($moderatorResult) { $moderators = []; while ($moderator = $moderatorResult->fetch_assoc()) { array_push($moderators, $moderator); } sendEmail($moderators, 'A mod has been removed', "A mod has been removed:\n\nMod name: " . str_replace(["\r\n", "\r", "\n"], '', $modDataToRemove['name']) . "\nSlug: " . $modDataToRemove['slug'] . "\n\nNo action is required."); } } ?>