changeset 1900:ed98d2fe4bca

Rename some functions.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 06 Nov 2017 06:12:37 +0200
parents ea88b91acf1a
children 55392a6feead
files www/common.inc.php www/loc.php www/simple.php
diffstat 3 files changed, 17 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/www/common.inc.php	Mon Nov 06 04:25:30 2017 +0200
+++ b/www/common.inc.php	Mon Nov 06 06:12:37 2017 +0200
@@ -32,7 +32,7 @@
 
 
 
-function stError($msg)
+function mpError($msg)
 {
   global $errorSet, $errorMsgs;
   $errorSet = TRUE;
@@ -41,7 +41,7 @@
 }
 
 
-function stTrimIfString($val)
+function mpTrimIfString($val)
 {
   if (is_string($val))
     return trim($val);
@@ -50,12 +50,12 @@
 }
 
 
-function stGetRequestItem($name, $default = "", $allowGet = FALSE)
+function mpGetRequestItem($name, $default = "", $allowGet = FALSE)
 {
   if ($allowGet)
-    return isset($_REQUEST[$name]) ? stTrimIfString($_REQUEST[$name]) : $default;
+    return isset($_REQUEST[$name]) ? mpTrimIfString($_REQUEST[$name]) : $default;
   else
-    return isset($_POST[$name]) ? stTrimIfString($_POST[$name]) : $default;
+    return isset($_POST[$name]) ? mpTrimIfString($_POST[$name]) : $default;
 }
 
 
@@ -242,7 +242,7 @@
         }
         else
         {
-          stError("Location <b>".$record[4]."</b> has invalid timestamp '".$addInfo[1]."'"); 
+          mpError("Location <b>".$record[4]."</b> has invalid timestamp '".$addInfo[1]."'"); 
           $added = -1;
         }
       }
@@ -269,7 +269,7 @@
           $id = $rawflags.$names[0]["name"];
           if (isset($locations[$id]))
           {
-            stError("Location '<b>".$id."</b>' already defined (".$locations[$id]["continent"]." <=> ".$filename.")");
+            mpError("Location '<b>".$id."</b>' already defined (".$locations[$id]["continent"]." <=> ".$filename.")");
             return FALSE;
           }
           
@@ -313,7 +313,7 @@
       }
     } else
     {
-      stError($inLine);
+      mpError($inLine);
       //return FALSE;
     }
   }
@@ -351,7 +351,7 @@
   $s = trim($record[1]);
   if (isset($table[$s]))
   {
-    stError("Item ".$s." is already set!");
+    mpError("Item ".$s." is already set!");
     return FALSE;
   }
   else
@@ -399,7 +399,7 @@
     if (preg_match("/^([A-Z][a-z]+);(http:\/\/[^;]+|bat)?;([^;]+)?;(.*)$/", $line, $record))
       $contMode = TRUE;
     else
-      stError($line);
+      mpError($line);
   }
 
   fclose($file);
--- a/www/loc.php	Mon Nov 06 04:25:30 2017 +0200
+++ b/www/loc.php	Mon Nov 06 06:12:37 2017 +0200
@@ -66,11 +66,11 @@
   $applyFilter = TRUE;
 }
 else
-if (($filter = stGetRequestItem("f", "", TRUE)) != "")
+if (($filter = mpGetRequestItem("f", "", TRUE)) != "")
 {
   if (!preg_match("/^[\^A-Za-z!]+\$/", $filter))
   {
-    stError("Invalid filter rule '".chentities($filter)."'");
+    mpError("Invalid filter rule '".chentities($filter)."'");
     $filter = "C";
     $applyFilter = FALSE;
   }
@@ -86,7 +86,7 @@
 
 $showCoders = !isset($_GET["s"]);
 
-if (($tmpName = stGetRequestItem("a", FALSE, TRUE)) !== false)
+if (($tmpName = mpGetRequestItem("a", FALSE, TRUE)) !== false)
 {
   if (preg_match("#^([a-z]{1,15})#i", $tmpName, $matches))
   {
@@ -103,7 +103,7 @@
   else
   {
     $coderName = "???";
-    stError("Invalid wizard name.");
+    mpError("Invalid wizard name.");
   }
 }
 
@@ -123,7 +123,7 @@
   }
   else
   {
-    stError("No such continent ID!");
+    mpError("No such continent ID!");
     unset($setName);
   }
 }
@@ -279,7 +279,7 @@
       "</div>\n";
   }
   else
-    stError("No information entry for this wizard.");
+    mpError("No information entry for this wizard.");
 }
 
 
@@ -439,7 +439,7 @@
     "<p><b>No locations known!</b></p>\n".
     "</div>\n"; // end of contents div
 
-  stError("No locations known!");
+  mpError("No locations known!");
 }
 
 mpPrintPageFooter(FALSE);
--- a/www/simple.php	Mon Nov 06 04:25:30 2017 +0200
+++ b/www/simple.php	Mon Nov 06 06:12:37 2017 +0200
@@ -124,8 +124,6 @@
 {
   echo
     "<p><b>No locations known!</b></p>\n";
-
-  stError("No locations known!");
 }
 
 mpPrintPageFooter(TRUE);