diff options
Diffstat (limited to 'gaming/collection')
| -rw-r--r-- | gaming/collection/_lib.php | 366 | ||||
| -rw-r--r-- | gaming/collection/admin.php | 1 | ||||
| -rw-r--r-- | gaming/collection/consoles.php | 36 | ||||
| -rw-r--r-- | gaming/collection/consoles_jp.php | 1 | ||||
| -rw-r--r-- | gaming/collection/consoles_zh.php | 1 | ||||
| -rw-r--r-- | gaming/collection/games.json | 145 | ||||
| -rw-r--r-- | gaming/collection/hardware.php | 36 | ||||
| -rw-r--r-- | gaming/collection/hardware_jp.php | 1 | ||||
| -rw-r--r-- | gaming/collection/hardware_zh.php | 1 | ||||
| -rw-r--r-- | gaming/collection/images/.gitkeep | 0 | ||||
| -rw-r--r-- | gaming/collection/index.php | 36 | ||||
| -rw-r--r-- | gaming/collection/index_jp.php | 1 | ||||
| -rw-r--r-- | gaming/collection/index_zh.php | 1 | ||||
| -rw-r--r-- | gaming/collection/packs.php | 36 | ||||
| -rw-r--r-- | gaming/collection/packs_jp.php | 1 | ||||
| -rw-r--r-- | gaming/collection/packs_zh.php | 1 | ||||
| -rw-r--r-- | gaming/collection/tech.php | 4 | ||||
| -rw-r--r-- | gaming/collection/tech_jp.php | 1 | ||||
| -rw-r--r-- | gaming/collection/tech_zh.php | 1 | ||||
| -rw-r--r-- | gaming/collection/wishlist.php | 45 | ||||
| -rw-r--r-- | gaming/collection/wishlist_jp.php | 1 | ||||
| -rw-r--r-- | gaming/collection/wishlist_zh.php | 1 |
22 files changed, 717 insertions, 0 deletions
diff --git a/gaming/collection/_lib.php b/gaming/collection/_lib.php new file mode 100644 index 0000000..6208465 --- /dev/null +++ b/gaming/collection/_lib.php @@ -0,0 +1,366 @@ +<?php +// Shared helpers for /gaming/collection/ catalog pages. +// Structure inspired by small-web collection catalogs; content & style are SillyLaird's. + +require_once __DIR__ . '/../../partials/i18n.php'; + +function collection_lang(): string { + return _i18n_lang(); +} + +function collection_h(string $k): string { + return htmlspecialchars(t($k), ENT_QUOTES, 'UTF-8'); +} + +function collection_he(string $s): string { + return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); +} + +function collection_load(?string $path = null): array { + $path = $path ?? (__DIR__ . '/games.json'); + $empty = ['consoles' => [], 'hardware' => [], 'systems' => [], 'online' => []]; + if (!is_file($path)) { + return $empty; + } + $raw = file_get_contents($path); + if ($raw === false || trim($raw) === '') { + return $empty; + } + $data = json_decode($raw, true); + if (!is_array($data)) { + return $empty; + } + // Prefer consoles; fall back to legacy videogames key. + $consoles = $data['consoles'] ?? $data['videogames'] ?? []; + return [ + 'consoles' => is_array($consoles) ? $consoles : [], + 'hardware' => is_array($data['hardware'] ?? null) ? $data['hardware'] : [], + 'systems' => is_array($data['systems'] ?? null) ? $data['systems'] : [], + 'online' => is_array($data['online'] ?? null) ? $data['online'] : [], + ]; +} + +function collection_image_src(string $image): string { + $image = trim($image); + if ($image === '') { + return ''; + } + if (str_starts_with($image, 'http://') || str_starts_with($image, 'https://') || str_starts_with($image, '/')) { + return $image; + } + if (str_contains($image, '..') || str_contains($image, "\0")) { + return ''; + } + return '/gaming/collection/images/' . rawurlencode(basename($image)); +} + +function collection_status_class(string $status): string { + $slug = strtolower(preg_replace('/[^a-z0-9]+/i', '-', $status) ?? ''); + $slug = trim($slug, '-'); + return $slug !== '' ? 'status-' . $slug : 'status-other'; +} + +function collection_safe_href(string $url): string { + $url = trim($url); + if ($url === '') { + return ''; + } + if (str_starts_with($url, '/')) { + return str_starts_with($url, '//') ? '' : $url; + } + $scheme = strtolower((string)(parse_url($url, PHP_URL_SCHEME) ?? '')); + if (in_array($scheme, ['http', 'https', 'gemini', 'gopher'], true)) { + return $url; + } + return ''; +} + +/** + * Inventory rows (name :: model) from a flat list (consoles or hardware). + * @param list<array<string,mixed>> $items + * @return list<array{left:string,right:string,status:string,notes:string,image:string,url:string,specs:array<int,array{label:string,value:string}>}> + */ +function collection_inventory_rows(array $items): array { + $rows = []; + foreach ($items as $item) { + if (!is_array($item)) continue; + $name = trim((string)($item['name'] ?? '')); + $model = trim((string)($item['model'] ?? '')); + if ($name === '') continue; + if ($model === '') $model = $name; + $status = (string)($item['status'] ?? 'Owned'); + $rows[] = [ + 'left' => $name, + 'right' => $model, + 'status' => $status, + 'notes' => (string)($item['notes'] ?? ''), + 'image' => (string)($item['image'] ?? ''), + 'url' => '', + 'specs' => [ + ['label' => t('collection.spec_system'), 'value' => $name], + ['label' => t('collection.spec_status'), 'value' => $status], + ], + ]; + } + return $rows; +} + +/** Consoles inventory. */ +function collection_console_rows(array $data): array { + return collection_inventory_rows($data['consoles'] ?? []); +} + +/** Hardware inventory. */ +function collection_hardware_inventory_rows(array $data): array { + return collection_inventory_rows($data['hardware'] ?? []); +} + +/** @deprecated use collection_console_rows */ +function collection_videogame_rows(array $data): array { + return collection_console_rows($data); +} + +/** + * Video games library: titles under systems (system :: title). + * @return list<array{left:string,right:string,status:string,notes:string,image:string,url:string,specs:array<int,array{label:string,value:string}>}> + */ +function collection_games_library_rows(array $data): array { + $rows = []; + foreach (($data['systems'] ?? []) as $sys) { + if (!is_array($sys)) continue; + $left = (string)($sys['name'] ?? ''); + foreach (($sys['games'] ?? []) as $game) { + if (!is_array($game)) continue; + $title = trim((string)($game['title'] ?? '')); + if ($title === '') continue; + $status = (string)($game['status'] ?? 'Owned'); + $rows[] = [ + 'left' => $left, + 'right' => $title, + 'status' => $status, + 'notes' => (string)($game['notes'] ?? ''), + 'image' => (string)($game['image'] ?? ''), + 'url' => '', + 'specs' => [ + ['label' => t('collection.spec_system'), 'value' => $left], + ['label' => t('collection.spec_status'), 'value' => $status], + ], + ]; + } + } + return $rows; +} + +/** @deprecated */ +function collection_tech_rows(array $data): array { + return collection_games_library_rows($data); +} + +/** @deprecated */ +function collection_hardware_rows(array $data): array { + return collection_games_library_rows($data); +} + +/** + * Flatten online song packs into catalog rows. + * @return list<array{left:string,right:string,status:string,notes:string,image:string,url:string,specs:array<int,array{label:string,value:string}>}> + */ +function collection_pack_rows(array $data): array { + $rows = []; + foreach ($data['online'] as $cat) { + if (!is_array($cat)) continue; + $left = (string)($cat['name'] ?? ''); + foreach (($cat['entries'] ?? []) as $entry) { + if (!is_array($entry)) continue; + $title = trim((string)($entry['title'] ?? '')); + if ($title === '') continue; + $status = (string)($entry['status'] ?? 'Owned'); + $url = (string)($entry['url'] ?? ''); + $specs = [ + ['label' => t('collection.spec_game'), 'value' => $left], + ['label' => t('collection.spec_status'), 'value' => $status], + ]; + if ($url !== '') { + $specs[] = ['label' => t('collection.spec_link'), 'value' => t('collection.spec_link_yes')]; + } + $rows[] = [ + 'left' => $left, + 'right' => $title, + 'status' => $status, + 'notes' => (string)($entry['notes'] ?? ''), + 'image' => (string)($entry['image'] ?? ''), + 'url' => $url, + 'specs' => $specs, + ]; + } + } + return $rows; +} + +/** + * @param list<array{left:string,right:string,status:string,notes:string,image:string,url:string,specs:array}> $rows + * @return list<array{left:string,right:string,status:string,notes:string,image:string,url:string,specs:array}> + */ +function collection_filter_wishlist(array $rows): array { + return array_values(array_filter( + $rows, + static fn(array $r) => strcasecmp((string)($r['status'] ?? ''), 'Wishlist') === 0 + )); +} + +/** + * Render one catalog row (photo + name + icon-style specs). + * @param array{left:string,right:string,status:string,notes:string,image:string,url:string,specs?:array} $row + */ +function collection_render_row(array $row): void { + $left = (string)($row['left'] ?? ''); + $right = (string)($row['right'] ?? ''); + $status = (string)($row['status'] ?? 'Owned'); + $notes = (string)($row['notes'] ?? ''); + $img = collection_image_src((string)($row['image'] ?? '')); + $href = collection_safe_href((string)($row['url'] ?? '')); + $specs = is_array($row['specs'] ?? null) ? $row['specs'] : []; + $he = 'collection_he'; + $h = 'collection_h'; + ?> + <div class="gc-row"> + <div class="gc-pic"> + <?php if ($img !== ''): ?> + <a href="<?= $he($img) ?>" target="_blank" rel="noopener noreferrer"> + <img src="<?= $he($img) ?>" alt="" loading="lazy" decoding="async" width="200" height="150" /> + </a> + <?php else: ?> + <div class="gc-pic-empty" aria-hidden="true">no photo</div> + <?php endif; ?> + </div> + <div class="gc-body"> + <p class="gc-name"> + <?php if ($href !== ''): ?> + <a href="<?= $he($href) ?>" target="_blank" rel="noopener noreferrer"><?= $he($left) ?></a> + <span class="gc-colon">::</span> + <a href="<?= $he($href) ?>" target="_blank" rel="noopener noreferrer"><?= $he($right) ?></a> + <?php else: ?> + <span class="gc-nick"><?= $he($left) ?></span> + <span class="gc-colon">::</span> + <span class="gc-model"><?= $he($right) ?></span> + <?php endif; ?> + </p> + <?php if ($notes !== ''): ?> + <p class="gc-note"><em><?= nl2br($he($notes)) ?></em></p> + <?php endif; ?> + <p class="gc-specs"> + <?php foreach ($specs as $spec): + $label = (string)($spec['label'] ?? ''); + $value = (string)($spec['value'] ?? ''); + if ($value === '') continue; + ?> + <span class="gc-spec"> + <span class="gc-spec-ico" title="<?= $he($label) ?>" aria-hidden="true"><?= $he(mb_substr($label, 0, 1)) ?></span> + <span class="gc-spec-val"><?= $he($value) ?></span> + </span> + <?php endforeach; ?> + <?php if ($href !== ''): ?> + <span class="gc-spec"> + <span class="gc-spec-ico" aria-hidden="true">↗</span> + <a class="gc-spec-val" href="<?= $he($href) ?>" target="_blank" rel="noopener noreferrer"><?= $h('collection.visit_product') ?></a> + </span> + <?php endif; ?> + </p> + </div> + </div> + <?php +} + +/** + * Shared page shell open (head + header + title + menu). + * @param 'games'|'consoles'|'hardware'|'packs'|'wishlist' $active + */ +function collection_page_open(string $active, string $pageTitle, string $pageDesc, string $baseFile): void { + $lang = collection_lang(); + $langAttr = ['en' => 'en', 'ja' => 'ja', 'zh' => 'zh'][$lang] ?? 'en'; + $suffix = ['en' => '', 'ja' => '_jp', 'zh' => '_zh'][$lang] ?? ''; + $selfName = $baseFile . $suffix . '.php'; + if ($baseFile === 'index' && $lang === 'en') { + $selfUrl = 'https://www.sillylaird.ca/gaming/collection/'; + $enUrl = 'https://www.sillylaird.ca/gaming/collection/'; + } else { + $selfUrl = 'https://www.sillylaird.ca/gaming/collection/' . $selfName; + $enUrl = 'https://www.sillylaird.ca/gaming/collection/' . ($baseFile === 'index' ? '' : $baseFile . '.php'); + if ($baseFile === 'index') { + $enUrl = 'https://www.sillylaird.ca/gaming/collection/'; + } + } + $jaUrl = 'https://www.sillylaird.ca/gaming/collection/' . $baseFile . '_jp.php'; + $zhUrl = 'https://www.sillylaird.ca/gaming/collection/' . $baseFile . '_zh.php'; + if ($baseFile === 'index') { + $jaUrl = 'https://www.sillylaird.ca/gaming/collection/index_jp.php'; + $zhUrl = 'https://www.sillylaird.ca/gaming/collection/index_zh.php'; + } + $h = 'collection_h'; + // Video Games / Consoles / Hardware / Song Packs / Wishlist + if ($lang === 'ja') { + $hrefGames = '/gaming/collection/index_jp.php'; + $hrefCons = '/gaming/collection/consoles_jp.php'; + $hrefHw = '/gaming/collection/hardware_jp.php'; + $hrefPk = '/gaming/collection/packs_jp.php'; + $hrefWl = '/gaming/collection/wishlist_jp.php'; + } elseif ($lang === 'zh') { + $hrefGames = '/gaming/collection/index_zh.php'; + $hrefCons = '/gaming/collection/consoles_zh.php'; + $hrefHw = '/gaming/collection/hardware_zh.php'; + $hrefPk = '/gaming/collection/packs_zh.php'; + $hrefWl = '/gaming/collection/wishlist_zh.php'; + } else { + $hrefGames = '/gaming/collection/'; + $hrefCons = '/gaming/collection/consoles.php'; + $hrefHw = '/gaming/collection/hardware.php'; + $hrefPk = '/gaming/collection/packs.php'; + $hrefWl = '/gaming/collection/wishlist.php'; + } + $act = static fn(string $key) => $active === $key ? ' class="gc-menu-active" id="gc-main"' : ''; + ?> +<!doctype html> +<html lang="<?= $langAttr ?>"> +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width,initial-scale=1" /> + <title><?= collection_he($pageTitle) ?></title> + <?php + $meta = [ + 'lang' => $lang, + 'title' => $pageTitle, + 'desc' => $pageDesc, + 'base' => 'gaming/collection/' . $baseFile, + 'self_url' => $selfUrl, + 'en_url' => $enUrl, + 'x_default' => $enUrl, + 'ja_url' => $jaUrl, + 'zh_url' => $zhUrl, + ]; + include __DIR__ . '/../../partials/head_meta.php'; + ?> + <link rel="stylesheet" href="/assets/css/fonts.css" /> + <link rel="stylesheet" href="/assets/css/site.css" /> + <link rel="stylesheet" href="/assets/css/skeleton.css" /> + <link rel="stylesheet" href="/assets/css/pages/collection.css" /> +</head> +<body class="gc-page"> + <a class="skip-link" href="#main"><?= $h('common.skip') ?></a> + <?php include __DIR__ . '/../../partials/header.php'; ?> + + <main id="main" class="wrap gc-wrap"> + <p class="gc-title"><?= $h('collection.h1') ?></p> + <nav class="gc-menu" aria-label="<?= $h('collection.jump_nav') ?>"> + <a href="<?= collection_he($hrefGames) ?>"<?= $act('games') ?>><?= $h('collection.menu_games') ?></a><span class="gc-menu-sep">/</span><a href="<?= collection_he($hrefCons) ?>"<?= $act('consoles') ?>><?= $h('collection.menu_consoles') ?></a><span class="gc-menu-sep">/</span><a href="<?= collection_he($hrefHw) ?>"<?= $act('hardware') ?>><?= $h('collection.menu_hardware') ?></a><span class="gc-menu-sep">/</span><a href="<?= collection_he($hrefPk) ?>"<?= $act('packs') ?>><?= $h('collection.menu_packs') ?></a><span class="gc-menu-sep">/</span><a href="<?= collection_he($hrefWl) ?>"<?= $act('wishlist') ?>><?= $h('collection.menu_wishlist') ?></a> + </nav> + <?php +} + +function collection_page_close(): void { + ?> + </main> + <?php include __DIR__ . '/../../partials/footer.php'; ?> +</body> +</html> + <?php +} diff --git a/gaming/collection/admin.php b/gaming/collection/admin.php new file mode 100644 index 0000000..487e181 --- /dev/null +++ b/gaming/collection/admin.php @@ -0,0 +1 @@ +<?php header('Location: /admin.php?section=collection', true, 302); exit; diff --git a/gaming/collection/consoles.php b/gaming/collection/consoles.php new file mode 100644 index 0000000..d0aae70 --- /dev/null +++ b/gaming/collection/consoles.php @@ -0,0 +1,36 @@ +<?php +/** + * Consoles inventory (name :: model). + */ +require_once __DIR__ . '/_lib.php'; + +$data = collection_load(); +$rows = collection_console_rows($data); + +collection_page_open( + 'consoles', + t('collection.consoles_title'), + t('collection.consoles_blurb'), + 'consoles' +); +?> + <p class="gc-page-blurb"><?= collection_h('collection.consoles_blurb') ?></p> + <p class="gc-count"><?= count($rows) ?> <?= collection_h('collection.consoles_label') ?></p> + +<?php if (!$rows): ?> + <p class="gc-empty"><?= collection_h('collection.consoles_empty') ?></p> +<?php else: ?> + <div class="gc-catalog"> +<?php foreach ($rows as $row) { + collection_render_row($row); +} ?> + </div> +<?php endif; ?> + + <p class="gc-footer-hint"> + <a href="/gaming/collection/"><?= collection_h('collection.menu_games') ?></a> + · + <a href="/gaming/"><?= collection_h('collection.back_gaming') ?></a> + </p> +<?php +collection_page_close(); diff --git a/gaming/collection/consoles_jp.php b/gaming/collection/consoles_jp.php new file mode 100644 index 0000000..af85a23 --- /dev/null +++ b/gaming/collection/consoles_jp.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/consoles.php'; diff --git a/gaming/collection/consoles_zh.php b/gaming/collection/consoles_zh.php new file mode 100644 index 0000000..af85a23 --- /dev/null +++ b/gaming/collection/consoles_zh.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/consoles.php'; diff --git a/gaming/collection/games.json b/gaming/collection/games.json new file mode 100644 index 0000000..f60562d --- /dev/null +++ b/gaming/collection/games.json @@ -0,0 +1,145 @@ +{ + "consoles": [ + { + "id": "snes", + "name": "SNES", + "model": "Super Nintendo Entertainment System", + "status": "Owned", + "notes": "Retro living-room console", + "image": "" + }, + { + "id": "popn-cab", + "name": "Pop'n Music", + "model": "Cabinet / controller setup", + "status": "Owned", + "notes": "Pop'n buttons / cabinet or sim", + "image": "" + } + ], + "hardware": [ + { + "id": "dtx-cab", + "name": "DTXMania", + "model": "Drum cabinet / sim rig", + "status": "Playing", + "notes": "Local DTX drum hardware setup", + "image": "" + } + ], + "systems": [ + { + "id": "snes", + "name": "SNES", + "games": [ + { + "id": "smw", + "title": "Super Mario World", + "status": "Owned", + "notes": "Super Scope ready", + "image": "" + } + ] + }, + { + "id": "dtxmania", + "name": "DTXMania", + "games": [ + { + "id": "dtx-setup", + "title": "DTXMania NX", + "status": "Playing", + "notes": "Software / setup notes", + "image": "" + } + ] + }, + { + "id": "popn", + "name": "Pop'n Music", + "games": [ + { + "id": "popn-cabinet", + "title": "Pop'n Music (cabinet / sim)", + "status": "Owned", + "notes": "Cabinet / sim title entry", + "image": "" + } + ] + } + ], + "online": [ + { + "id": "popn-lively", + "name": "Pop'n Music Lively", + "entries": [ + { + "id": "popn-starter", + "title": "Starter Pack", + "url": "https://p.eagate.573.jp/game/popn/lively/", + "status": "Owned", + "notes": "Base song set", + "image": "" + }, + { + "id": "popn-music-pack-1", + "title": "Music Pack", + "url": "https://p.eagate.573.jp/game/popn/lively/", + "status": "Wishlist", + "notes": "DLC song pack", + "image": "" + } + ] + }, + { + "id": "gitadora", + "name": "GITADORA", + "entries": [ + { + "id": "gfdm-music-pack-1", + "title": "Music Pack", + "url": "https://p.eagate.573.jp/game/gfdm/", + "status": "Wishlist", + "notes": "GITADORA song pack", + "image": "" + } + ] + }, + { + "id": "iidx-infinitas", + "name": "beatmania IIDX INFINITAS", + "entries": [ + { + "id": "iidx-music-pack-1", + "title": "Music Pack", + "url": "https://p.eagate.573.jp/game/2dx/inf/", + "status": "Wishlist", + "notes": "INFINITAS song pack", + "image": "" + } + ] + }, + { + "id": "simulators", + "name": "Simulators & tools", + "entries": [ + { + "id": "dtxmania-nx", + "title": "DTXMania NX", + "url": "https://github.com/limyz/DTXManiaNX", + "status": "Playing", + "notes": "Open-source DTX drum simulator", + "image": "" + }, + { + "id": "stepmania", + "title": "StepMania", + "url": "https://www.stepmania.com/", + "status": "Owned", + "notes": "Open-source dance game engine", + "image": "" + } + ] + } + ] +} diff --git a/gaming/collection/hardware.php b/gaming/collection/hardware.php new file mode 100644 index 0000000..62cae6e --- /dev/null +++ b/gaming/collection/hardware.php @@ -0,0 +1,36 @@ +<?php +/** + * Hardware inventory (name :: model). + */ +require_once __DIR__ . '/_lib.php'; + +$data = collection_load(); +$rows = collection_hardware_inventory_rows($data); + +collection_page_open( + 'hardware', + t('collection.hardware_title'), + t('collection.hardware_page_blurb'), + 'hardware' +); +?> + <p class="gc-page-blurb"><?= collection_h('collection.hardware_page_blurb') ?></p> + <p class="gc-count"><?= count($rows) ?> <?= collection_h('collection.hardware_label') ?></p> + +<?php if (!$rows): ?> + <p class="gc-empty"><?= collection_h('collection.hardware_empty') ?></p> +<?php else: ?> + <div class="gc-catalog"> +<?php foreach ($rows as $row) { + collection_render_row($row); +} ?> + </div> +<?php endif; ?> + + <p class="gc-footer-hint"> + <a href="/gaming/collection/"><?= collection_h('collection.menu_games') ?></a> + · + <a href="/gaming/"><?= collection_h('collection.back_gaming') ?></a> + </p> +<?php +collection_page_close(); diff --git a/gaming/collection/hardware_jp.php b/gaming/collection/hardware_jp.php new file mode 100644 index 0000000..bc9dcf4 --- /dev/null +++ b/gaming/collection/hardware_jp.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/hardware.php'; diff --git a/gaming/collection/hardware_zh.php b/gaming/collection/hardware_zh.php new file mode 100644 index 0000000..bc9dcf4 --- /dev/null +++ b/gaming/collection/hardware_zh.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/hardware.php'; diff --git a/gaming/collection/images/.gitkeep b/gaming/collection/images/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/gaming/collection/images/.gitkeep diff --git a/gaming/collection/index.php b/gaming/collection/index.php new file mode 100644 index 0000000..a2e3fa7 --- /dev/null +++ b/gaming/collection/index.php @@ -0,0 +1,36 @@ +<?php +/** + * Video Games — title library (system :: title). + */ +require_once __DIR__ . '/_lib.php'; + +$data = collection_load(); +$rows = collection_games_library_rows($data); + +collection_page_open( + 'games', + t('collection.title'), + t('collection.desc'), + 'index' +); +?> + <p class="gc-page-blurb"><?= collection_h('collection.games_blurb') ?></p> + <p class="gc-count"><?= count($rows) ?> <?= collection_h('collection.games_label') ?></p> + +<?php if (!$rows): ?> + <p class="gc-empty"><?= collection_h('collection.empty') ?></p> +<?php else: ?> + <div class="gc-catalog"> +<?php foreach ($rows as $row) { + collection_render_row($row); +} ?> + </div> +<?php endif; ?> + + <p class="gc-footer-hint"> + <a href="/gaming/"><?= collection_h('collection.back_gaming') ?></a> + · + <a href="/"><?= collection_h('collection.back_home') ?></a> + </p> +<?php +collection_page_close(); diff --git a/gaming/collection/index_jp.php b/gaming/collection/index_jp.php new file mode 100644 index 0000000..50bbcec --- /dev/null +++ b/gaming/collection/index_jp.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/index.php'; diff --git a/gaming/collection/index_zh.php b/gaming/collection/index_zh.php new file mode 100644 index 0000000..50bbcec --- /dev/null +++ b/gaming/collection/index_zh.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/index.php'; diff --git a/gaming/collection/packs.php b/gaming/collection/packs.php new file mode 100644 index 0000000..a8e216f --- /dev/null +++ b/gaming/collection/packs.php @@ -0,0 +1,36 @@ +<?php +/** + * Song packs catalog page. + */ +require_once __DIR__ . '/_lib.php'; + +$data = collection_load(); +$rows = collection_pack_rows($data); + +collection_page_open( + 'packs', + t('collection.packs_title'), + t('collection.online_subtitle'), + 'packs' +); +?> + <p class="gc-page-blurb"><?= collection_h('collection.online_subtitle') ?></p> + <p class="gc-count"><?= count($rows) ?> <?= collection_h('collection.online_links_label') ?></p> + +<?php if (!$rows): ?> + <p class="gc-empty"><?= collection_h('collection.online_empty') ?></p> +<?php else: ?> + <div class="gc-catalog"> +<?php foreach ($rows as $row) { + collection_render_row($row); +} ?> + </div> +<?php endif; ?> + + <p class="gc-footer-hint"> + <a href="/gaming/collection/"><?= collection_h('collection.menu_hardware') ?></a> + · + <a href="/gaming/"><?= collection_h('collection.back_gaming') ?></a> + </p> +<?php +collection_page_close(); diff --git a/gaming/collection/packs_jp.php b/gaming/collection/packs_jp.php new file mode 100644 index 0000000..3ffa479 --- /dev/null +++ b/gaming/collection/packs_jp.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/packs.php'; diff --git a/gaming/collection/packs_zh.php b/gaming/collection/packs_zh.php new file mode 100644 index 0000000..3ffa479 --- /dev/null +++ b/gaming/collection/packs_zh.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/packs.php'; diff --git a/gaming/collection/tech.php b/gaming/collection/tech.php new file mode 100644 index 0000000..1e158ee --- /dev/null +++ b/gaming/collection/tech.php @@ -0,0 +1,4 @@ +<?php +// Legacy URL: former Library/Tech page → Video Games (title library). +header('Location: /gaming/collection/', true, 302); +exit; diff --git a/gaming/collection/tech_jp.php b/gaming/collection/tech_jp.php new file mode 100644 index 0000000..103a452 --- /dev/null +++ b/gaming/collection/tech_jp.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/tech.php'; diff --git a/gaming/collection/tech_zh.php b/gaming/collection/tech_zh.php new file mode 100644 index 0000000..103a452 --- /dev/null +++ b/gaming/collection/tech_zh.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/tech.php'; diff --git a/gaming/collection/wishlist.php b/gaming/collection/wishlist.php new file mode 100644 index 0000000..47fa2a4 --- /dev/null +++ b/gaming/collection/wishlist.php @@ -0,0 +1,45 @@ +<?php +/** + * Wishlist — games, consoles, hardware, and song packs marked Wishlist. + */ +require_once __DIR__ . '/_lib.php'; + +$data = collection_load(); +$rows = collection_filter_wishlist(array_merge( + collection_games_library_rows($data), + collection_console_rows($data), + collection_hardware_inventory_rows($data), + collection_pack_rows($data) +)); + +collection_page_open( + 'wishlist', + t('collection.wishlist_title'), + t('collection.wishlist_blurb'), + 'wishlist' +); +?> + <p class="gc-page-blurb"><?= collection_h('collection.wishlist_blurb') ?></p> + <p class="gc-count"><?= count($rows) ?> <?= collection_h('collection.wishlist_count') ?></p> + +<?php if (!$rows): ?> + <p class="gc-empty"><?= collection_h('collection.wishlist_empty') ?></p> +<?php else: ?> + <div class="gc-catalog"> +<?php foreach ($rows as $row) { + collection_render_row($row); +} ?> + </div> +<?php endif; ?> + + <p class="gc-footer-hint"> + <a href="/gaming/collection/"><?= collection_h('collection.menu_games') ?></a> + · + <a href="/gaming/collection/consoles.php"><?= collection_h('collection.menu_consoles') ?></a> + · + <a href="/gaming/collection/hardware.php"><?= collection_h('collection.menu_hardware') ?></a> + · + <a href="/gaming/collection/packs.php"><?= collection_h('collection.menu_packs') ?></a> + </p> +<?php +collection_page_close(); diff --git a/gaming/collection/wishlist_jp.php b/gaming/collection/wishlist_jp.php new file mode 100644 index 0000000..8ed194a --- /dev/null +++ b/gaming/collection/wishlist_jp.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/wishlist.php'; diff --git a/gaming/collection/wishlist_zh.php b/gaming/collection/wishlist_zh.php new file mode 100644 index 0000000..8ed194a --- /dev/null +++ b/gaming/collection/wishlist_zh.php @@ -0,0 +1 @@ +<?php require __DIR__ . '/wishlist.php'; |
