Use developer URL in game details page and all games list
authorChristian Weiske <cweiske@cweiske.de>
Mon, 1 Jun 2020 19:54:04 +0000 (21:54 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 1 Jun 2020 19:54:04 +0000 (21:54 +0200)
bin/build-html.php
bin/import-game-data.php
data/templates/allgames.tpl.php
data/templates/game.tpl.php

index 18e25e53bb95b2a413bf87110cb20a32653362be..c00f811cef8a6ebbb65575d29830375a6ba6bba5 100755 (executable)
@@ -62,6 +62,7 @@ function renderAllGamesList($detailsFiles)
             'title'        => $json->title,
             'genres'       => $json->genres,
             'developer'    => $json->developer->name,
             'title'        => $json->title,
             'genres'       => $json->genres,
             'developer'    => $json->developer->name,
+            'developerUrl' => $json->stouyapi->{'developer-url'} ?? null,
             'suggestedAge' => $json->suggestedAge,
             'apkVersion'   => $json->version->number,
             'apkTimestamp' => $json->version->publishedAt,
             'suggestedAge' => $json->suggestedAge,
             'apkVersion'   => $json->version->number,
             'apkTimestamp' => $json->version->publishedAt,
@@ -168,6 +169,7 @@ function renderGameFile($gameDataFile)
     */
 
     $internetArchiveUrl = $json->stouyapi->{'internet-archive'} ?? null;
     */
 
     $internetArchiveUrl = $json->stouyapi->{'internet-archive'} ?? null;
+    $developerUrl       = $json->stouyapi->{'developer-url'} ?? null;
 
     $pushUrl = $GLOBALS['pushToMyOuyaUrl']
         . '?game=' . urlencode($json->apk->package);
 
     $pushUrl = $GLOBALS['pushToMyOuyaUrl']
         . '?game=' . urlencode($json->apk->package);
index cfd16308e5eba6f93d3fbc634c39600d5d525271..e90ccc948043cad9b6c13df017c14689bebe4984 100755 (executable)
@@ -517,6 +517,7 @@ function buildDetails($game)
 
         'stouyapi' => [
             'internet-archive' => $iaUrl,
 
         'stouyapi' => [
             'internet-archive' => $iaUrl,
+            'developer-url'    => $game->developer->website ?? null,
         ]
     ];
 }
         ]
     ];
 }
index 613caadb60a7a718d6838e76babe3e5f3ab05db8..ded0ebd153f1b285794c324189f68b9345e1d855 100644 (file)
         <?= htmlspecialchars($game->title) ?>
        </a>
       </td>
         <?= htmlspecialchars($game->title) ?>
        </a>
       </td>
-      <td><?= htmlspecialchars($game->developer) ?></td>
+      <td>
+       <?php if ($game->developerUrl): ?>
+        <a href="<?= htmlspecialchars($game->developerUrl) ?>"><?= htmlspecialchars($game->developer) ?></a>
+       <?php else: ?>
+        <?= htmlspecialchars($game->developer) ?>
+       <?php endif ?>
+      </td>
       <td><?= htmlspecialchars($game->suggestedAge) ?></td>
       <td><?= htmlspecialchars(implode(', ', $game->players)) ?></td>
       <td><?= htmlspecialchars(implode(', ', $game->genres)) ?></td>
       <td><?= htmlspecialchars($game->suggestedAge) ?></td>
       <td><?= htmlspecialchars(implode(', ', $game->players)) ?></td>
       <td><?= htmlspecialchars(implode(', ', $game->genres)) ?></td>
index 621049c3d505543b2fcfcbffa3fa70e3e080047b..4f7779e2f4d13d0f6452440cb77683c53d1b3455 100644 (file)
@@ -23,8 +23,8 @@
 
     <dt>Developer</dt>
     <dd class="company">
 
     <dt>Developer</dt>
     <dd class="company">
-     <?php if ($appsJson->app->website): ?>
-      <a href="<?= htmlspecialchars($appsJson->app->website) ?>"><?= htmlspecialchars($json->developer->name) ?></a>
+     <?php if ($developerUrl): ?>
+      <a href="<?= htmlspecialchars($developerUrl) ?>"><?= htmlspecialchars($json->developer->name) ?></a>
      <?php else: ?>
       <?= htmlspecialchars($json->developer->name) ?>
      <?php endif ?>
      <?php else: ?>
       <?= htmlspecialchars($json->developer->name) ?>
      <?php endif ?>
    <?php endif ?>
    <?php if ($internetArchiveUrl): ?>
    <div>
    <?php endif ?>
    <?php if ($internetArchiveUrl): ?>
    <div>
-    <a href="<?= $internetArchiveUrl ?>">Internet Archive page</a>
+    <a href="<?= $internetArchiveUrl ?>">Internet Archive</a>
+   </div>
+   <?php endif ?>
+   <?php if ($appsJson->app->website): ?>
+   <div>
+    <a href="<?= $appsJson->app->website ?>">Game website</a>
    </div>
    <?php endif ?>
    <div>
    </div>
    <?php endif ?>
    <div>