alliance; } // load alliance info $allianceinfo = $database->getAlliance($aid); // header echo "

" . htmlspecialchars($allianceinfo['tag'], ENT_QUOTES, 'UTF-8') . " - " . htmlspecialchars($allianceinfo['name'], ENT_QUOTES, 'UTF-8') . "

"; // menu include("alli_menu.tpl"); // safe filter input $f = isset($_GET['f']) ? (int)$_GET['f'] : 0; $t = isset($_GET['t']) ? (int)$_GET['t'] : 0; ?>

Military events

alliance; $sql = mysqli_query( $database->dblink, "SELECT * FROM " . TB_PREFIX . "ndata WHERE ally = $allyId AND ( ntype < 8 OR (ntype > 17 AND ntype < 22) OR (ntype = 22 AND ally = $allyId) OR (ntype = 23 AND ally != $allyId) ) ORDER BY time DESC LIMIT 20" ); $outputList = ""; if (!$sql || mysqli_num_rows($sql) == 0) { $outputList .= "There are no reports available."; } else { while ($row = mysqli_fetch_assoc($sql)) { $dataarray = explode(",", $row['data']); $id = (int)$row['id']; $ally = (int)$row['ally']; $ntype = (int)$row['ntype']; $time = (int)$row['time']; $topic = $row['topic']; $toWref = (int)$row['toWref']; // type mapping $type2 = ($ntype >= 4 && $ntype <= 7) ? 32 : 31; $type = ($t === 5) ? (int)$row['archive'] : $ntype; if ($type == 23) { $type = 22; } // scout icon logic $isScout = ($type >= 18 && $type <= 22); // attacker / defender $attackerId = (int)$dataarray[0]; $defenderId = ($type != 22) ? (int)$dataarray[28] : (int)$dataarray[2]; $attackerName = $database->getUserField($attackerId, "username", 0); $defenderName = $database->getUserField($defenderId, "username", 0); // alliance resolve (simplified safe fallback) if ($ntype == 0) { $isOasis = $database->isVillageOases($toWref); if ($isOasis == 0) { $owner = ($toWref != $village->wid) ? $database->getVillageField($toWref, "owner") : $database->getVillageField($dataarray[1], "owner"); } else { $owner = ($toWref != $village->wid) ? $database->getOasisField($toWref, "owner") : $database->getOasisField($dataarray[1], "owner"); } $getUserAlly = $database->getUserField($owner, "alliance", 0); } else { $getUserAlly = $database->getUserField($defenderId, "alliance", 0); } $allyName = "-"; if ($getUserAlly) { $allyName = "" . htmlspecialchars($database->getAllianceName($getUserAlly), ENT_QUOTES, 'UTF-8') . ""; } // date $date = $generator->procMtime($time); // attack/scout label $nn = ($ntype >= 18 && $ntype <= 21) ? " scouts " : " attacks "; // render row $outputList .= ""; $outputList .= ""; $outputList .= ""; if ($isScout) { $outputList .= ""; } else { $outputList .= ""; } $outputList .= ""; $outputList .= "
"; $outputList .= htmlspecialchars($attackerName, ENT_QUOTES, 'UTF-8'); $outputList .= $nn; $outputList .= htmlspecialchars($defenderName, ENT_QUOTES, 'UTF-8'); $outputList .= "
"; $outputList .= "" . $allyName . ""; $outputList .= "" . $date[0] . " " . date('H:i', $time) . ""; $outputList .= ""; } } ?>
Player Alliance Date