alliance; // FILTER 31 if ($filterType === 31) { $sql = mysqli_query( $database->dblink, "SELECT * FROM " . TB_PREFIX . "ndata WHERE ally = $allyId AND ( (ntype != 0 AND ntype < 4) OR (ntype > 17 AND ntype != 20 AND ntype != 21 AND ntype != 22) ) ORDER BY time DESC LIMIT 20" ); // FILTER 32 } elseif ($filterType === 32) { $sql = mysqli_query( $database->dblink, "SELECT * FROM " . TB_PREFIX . "ndata WHERE ally = $allyId AND ( ntype < 1 OR (ntype > 3 AND ntype < 8) OR ntype > 19 ) AND ntype != 22 ORDER BY time DESC LIMIT 20" ); } // fallback safety $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"]; // detect report type group $type2 = ($ntype >= 4 && $ntype <= 7) ? 32 : 31; $type = (isset($_GET['t']) && (int)$_GET['t'] === 5) ? (int)$row['archive'] : $ntype; if ($type == 23) { $type = 22; } // icon logic $useScoutIcon = (($type == 18 || $type == 19) && $filterType == 31) || (($type == 20 || $type == 21) && $filterType == 32) || $type == 22; // attacker + defender names (cache local variables to reduce DB calls) $attackerId = (int)$dataarray[0]; $targetId = ($type != 22 && $type != 23) ? (int)$dataarray[28] : (int)$dataarray[2]; $attackerName = $database->getUserField($attackerId, "username", 0); $targetName = $database->getUserField($targetId, "username", 0); $targetAllyId = $database->getUserField($targetId, "alliance", 0); $targetAllyName = $targetAllyId ? $database->getAllianceName($targetAllyId) : "-"; $allyLink = ($targetAllyId) ? "" . htmlspecialchars($targetAllyName, ENT_QUOTES, 'UTF-8') . "" : "-"; $nn = ( (($type == 18 || $type == 19) && $filterType == 31) || (($type == 20 || $type == 21) && $filterType == 32) ) ? " scouts " : " attacks "; $date = $generator->procMtime($time); // render row $outputList .= ""; // ICON + link switch $outputList .= ""; $outputList .= ""; if ($useScoutIcon) { $outputList .= ""; } else { $outputList .= ""; } $outputList .= ""; $outputList .= "
"; $outputList .= htmlspecialchars($attackerName, ENT_QUOTES, 'UTF-8'); $outputList .= $nn; $outputList .= htmlspecialchars($targetName, ENT_QUOTES, 'UTF-8'); $outputList .= "
"; $outputList .= ""; // alliance column $outputList .= "" . $allyLink . ""; // date column $outputList .= "" . $date[0] . " " . date('H:i', $time) . ""; $outputList .= ""; } } ?>
Player Alliance Date