changeset 28:5305bd5a44aa default tip

Sync.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 29 Mar 2018 12:43:26 +0300
parents a75c66e7b9e5
children
files index.php
diffstat 1 files changed, 42 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/index.php	Fri Mar 01 04:13:24 2013 +0200
+++ b/index.php	Thu Mar 29 12:43:26 2018 +0300
@@ -2,8 +2,7 @@
 $pageTitle = "Pupunen BatMUD Container Command Creator ALPHA";
 $pageIndex = "index.php";
 
-require "mcommon.inc.php";
-require "merrors.inc.php";
+require "mgeneric.inc.php";
 require "itemfixes.inc.php";
 
 
@@ -61,7 +60,7 @@
       }
     } else {
       // Perform regexp replacment
-      $res = preg_replace("/".$pat."/", $rep, $input, -1, &$changed);
+      $res = preg_replace("/".$pat."/", $rep, $input, -1, $changed);
       if ($changed > 0)
         return $res;
     }
@@ -81,20 +80,50 @@
 cmPrintPageHeader($pageTitle, "
  <style type=\"text/css\">
   <!--
+  #contents {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+  }
+
   .buttons { width: 100%; }
   select { width: 100%; }
+
+  h1, h2, h3 {
+    margin-top: 0;
+  }
   
-  div.options, #commands, #status {
+  div.options, #commands {
     background: #268;
     border: 1px solid white;
     color: white;
+    display: none;
+    position: fixed;
+    top: 2em;
+    left: 2em;
+    padding: 1em;
   }
   
-  div.options { display: none; position: fixed; top: 2em; left: 2em; padding: 1em; }
+  div.options {
+  }
 
-  #commands { display: none; position: fixed; top: 2em; left: 2em; padding: 1em; z-index: 15; }
+  #commands {
+    z-index: 15;
+  }
   
-  #status { position: absolute; bottom: 1em; right: 1em; left: 1em; padding: 2pt; z-index: -1; }
+  #status {
+    position: absolute;
+    bottom: 0.2em;
+    right: 0.2em;
+    left: 0.2em;
+    padding: 0.2em;
+    z-index: 8;
+    color: white;
+    background: black;
+    border-radius: 0.2em;
+  }
   -->
  </style>
 ");
@@ -171,7 +200,7 @@
           $ignored[$str] = "Unparsed stack of many";
         } else {
           $n = $fixNumbers[$m[1]];
-          $res = performItemFixups($m[2], $fixStackTable, &$changed);
+          $res = performItemFixups($m[2], $fixStackTable, $changed);
           if ($changed > 0)
             addItems($n, $res.$m[3]);
           else
@@ -179,7 +208,7 @@
         }
       } else {
         // Other item name fixups
-        addItems(1, performItemFixups($str, $fixItemTable, &$changed));
+        addItems(1, performItemFixups($str, $fixItemTable, $changed));
       }
     }
 
@@ -219,7 +248,7 @@
     } else 
       $formMode = 3;
   } else
-    errorMsg("No item data provided.");
+    stError("No item data provided.");
 } // formMode == 1
 
 
@@ -233,7 +262,7 @@
     $formMode = 3;
   }
   if ($data === FALSE) {
-    errorMsg("Could not unserialize data, internal error.");
+    stError("Could not unserialize data, internal error.");
   }
 }
 
@@ -983,7 +1012,8 @@
 <?
 }
 
-if ($errorSet > 0) {
+if ($errorSet)
+{
   echo "<h2>An error occured</h2>\n<ul>\n";
   
   foreach ($errorMsgs as $msg)