changeset 12:6523f431e731

Add links to material information attributes for filtering by the attribute.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 04 Jan 2016 11:15:32 +0200
parents 2808bc76a2fa
children bacc4457c035
files info.php
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/info.php	Mon Jan 04 10:47:50 2016 +0200
+++ b/info.php	Mon Jan 04 11:15:32 2016 +0200
@@ -9,6 +9,7 @@
 
 $pageTitle = "Pupunen BatMUD Alloy Browser";
 $pageIndex = "info.php";
+$siteIndex = "/mat/";
 
 
 // Static list of alloy data contributors
@@ -56,8 +57,9 @@
 
 function stGetMatLink($mat, $title = "", $extra = "")
 {
+  global $siteIndex;
   $tmp = ($title != "") ? " title=\"".chentities($title)."\"" : "";
-  return "<a href=\"/mat/".urlencode($mat)."\"".$tmp.">".chentities($mat)."</a>".$extra;
+  return "<a href=\"".$siteIndex.urlencode($mat)."\"".$tmp.">".chentities($mat)."</a>".$extra;
 }
 
 
@@ -203,7 +205,7 @@
   " <tr>\n".
   "  <th width=\"25%\">Show type</th>\n".
   "  <td rowspan=\"3\" class=\"infobox\">\n".
-  "   [<a href=\"".$pageIndex."\">Reset/Clear</a>] [<a href=\"index.php\">Material browser</a>]\n".
+  "   [<a href=\"".$pageIndex."\">Reset/Clear</a>] [<a href=\"".$siteIndex."\">Material browser</a>]\n".
   "   <br />\n".
   "   <ul>\n".
   "    <li><b>Also available in <a href=\"alloys.txt\">ASCII plaintext format</a>.</b></li>\n".
@@ -295,7 +297,7 @@
       }
       else
       {
-        echo chentities($matTransTable[$key][$val]);
+        echo "<a href=\"".$siteIndex."?f=".$key.":".$val."\">".chentities($matTransTable[$key][$val])."</a>";
       }
       echo "</td>";
       if (++$n >= 3) { echo "</tr>\n"; $n = 0; }