show preview on twitter
[stouyapi.git] / data / templates / game.tpl.php
index 531fb282323382cbc26acaae8146c609ca803986..ee41ebe67010a5d78c81243a1faa11b324348167 100644 (file)
@@ -7,10 +7,14 @@
   <meta name="author" content="<?= htmlspecialchars($json->developer->name) ?>"/>
   <link rel="stylesheet" type="text/css" href="../ouya-game.css"/>
   <link rel="icon" href="../favicon.ico"/>
+  <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); ?>" />
  </head>
  <body class="game">
   <header>
-   <img class="ouyalogo" src="../ouya-logo.grey.svg" alt="OUYA logo" width="50"/>
+   <a href="../discover/"><img class="ouyalogo" src="../ouya-logo.grey.svg" alt="OUYA logo" width="50"/></a>
   </header>
   <section class="text">
    <h1><?= htmlspecialchars($json->title); ?></h1>
@@ -23,8 +27,8 @@
 
     <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 ?>
@@ -47,6 +51,9 @@
    </dl>
 
    <p class="description">
+    <?php if ($json->inAppPurchases): ?>
+    <strong>* Includes in-app purchases</strong><br/><br/>
+    <?php endif ?>
     <?= nl2br(htmlspecialchars($json->description)) ?>
    </p>
   </section>
@@ -56,7 +63,7 @@
    <div class="content">
     <?php foreach ($json->mediaTiles as $tile): ?>
      <?php if ($tile->type == 'image'): ?>
-      <img src="<?= htmlspecialchars($tile->urls->thumbnail) ?>" alt="Screenshot of <?= htmlspecialchars($json->title); ?>"/>
+      <img src="<?= htmlspecialchars($tile->urls->full) ?>" alt="Screenshot of <?= htmlspecialchars($json->title); ?>"/>
      <?php elseif ($tile->type == 'video'): ?>
       <video controls="">
        <source src="<?= htmlspecialchars($tile->url) ?>"/>
@@ -68,6 +75,7 @@
 
   <section class="buttons">
    <h2>Links</h2>
+   <?php if ($apkDownloadUrl): ?>
    <div>
     <a href="<?= $apkDownloadUrl ?>">Download .apk</a>
     <p>
      <?= gmdate('Y-m-d', $json->version->publishedAt) ?>
     </p>
    </div>
+   <?php endif ?>
+   <?php if ($internetArchiveUrl): ?>
+   <div>
+    <a href="<?= $internetArchiveUrl ?>">Internet Archive</a>
+   </div>
+   <?php endif ?>
+   <?php if ($developerDetailsUrl): ?>
+   <div>
+    <a href="<?= $developerDetailsUrl ?>">Developer page</a>
+   </div>
+   <?php endif ?>
+   <?php if ($appsJson->app->website): ?>
+   <div>
+    <a href="<?= $appsJson->app->website ?>">Game website</a>
+   </div>
+   <?php endif ?>
    <div>
     <form method="post" action="<?= htmlspecialchars($pushUrl) ?>" id="push" onsubmit="pushToMyOuya();return false;">
      <button name="push" type="submit" class="push-to-my-ouya">