changeset 1029:1c0a8731723e

Sync.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 17 Aug 2010 12:18:00 +0000
parents c149023a8ccd
children 7e22cc6ed46c
files www/quests.php
diffstat 1 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/www/quests.php	Tue Jul 27 14:09:54 2010 +0000
+++ b/www/quests.php	Tue Aug 17 12:18:00 2010 +0000
@@ -38,15 +38,14 @@
   $lqTable = array();
   $aqTable = array();
   
-  reset($locTable);
-  while (list($key, $value) = each($locTable)) {
-    if (preg_match_all("/LQ([0-9]+) *\"([^\"]+)\"/", $value["freeform"], $matches, PREG_SET_ORDER)) {
+  foreach ($locTable as $loc) {
+    if (preg_match_all("/LQ([0-9]+) *\"([^\"]+)\"/", $loc["freeform"], $matches, PREG_SET_ORDER)) {
       while (list($k, $v) = each($matches))
-        $lqTable[intval($v[1])][$v[2]] = $value;
+        $lqTable[intval($v[1])][$v[2]] = $loc;
     }
-    if (preg_match_all("/AQ *\"([^\"]+)\"/", $value["freeform"], $matches, PREG_SET_ORDER)) {
+    if (preg_match_all("/AQ *\"([^\"]+)\"/", $loc["freeform"], $matches, PREG_SET_ORDER)) {
       while (list($k, $v) = each($matches))
-        $aqTable[$v[1]] = $value;
+        $aqTable[$v[1]] = $loc;
     }
   }
   
@@ -86,12 +85,12 @@
   " <tr>\n".
   "  <th>Level</th>\n".
   "  <th>Quest name</th>\n".
-  "  <th>Location</th>\n";
+  "  <th>Location</th>\n".
   ($hcbat ? "" : "  <th>Continent</th>\n").
   " </tr>\n";
   
-  while (list($level, $quests) = each($lqTable)) {
-    while (list($name, $area) = each($quests)) {
+  foreach ($lqTable as $level => $quests) {
+    foreach ($quests as $name => $area) {
       $totalLQ++;
       echo " <tr><td>".$level."</td>";
       printQuestData($name, $area);
@@ -119,7 +118,7 @@
   ($hcbat ? "" : "  <th>Continent</th>\n").
   " </tr>\n";
   
-  while (list($name, $area) = each($aqTable)) {
+  foreach ($aqTable as $name => $area) {
     $totalAQ++;
     echo "  <tr>";
     printQuestData($name, $area);