Support "blockedInWebText" property to remove boulder dash master github/master
authorChristian Weiske <[email protected]>
Tue, 19 Nov 2024 08:11:02 +0000 (09:11 +0100)
committerChristian Weiske <[email protected]>
Tue, 19 Nov 2024 08:11:02 +0000 (09:11 +0100)
Related: https://github.com/ouya-saviors/ouya-game-data/issues/187

bin/build-html.php
bin/import-game-data.php
data/templates/game.tpl.php
www/ouya-game.css

index 5f601bf57cb892fd736e68111255bc84ee3c419c..45ea9988f81b3ed1229676efb98be1ac0fead407 100755 (executable)
@@ -186,6 +186,8 @@ function renderGameFile($gameDataFile, $path)
 
     $internetArchiveUrl = $json->stouyapi->{'internet-archive'} ?? null;
     $developerUrl       = $json->stouyapi->{'developer-url'} ?? null;
+    $blockedInWebText   = $json->stouyapi->blockedInWebText ?? null;
+    $blockedInWeb       = ($json->stouyapi->blockedInWebText ?? null) !== null;
     $canonicalUrl       = $GLOBALS['baseUrl'] . $path;
 
     $pushUrl = $GLOBALS['pushToMyOuyaUrl']
index 854b3d6762c6302a64c1c7ef4502d699fc499fdb..9069c7d94798bc54671b2e91cd5ed8b1ff3a3e77 100755 (executable)
@@ -665,6 +665,7 @@ function buildDetails($game, $linkDeveloperPage = false)
         'stouyapi' => [
             'internet-archive' => $iaUrl,
             'developer-url'    => $game->developer->website ?? null,
+            'blockedInWebText' => $game->blockedInWebText ?? null,
         ]
     ];
 
index 04b6317c6f8a56df3cc7724dd63f8630176278ab..31fb08cb44203f86321d0c6747dac24f9d8ad6ea 100644 (file)
@@ -8,10 +8,12 @@
   <link rel="stylesheet" type="text/css" href="../ouya-game.css"/>
   <link rel="icon" href="../favicon.ico"/>
   <link rel="canonical" href="<?= htmlspecialchars($canonicalUrl) ?>"/>
+  <?php if (!$blockedInWeb): ?>
   <meta name="twitter:card" content="summary_large_image"/>
   <meta property="og:title" content="<?= htmlspecialchars($json->title); ?>" />
   <meta property="og:description" content="<?= htmlspecialchars(substr(strtok($json->description, '.!'), 0, 200)); ?>." />
   <meta property="og:image" content="<?= htmlspecialchars($json->tileImage); ?>" />
+  <?php endif ?>
  </head>
  <body class="game">
   <header>
     <?php if ($json->inAppPurchases): ?>
     <strong>* Includes in-app purchases</strong><br/><br/>
     <?php endif ?>
-    <?= nl2br(htmlspecialchars($json->description)) ?>
+    <?php if ($blockedInWeb): ?>
+        <span class="blocked"><?= nl2br(htmlspecialchars($blockedInWebText)) ?></span>
+    <?php else: ?>
+        <?= nl2br(htmlspecialchars($json->description)) ?>
+    <?php endif ?>
    </p>
   </section>
 
+  <?php if (!$blockedInWeb): ?>
   <section class="media">
    <h2>Screenshots</h2>
    <div class="content">
     <?php endforeach ?>
    </div>
   </section>
+  <?php endif ?>
 
   <section class="buttons">
    <h2>Links</h2>
-   <?php if ($apkDownloadUrl): ?>
+   <?php if (!$blockedInWeb && $apkDownloadUrl): ?>
    <div>
     <a href="<?= $apkDownloadUrl ?>">Download .apk</a>
     <p>
@@ -85,7 +93,7 @@
     </p>
    </div>
    <?php endif ?>
-   <?php if ($internetArchiveUrl): ?>
+   <?php if (!$blockedInWeb && $internetArchiveUrl): ?>
    <div>
     <a href="<?= $internetArchiveUrl ?>">Internet Archive</a>
    </div>
index 22560e0822e1aff97c4a4fb34ad39d32eff02cd2..9a6234da5eb5556c77b76ca40057b3fb2f3264ef 100644 (file)
@@ -98,6 +98,9 @@ nav {
     overflow-y: auto;
     max-height: 50vh;
 }
+.description .blocked {
+    color: red;
+}
 
 .buttons h2 {
     display: none;