Marketplace icons stuff

This commit is contained in:
2025-08-20 13:06:32 -07:00
parent b53fcd8773
commit 6024055e26
3 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<?php
require __DIR__ . '/../incl/util.php';
setJsonHeader();
checkClientDatabaseVersion();
$conn = newConnection();
$stmt = $conn->prepare("
SELECT c.data, u.username, u.id, c.price, c.name, c.uuid
FROM marketplaceicons c
JOIN users u ON c.userId = u.id
WHERE u.banned = 0 AND c.state = 1
ORDER BY c.id ASC
");
$stmt->execute();
$result = $stmt->get_result();
echo encrypt(json_encode(array_map(fn($row) => ['username' => $row['username'], 'userid' => $row['id'], 'data' => $row['data'], 'uuid' => $row['uuid'], 'price' => $row['price'], 'name' => base64_decode($row['name'])], $result->fetch_all(MYSQLI_ASSOC))));
$conn->close();