[Scummvm-git-logs] scummvm-web master -> 53da9ef108d912ebf96e2be444f25b1e6e6c7a49

sev- sev at scummvm.org
Wed Sep 8 13:45:36 UTC 2021


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
60b9a85f16 WEB: Add a Wikipedia link for games
53da9ef108 WEB: Using full Wikipedia link if given, or Wikipedia page name if not


Commit: 60b9a85f1629e6e1dc09c3a8708f3ed86dc302d4
    https://github.com/scummvm/scummvm-web/commit/60b9a85f1629e6e1dc09c3a8708f3ed86dc302d4
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2021-09-08T15:45:34+02:00

Commit Message:
WEB: Add a Wikipedia link for games

Add a new field to the game table called `wikipedia_page`, which is the URL page title for the game's corresponding page on English Wikipedia.

The field has been filed out for a few games (such as Martian Memorandum and Manhunter: New York), but more will need to be filled out.

Changed paths:
    include/OrmObjects/Compatibility.php
    schema.xml


diff --git a/include/OrmObjects/Compatibility.php b/include/OrmObjects/Compatibility.php
index c693a653..dfdb4dd3 100644
--- a/include/OrmObjects/Compatibility.php
+++ b/include/OrmObjects/Compatibility.php
@@ -54,6 +54,9 @@ class Compatibility extends BaseCompatibility
         if ($this->getGame()->getDataFiles()) {
             $links[] = "- [ScummVM Wiki]({$this->getGame()->getDataFiles()})";
         }
+        if ($this->getGame()->getWikipediaPage()) {
+            $links[] = "- [Wikipedia](https://en.wikipedia.org/wiki/{$this->getGame()->getWikipediaPage()})";
+        }
         if ($links) {
             $notes .= "\n\n**Links:**\n";
             $notes .= join("\n", $links);
diff --git a/schema.xml b/schema.xml
index c4e103bb..61dbef8a 100644
--- a/schema.xml
+++ b/schema.xml
@@ -10,6 +10,7 @@
     <column name="engine_id" type="varchar" size="24" required="true"/>
     <column name="company_id" type="varchar" size="24" required="true"/>
     <column name="moby_id" type="integer"/>
+    <column name="wikipedia_page" type="varchar"/>
     <column name="series_id" type="varchar"/>
     <foreign-key foreignTable="engine" onDelete="CASCADE">
       <reference local="engine_id" foreign="id"/>


Commit: 53da9ef108d912ebf96e2be444f25b1e6e6c7a49
    https://github.com/scummvm/scummvm-web/commit/53da9ef108d912ebf96e2be444f25b1e6e6c7a49
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2021-09-08T15:45:34+02:00

Commit Message:
WEB: Using full Wikipedia link if given, or Wikipedia page name if not

Changed paths:
    include/OrmObjects/Compatibility.php


diff --git a/include/OrmObjects/Compatibility.php b/include/OrmObjects/Compatibility.php
index dfdb4dd3..02502e12 100644
--- a/include/OrmObjects/Compatibility.php
+++ b/include/OrmObjects/Compatibility.php
@@ -54,8 +54,15 @@ class Compatibility extends BaseCompatibility
         if ($this->getGame()->getDataFiles()) {
             $links[] = "- [ScummVM Wiki]({$this->getGame()->getDataFiles()})";
         }
-        if ($this->getGame()->getWikipediaPage()) {
+        $wikipediaPage = $this->getGame()->getWikipediaPage();
+        if ($wikipediaPage) {
+          // If we have a full URL, such as for a non-English Wikipedia page, use that
+          // Otherwise, assume it's a page for English Wikipedia
+          if (str_starts_with($wikipediaPage, "https://")) {
+            $links[] = "- [Wikipedia]({$this->getGame()->getWikipediaPage()})";
+          } else {
             $links[] = "- [Wikipedia](https://en.wikipedia.org/wiki/{$this->getGame()->getWikipediaPage()})";
+          }
         }
         if ($links) {
             $notes .= "\n\n**Links:**\n";




More information about the Scummvm-git-logs mailing list