diff www/loc.php @ 2037:e82ba6f55708

Refactor how the location filtering works internally to use proper LOC flags.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 26 Jan 2019 01:42:39 +0200
parents 57ecb49d7b4a
children 77c8892c78ca
line wrap: on
line diff
--- a/www/loc.php	Sat Jan 26 01:40:23 2019 +0200
+++ b/www/loc.php	Sat Jan 26 01:42:39 2019 +0200
@@ -118,7 +118,7 @@
     if (empty($locTable))
     {
       $locTable = [];
-      mpParseLocFile($setName, $locTable, $applyFilter, $applyFilter ? $locationTypes[$filterID][LTI_REGEXP] : "");
+      mpParseLocFile($setName, $locTable, $applyFilter, $locationTypes[$filterID][LTI_INVERT_FLAGS], $locationTypes[$filterID][LTI_FLAGS]);
       apcu_store("loc_".$setName, $locTable, 3600);
     }
   }
@@ -133,7 +133,7 @@
   $locTable = apcu_fetch("loc_locTable");
   if (empty($locTable))
   {
-    $locTable = mpReadLocationFiles($applyFilter, $applyFilter ? $locationTypes[$filterID][LTI_REGEXP] : "");
+    $locTable = mpParseLocFiles($applyFilter, $locationTypes[$filterID][LTI_INVERT_FLAGS], $locationTypes[$filterID][LTI_FLAGS]);
     apcu_store("loc_locTable", $locTable, 3600);
   }
 }
@@ -376,9 +376,11 @@
       // Coder / society names
       if (count($iv["coders"]) > 0 && $showCoders)
       {
-        $isSG = preg_match("/[SG]/", $iv["flags"]);
-        if ((!isset($coderName) && !$isSG) || isset($coderName))
-        {
+// XXX not sure what this was about .. :D
+//        $isSG = preg_match("/[SG]/", $iv["flags"]);
+//        if ((!isset($coderName) && ($iv["flags"] & (LOCF_T_SHRINE | LOCF_T_GUILD)) == 0) ||
+//            isset($coderName))
+//        {
           $fs = [];
           foreach ($iv["coders"] as $name)
           {
@@ -399,7 +401,7 @@
               $fs[] = $name["name"];
           }
           echo "<div class=\"locCoders\">".implode(", ", $fs)."</div>";
-        }
+//        }
       }
 
       if (/* isset($coderName) && */ $iv["added"] > 0)