/www/frodo
/www/gamestick-api-docs.htm
/www/game/
+/www/index.htm
mkdir($wwwDiscoverDir, 0755);
}
-/*
-$gameFiles = [
- '../game-data/classic/de.eiswuxe.blookid.json',
- '../game-data/classic/com.Refresh_Creations_Ltd.Super_Grid_Run.json',//video
- '../game-data/classic/com.ubisoft.princeofpersia.shadowandflame.ggp.json',//achievements
- '../game-data/classic/com.crescentmoongames.mimpi.json',//products
-];
-*/
+$contentDir = __DIR__ . '/../content/';
$mainNav = [
'discover/' => 'Games',
'discover/media.htm' => 'Media',
- //'/' => 'About',
+ '/' => 'About',
];
$subNav = [
'discover/' => 'Featured',
}
+//Content pages
+file_put_contents(
+ $wwwDir . 'index.htm',
+ renderContentPage(
+ 'PlayJam GameStick community server', 'index.htm',
+ $mainNav, [], '/'
+ )
+);
+
+
+function renderContentPage(
+ string $title, string $path,
+ array $mainNav, array $subNav,
+ string $mainNavActivePath, string $subNavActivePath = null
+): string {
+ $content = file_get_contents($GLOBALS['contentDir'] . $path);
+ $canonicalUrl = $GLOBALS['baseUrl'] . $path;
+ $pageTemplate = __DIR__ . '/../data/templates/page.tpl.php';
+
+ ob_start();
+ include $pageTemplate;
+ $html = ob_get_contents();
+ ob_end_clean();
+
+ return $html;
+}
+
function renderGameFile($gameDataFile, $path): string
{
$json = json_decode(file_get_contents($gameDataFile));
--- /dev/null
+<h1>PlayJam GameStick community server</h1>
+<p>
+ The <em>PlayJam GameStick</em> was an Android based gaming micro-console,
+ released in 2013.
+ <a href="https://cweiske.de/tagebuch/gamestick-timeline.htm" title="PlayJam GameStick timeline">In 2017</a>
+ the official server shut down,
+ bricking the GameSticks that need the server to function.
+</p>
+<p>
+ After several years of dedicated work,
+ the
+ <a href="https://cweiske.de/gamestick-api-docs.htm" title="PlayJam GameStick server API documentation">server API</a>
+ has been reverse engineered and documented,
+ <a href="https://codeberg.org/gamestick-fans/game-data">meta data</a>
+ of all 188 games have been collected,
+ game files and firmware version have been
+ <a href="https://archive.org/details/gamesticklibrary" title="The GameStick library @ Internet Archive">archived</a>
+ and a replacement server software has been
+ <a href="https://codeberg.org/gamestick-fans/pjgsapi/" title="pjgsapi">implemented</a>.
+</p>
+<p>
+ This community server lets you register a new user account for brand new
+ or factory reset GameSticks, browse the <a href="discover/" title="games">game library</a>,
+ download and nearly all of the games!
+</p>
+<p>
+ Because not all games have been archived yet, GameSticks need to be manually
+ whitelisted - see the
+ <a href="https://cweiske.de/tagebuch/gamestick-server-public.htm#whitelisting" title="GameStick server: Semi-public alpha">blog post</a>
+ for more information about that.
+</p>
+
+<img src="img/box-gamestick.2048.jpg" alt="GameStick box cover" width="2048" height="2048"/>
--- /dev/null
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+ <head>
+ <meta charset="utf-8"/>
+ <title><?= htmlspecialchars($title); ?></title>
+ <meta name="generator" content="pjgsapi"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <link rel="stylesheet" type="text/css" href="css/discover.css"/>
+ <link rel="icon" href="img/faviconnew.png"/>
+ <link rel="canonical" href="<?= htmlspecialchars($canonicalUrl) ?>"/>
+ </head>
+ <body>
+ <header>
+ <a href="/">
+ <img src="img/logo_2.png" width="176" height="24"
+ alt="PlayJam GameStick Logo"/>
+ </a>
+ </header>
+
+ <?php if (count($subNav)): ?>
+ <nav id="subnav">
+ <ul>
+ <?php foreach ($subNav as $navUrl => $navTitle): ?>
+ <?php if ($navUrl == $path || $navUrl === $subNavActivePath): ?>
+ <li class="active"><a href="<?= htmlspecialchars($navUrl) ?>"><?= htmlspecialchars($navTitle) ?></a></li>
+ <?php else: ?>
+ <li><a href="<?= htmlspecialchars($navUrl) ?>"><?= htmlspecialchars($navTitle) ?></a></li>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ </ul>
+ </nav>
+ <script type="text/javascript">
+ document.addEventListener('DOMContentLoaded', function (event) {
+ var element = document.querySelector('#subnav li.active');
+ element.scrollIntoView({behavior: 'instant', inline: 'center', block: 'center'});
+ });
+ </script>
+ <?php endif; ?>
+ <div id="content">
+
+ <input id="showmainnav" type="checkbox" style="display: none"/>
+ <nav id="mainnav">
+ <ul>
+ <?php foreach ($mainNav as $navUrl => $navTitle): ?>
+ <?php if ($navUrl == $path || $navUrl == $mainNavActivePath): ?>
+ <li class="mobile-current"><label for="showmainnav"><span class="text"><?= htmlspecialchars($navTitle) ?></span><span class="icon">≡</span></label></li>
+ <?php endif; ?>
+ <?php endforeach; ?>
+
+ <?php foreach ($mainNav as $navUrl => $navTitle): ?>
+ <?php if ($navUrl == $path || $navUrl == $mainNavActivePath): ?>
+ <li class="active"><a href="<?= htmlspecialchars($navUrl) ?>"><?= htmlspecialchars($navTitle) ?></a></li>
+ <?php else: ?>
+ <li><a href="<?= htmlspecialchars($navUrl) ?>"><?= htmlspecialchars($navTitle) ?></a></li>
+ <?php endif; ?>
+ <?php endforeach; ?>
+ </ul>
+ </nav>
+
+ <article>
+ <?= $content ?>
+ </article>
+ </div>
+ </body>
+</html>
display: none;
}
}
+
+#content article {
+ margin-left: 20px;
+ margin-right: 20px;
+ max-width: 50rem;
+}
+#content article h1 {
+ margin-top: 0px;
+}
+#content article a,
+#content article a:visited {
+ font-weight: normal;
+ color: white;
+}
+#content article > img {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ max-width: 80%;
+ height: auto;
+}