readingNotice['data']); // ======================== BASIC SETTINGS ======================== $hasHero = (isset($dataarray[178]) && $dataarray[178] > 0); $colspan = $hasHero ? 11 : 10; // Spy detection (unchanged logic) $spy = !empty($dataarray[177]) && !empty($dataarray[176]) && empty($dataarray[195]); // ======================== URL SETUP ======================== // detectare admin REAL (nu variabilă nesigură) $isAdmin = (isset($session) && isset($session->access) && $session->access >= 8); if ($isAdmin) { $mapUrl = "Admin/admin.php?p=village&did="; $playerUrl = "Admin/admin.php?p=player&uid="; } else { $mapUrl = "karte.php?d="; $playerUrl = "spieler.php?uid="; } // ======================== ATTACKER DATA (CACHED) ======================== $attackerId = $dataarray[0]; $attackerName = $database->getUserField($attackerId, 'username', 0); $attackerUid = $database->getUserField($attackerId, 'id', 0); if ($attackerName != "[?]") { $user_url = "".$attackerName.""; } else { $user_url = "[?]"; } $fromVillage = $database->getVillageField($dataarray[1], 'name'); if ($fromVillage != "[?]") { $from_url = "getMapCheck($dataarray[1])."\">".$fromVillage.""; } else { $from_url = "[?]"; } // ======================== DEFENDER DATA (CACHED) ======================== $defId = $dataarray[28]; $defName = $database->getUserField($defId, 'username', 0); $defUid = $database->getUserField($defId, 'id', 0); if ($defName != "[?]") { $defuser_url = "".$defName.""; } else { $defuser_url = "[?]"; } $defVillageName = $database->getVillageField($dataarray[29], 'name'); if ($database->isVillageOases($dataarray[29])) { $deffrom_url = "getMapCheck($dataarray[29])."\">".$dataarray[30].""; } elseif ($defVillageName != "[?]") { $deffrom_url = "getMapCheck($dataarray[29])."\">".$defVillageName.""; } else { $deffrom_url = "[?]"; } // ======================== HTML START ======================== ?> procMtime($message->readingNotice['time']); ?>
: readingNotice['topic']); ?>
getUnitName($i); echo ""; } if ($hasHero) { echo ""; } echo ""; // TROOPS for ($i = 3; $i <= 12; $i++) { echo ($dataarray[$i] == 0) ? "" : ""; } if ($hasHero) { echo ""; } // CASUALTIES echo ""; for ($i = 13; $i <= 22; $i++) { echo ($dataarray[$i] == 0) ? "" : ""; } if ($hasHero) { $tdclass = ($dataarray[179] == 0) ? 'class="none"' : ''; echo ""; } // PRISONERS (unchanged logic but safer sum) if (!$spy && array_sum(array_slice($dataarray, 182, 11)) > 0) { echo ""; for ($i = 182; $i <= 191; $i++) { echo ($dataarray[$i] == 0) ? "" : ""; } if ($hasHero) { $tdclass = ($dataarray[192] == 0) ? 'class="none"' : ''; echo ""; } } ?>
  \"$unitName\"\"Hero\"
".TROOPS."0".$dataarray[$i]."".$dataarray[178]."
".CASUALTIES."0".$dataarray[$i]."".$dataarray[179]."
".PRISONERS."0".$dataarray[$i]."".$dataarray[192]."
<?php echo U17; ?>
<?php echo U18; ?>
<?php echo U19; ?>
<?php echo U0; ?>
| | |
$value) { if ($value == 0) continue; $heroIndex = ($index == 0 ? 180 : 160 + ($index - 1)); $heroDeadIndex = ($index == 0 ? 1 : 5); $target = ($index == 0 ? $targetTribe : $index) - 1; $start = $target * 10 + 1; $troopsStart = $index * 21 + 35; ?> getUnitName($i); echo ""; } if (!empty($dataarray[$heroIndex])) { echo ""; } echo ""; for ($i = $troopsStart; $i <= $troopsStart + 9; $i++) { echo ($dataarray[$i] == 0) ? "" : ""; } if (!empty($dataarray[$heroIndex])) { echo ""; } echo ""; for ($i = $troopsStart + 10; $i <= $troopsStart + 19; $i++) { echo ($dataarray[$i] == 0) ? "" : ""; } // SAFE FIX: avoid undefined variable warning $tdclass1 = ''; if (!empty($dataarray[$heroIndex])) { $tdclass1 = ($dataarray[$heroIndex + $heroDeadIndex] == 0) ? 'class="none"' : ''; echo ""; } ?>
  \"$unitName\"
".TROOPS."0".$dataarray[$i]."".$dataarray[$heroIndex]."
".CASUALTIES."0".$dataarray[$i]."".$dataarray[$heroIndex + $heroDeadIndex]."