diff --git a/.gitignore b/.gitignore index 81ab70f..bb6941f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,12 @@ assets/uploads/wiki/* assets/uploads/profiles/* !assets/uploads/profiles/.htaccess !assets/uploads/profiles/.gitkeep +assets/uploads/bugs/* +!assets/uploads/bugs/.htaccess +!assets/uploads/bugs/.gitkeep +assets/uploads/gear/* +!assets/uploads/gear/.htaccess +!assets/uploads/gear/.gitkeep # Kacheln, Marker und Icons der Karte (~230 MB) - werden per FTP hochgeladen, siehe README assets/map/data/ __pycache__/ diff --git a/admin/gear_items.php b/admin/gear_items.php new file mode 100644 index 0000000..44a924c --- /dev/null +++ b/admin/gear_items.php @@ -0,0 +1,175 @@ +query('SELECT slot, COUNT(*) FROM gear_items GROUP BY slot ORDER BY slot')->fetchAll(PDO::FETCH_KEY_PAIR); +if (!isset($slotNames[$slotFilter])) { + $slotFilter = ''; +} + +$conditions = []; +$params = []; +if ($query !== '') { + $conditions[] = '(g.name LIKE ? OR g.id = ?)'; + $params[] = '%' . addcslashes($query, '%_\\') . '%'; + $params[] = ctype_digit($query) ? (int) $query : 0; +} +if ($slotFilter !== '') { + $conditions[] = 'g.slot = ?'; + $params[] = $slotFilter; +} +$where = $conditions ? 'WHERE ' . implode(' AND ', $conditions) : ''; + +$countStmt = db()->prepare("SELECT COUNT(*) FROM gear_items g $where"); +$countStmt->execute($params); +$total = (int) $countStmt->fetchColumn(); +$perPage = 50; +$pageCount = max(1, (int) ceil($total / $perPage)); +$page = min($pageCount, max(1, (int) ($_GET['page'] ?? 1))); +$stmt = db()->prepare( + "SELECT g.*, (SELECT COUNT(*) FROM gear_set_slots s WHERE s.item_id = g.id) AS used + FROM gear_items g $where ORDER BY g.item_level DESC, g.name LIMIT $perPage OFFSET " . (($page - 1) * $perPage) +); +$stmt->execute($params); +$items = array_map('gear_item_decode', $stmt->fetchAll()); +$allIds = array_map('intval', db()->query('SELECT id FROM gear_items ORDER BY checked_at, id')->fetchAll(PDO::FETCH_COLUMN)); +$lastVersion = (string) db()->query('SELECT source_version FROM gear_items ORDER BY checked_at DESC LIMIT 1')->fetchColumn(); + +$listUrl = static function (array $overrides = []) use ($query, $slotFilter): string { + $params = array_filter(array_merge(['q' => $query, 'slot' => $slotFilter], $overrides), static fn ($v): bool => $v !== '' && $v !== null); + return '/admin/gear_items.php?' . ($params ? http_build_query($params) . '&' : ''); +}; + +$pageTitle = 'Gear-Planer: Gegenstände'; +$containerWide = true; +include __DIR__ . '/../includes/header.php'; +?> +
+ Werte kommen von aion2hub.com + (aus dem Global-Client ausgelesen). Abgerufen wird immer nur eine Seite pro Sekunde und nur auf Knopfdruck. + Zuletzt abgeglichener Stand: = e($lastVersion) ?>. +
+ +
+ Gegenstands-ID, Link zu einem Gegenstand (aion2hub.com/database/items/110130060) oder
+ eine Listen-Seite (z.B. aion2hub.com/database?cat=Armor&grade=Unique - übernimmt
+ alle Gegenstände dieser Seite, bis zu 60).
+
= $query !== '' || $slotFilter !== '' ? 'Nichts gefunden.' : 'Noch keine Gegenstände übernommen.' ?>
+ +| Gegenstand | +Slot | +Stufe | +Sockel | +Aufwertung | +Geprüft | +In Sets | ++ |
|---|---|---|---|---|---|---|---|
|
+
+ |
+ = e($item['slot']) ?>= $item['item_type'] !== $item['slot'] ? ' ' . e($item['item_type']) . ' ' : '' ?> |
+ = (int) $item['item_level'] ?> | += (int) $item['manastone_slots'] ?>= (int) $item['godstone_slots'] ? ' + ' . (int) $item['godstone_slots'] . ' G' : '' ?> | ++ = (int) $item['enchant_max'] ? '+' . (int) $item['enchant_max'] : '–' ?> + = (int) $item['exceed_max'] ? ' · ⬆' . (int) $item['exceed_max'] : '' ?> + | += $item['checked_at'] ? e(date('d.m.Y', strtotime((string) $item['checked_at']))) : '–' ?> | += (int) $item['used'] ?> | ++ + + | +