Commit f9b72b80 authored by Toldierone's avatar Toldierone

converted line endings to one-true-format "\n"

parent 2803e29f
<?php
include("backend/backend_actions.php");
$extratitle = "Actions - ";
include("header.php");
$tempname = "";
$first = true;
echo <<<EOFORM
<center><div class="well">Funds: <span class="text-success">{$displayfunds} Bits</span></div></center>
<center><div id="container" class="js-masonry" data-masonry-options='{ "itemSelector": ".masonryitem", "isFitWidth": true }'>
EOFORM;
foreach ($availableactions as $action => $info) {
if ($tempname != $info['groupname']) {
if (!$first) {
echo "</table></div></div>";
}
echo <<<EOFORM
<div class="masonryitem" style="padding: 10px; width: 400px">
<div class="panel panel-default">
<div class="panel-heading h4">{$info['groupname']}</div>
<table class="table table-striped table-bordered">
EOFORM;
$first = false;
$tempname = $info['groupname'];
}
if ($info['cost'] > 0) {
$costline =<<<EOFORM
<span class="text-danger">{$info['displaycost']}</span>
EOFORM;
} else if ($info['cost'] == 0) {
$costline =<<<EOFORM
<span class="text-warning">{$info['displaycost']}</span>
EOFORM;
} else {
$costline =<<<EOFORM
<span class="text-success">{$info['displaycost']}</span>
EOFORM;
}
echo <<<EOFORM
<tr><td>{$info['description']}<br/>
{$costline} bits<br/>
<form action="actions.php" method="post" class="form-horizontal"><input type="hidden" name="token_actions" value="{$_SESSION['token_actions']}"/>
<input type="hidden" name="recipe_id" value="{$action}"/>
<div class="form-inline"><input type="submit" value="{$info['name']}" class="btn btn-success"/>
<span class="pull-right"><input name="times" value="1" class="form-control" type="text" placeholder="Times" style="width:75px"/></span>
</div>
<input type="submit" name="favorite" value="Add to Favorites" class="btn btn-info"/>
</form>
</td></tr>
EOFORM;
}
echo <<<EOFORM
</table></div></div></div></center>
EOFORM;
include("footer.php");
<?php
include("backend/backend_actions.php");
$extratitle = "Actions - ";
include("header.php");
$tempname = "";
$first = true;
echo <<<EOFORM
<center><div class="well">Funds: <span class="text-success">{$displayfunds} Bits</span></div></center>
<center><div id="container" class="js-masonry" data-masonry-options='{ "itemSelector": ".masonryitem", "isFitWidth": true }'>
EOFORM;
foreach ($availableactions as $action => $info) {
if ($tempname != $info['groupname']) {
if (!$first) {
echo "</table></div></div>";
}
echo <<<EOFORM
<div class="masonryitem" style="padding: 10px; width: 400px">
<div class="panel panel-default">
<div class="panel-heading h4">{$info['groupname']}</div>
<table class="table table-striped table-bordered">
EOFORM;
$first = false;
$tempname = $info['groupname'];
}
if ($info['cost'] > 0) {
$costline =<<<EOFORM
<span class="text-danger">{$info['displaycost']}</span>
EOFORM;
} else if ($info['cost'] == 0) {
$costline =<<<EOFORM
<span class="text-warning">{$info['displaycost']}</span>
EOFORM;
} else {
$costline =<<<EOFORM
<span class="text-success">{$info['displaycost']}</span>
EOFORM;
}
echo <<<EOFORM
<tr><td>{$info['description']}<br/>
{$costline} bits<br/>
<form action="actions.php" method="post" class="form-horizontal"><input type="hidden" name="token_actions" value="{$_SESSION['token_actions']}"/>
<input type="hidden" name="recipe_id" value="{$action}"/>
<div class="form-inline"><input type="submit" value="{$info['name']}" class="btn btn-success"/>
<span class="pull-right"><input name="times" value="1" class="form-control" type="text" placeholder="Times" style="width:75px"/></span>
</div>
<input type="submit" name="favorite" value="Add to Favorites" class="btn btn-info"/>
</form>
</td></tr>
EOFORM;
}
echo <<<EOFORM
</table></div></div></div></center>
EOFORM;
include("footer.php");
?>
\ No newline at end of file
<?php
include ("backend/minimal.php");
if ($_SESSION['user_id'] && ($_GET['message'] != "") && ($_GET['token'] == $_SESSION["token_chat"])) {
$mysql['message'] = $GLOBALS['mysqli']->real_escape_string($_GET['message']);
$sql=<<<EOSQL
SELECT message_id FROM chat WHERE user_id = '{$_SESSION['user_id']}' AND posted > DATE_SUB(NOW(), INTERVAL 1 SECOND)
EOSQL;
$rs = onelinequery($sql);
if (!$rs['message_id']) {
$sql=<<<EOSQL
INSERT INTO chat SET message = '{$mysql['message']}', posted = NOW(), user_id = '{$_SESSION['user_id']}'
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql=<<<EOSQL
DELETE FROM chat WHERE posted <= DATE_SUB(NOW(), INTERVAL 1 WEEK)
EOSQL;
$GLOBALS['mysqli']->query($sql);
}
}
<?php
include ("backend/minimal.php");
if ($_SESSION['user_id'] && ($_GET['message'] != "") && ($_GET['token'] == $_SESSION["token_chat"])) {
$mysql['message'] = $GLOBALS['mysqli']->real_escape_string($_GET['message']);
$sql=<<<EOSQL
SELECT message_id FROM chat WHERE user_id = '{$_SESSION['user_id']}' AND posted > DATE_SUB(NOW(), INTERVAL 1 SECOND)
EOSQL;
$rs = onelinequery($sql);
if (!$rs['message_id']) {
$sql=<<<EOSQL
INSERT INTO chat SET message = '{$mysql['message']}', posted = NOW(), user_id = '{$_SESSION['user_id']}'
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql=<<<EOSQL
DELETE FROM chat WHERE posted <= DATE_SUB(NOW(), INTERVAL 1 WEEK)
EOSQL;
$GLOBALS['mysqli']->query($sql);
}
}
?>
\ No newline at end of file
<?php
include("backend/allfunctions.php");
if ($_SESSION['user_id'] == 1) {
echo <<<EOFORM
<form action="adminkilleveryone.php" method="post">
<input name="user_id"/>
<input type="submit" value="Kill"/>
</form>
EOFORM;
if ($_POST['user_id']) {
$sql = "SELECT username from users WHERE user_id = '{$_POST['user_id']}'";
$rs = onelinequery($sql);
$sql=<<<EOSQL
INSERT INTO news (message, posted)
VALUES ('The admin has disposed of {$rs['username']}!', NOW())
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql = "SELECT nation_id from nations WHERE user_id = '{$_POST['user_id']}'";
$sth = $GLOBALS['mysqli']->query($sql);
while ($rs = mysqli_fetch_array($sth)) {
$sql = "DELETE FROM resources WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM marketplace WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM nations WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM weapons WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM armor WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM forcegroups WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM forces WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM recipefavorites WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = <<<EOSQL
UPDATE forcegroups SET location_id = nation_id, departuredate = NULL, attack_mission = 0 WHERE destination_id = {$rs['nation_id']} OR location_id = {$rs['nation_id']}
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql = "SELECT deal_id FROM deals WHERE fromnation = '{$rs['nation_id']}' OR tonation = '{$rs['nation_id']}'";
$sth2 = $GLOBALS['mysqli']->query($sql);
while ($rs2 = mysqli_fetch_array($sth2)) {
$sql = "DELETE FROM dealitems_offered WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealitems_requested WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealarmor_offered WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealarmor_requested WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealweapons_offered WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealweapons_requested WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
}
$sql = "DELETE FROM deals WHERE fromnation = '{$rs['nation_id']}'";
}
$sql = "DELETE FROM embargoes WHERE embargoer = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM embargoes WHERE embargoee = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM nations WHERE user_id = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM messages WHERE fromuser = '{$_POST['user_id']}' OR touser = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM users WHERE user_id = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
echo "User {$_POST['user_id']} has been killed.";
}
}
<?php
include("backend/allfunctions.php");
if ($_SESSION['user_id'] == 1) {
echo <<<EOFORM
<form action="adminkilleveryone.php" method="post">
<input name="user_id"/>
<input type="submit" value="Kill"/>
</form>
EOFORM;
if ($_POST['user_id']) {
$sql = "SELECT username from users WHERE user_id = '{$_POST['user_id']}'";
$rs = onelinequery($sql);
$sql=<<<EOSQL
INSERT INTO news (message, posted)
VALUES ('The admin has disposed of {$rs['username']}!', NOW())
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql = "SELECT nation_id from nations WHERE user_id = '{$_POST['user_id']}'";
$sth = $GLOBALS['mysqli']->query($sql);
while ($rs = mysqli_fetch_array($sth)) {
$sql = "DELETE FROM resources WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM marketplace WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM nations WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM weapons WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM armor WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM forcegroups WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM forces WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM recipefavorites WHERE nation_id = '{$rs['nation_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = <<<EOSQL
UPDATE forcegroups SET location_id = nation_id, departuredate = NULL, attack_mission = 0 WHERE destination_id = {$rs['nation_id']} OR location_id = {$rs['nation_id']}
EOSQL;
$GLOBALS['mysqli']->query($sql);
$sql = "SELECT deal_id FROM deals WHERE fromnation = '{$rs['nation_id']}' OR tonation = '{$rs['nation_id']}'";
$sth2 = $GLOBALS['mysqli']->query($sql);
while ($rs2 = mysqli_fetch_array($sth2)) {
$sql = "DELETE FROM dealitems_offered WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealitems_requested WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealarmor_offered WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealarmor_requested WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealweapons_offered WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM dealweapons_requested WHERE deal_id = '{$rs2['deal_id']}'";
$GLOBALS['mysqli']->query($sql);
}
$sql = "DELETE FROM deals WHERE fromnation = '{$rs['nation_id']}'";
}
$sql = "DELETE FROM embargoes WHERE embargoer = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM embargoes WHERE embargoee = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM nations WHERE user_id = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM messages WHERE fromuser = '{$_POST['user_id']}' OR touser = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
$sql = "DELETE FROM users WHERE user_id = '{$_POST['user_id']}'";
$GLOBALS['mysqli']->query($sql);
echo "User {$_POST['user_id']} has been killed.";
}
}
?>
\ No newline at end of file
<?php
include("backend/backend_allianceattacks.php");
$extratitle = "Alliance Attacks - ";
include("header.php");
if ($nationinfo['government'] != "Decentralization" && $nationinfo['government'] != "Alicorn Elite" && $nationinfo['government'] != "Transponyism") {
echo <<<EOFORM
<center>Attacks against alliance members can only be seen by Decentralized governments.</center>
EOFORM;
} else if (!$nationinfo['alliance_id']) {
echo <<<EOFORM
<center>You have no alliance.</center>
EOFORM;
} else {
if (empty($attacks)){
echo <<<EOFORM
<center>No one is attacking your alliance members.</center>
EOFORM;
} else {
echo <<<EOFORM
<table class="table table-striped table-bordered">
<tr><th>Total troops</th><th>Attacking<br/>Nation</th><th>Attacking<br/>User</th><th>Defending<br/>Nation</th><th>Defending<br/>User</th></tr>
EOFORM;
foreach ($attacks as $attack) {
echo <<<EOFORM
<tr><td>{$attack['totalsize']}</td>
<td><a href="viewnation.php?nation_id={$attack['attackerid']}">{$attack['attackername']}</a></td>
<td><a href="viewuser.php?user_id={$attack['attackeruserid']}">{$attack['attackeruser']}</a></td>
<td><a href="viewnation.php?nation_id={$attack['defenderid']}">{$attack['defendername']}</a></td>
<td><a href="viewuser.php?user_id={$attack['defenderuserid']}">{$attack['defenderuser']}</a></td>
</tr>
EOFORM;
}
echo <<<EOFORM
</table>
EOFORM;
}
}
include("footer.php");
<?php
include("backend/backend_allianceattacks.php");
$extratitle = "Alliance Attacks - ";
include("header.php");
if ($nationinfo['government'] != "Decentralization" && $nationinfo['government'] != "Alicorn Elite" && $nationinfo['government'] != "Transponyism") {
echo <<<EOFORM
<center>Attacks against alliance members can only be seen by Decentralized governments.</center>
EOFORM;
} else if (!$nationinfo['alliance_id']) {
echo <<<EOFORM
<center>You have no alliance.</center>
EOFORM;
} else {
if (empty($attacks)){
echo <<<EOFORM
<center>No one is attacking your alliance members.</center>
EOFORM;
} else {
echo <<<EOFORM
<table class="table table-striped table-bordered">
<tr><th>Total troops</th><th>Attacking<br/>Nation</th><th>Attacking<br/>User</th><th>Defending<br/>Nation</th><th>Defending<br/>User</th></tr>
EOFORM;
foreach ($attacks as $attack) {
echo <<<EOFORM
<tr><td>{$attack['totalsize']}</td>
<td><a href="viewnation.php?nation_id={$attack['attackerid']}">{$attack['attackername']}</a></td>
<td><a href="viewuser.php?user_id={$attack['attackeruserid']}">{$attack['attackeruser']}</a></td>
<td><a href="viewnation.php?nation_id={$attack['defenderid']}">{$attack['defendername']}</a></td>
<td><a href="viewuser.php?user_id={$attack['defenderuserid']}">{$attack['defenderuser']}</a></td>
</tr>
EOFORM;
}
echo <<<EOFORM
</table>
EOFORM;
}
}
include("footer.php");
?>
\ No newline at end of file
<?php
include("backend/backend_alliances.php");
$extratitle = "Alliances - ";
include("header.php");
if ($hasalliance) {
echo <<<EOFORM
<center><h4><a href="myalliance.php">My Alliance</a></h4></center>
EOFORM;
} else {
echo <<<EOFORM
<center><form name="alliance" method="post" action="alliances.php">
<input type="hidden" name="token_alliances" value="{$_SESSION['token_alliances']}"/>
<table>
<tr><td>Alliance Name</td><td><input type="text" class="form-control" style="width:250px" name="alliancename" value="{$display['alliancename']}"/></td></tr>
<tr><td>Alliance Description</td><td><textarea class="form-control" name="alliancedescription">{$display['alliancedescription']}</textarea></td></tr>
</table>
<input type="submit" name="action" value="Make New Alliance" class="btn btn-success"/>
</form>
</center>
EOFORM;
}
echo <<<EOFORM
<center><table class="table table-striped table-bordered">
<tr><th>Alliance Name</th><th>Active<br/>Member Count</th><th>Active<br/>Nation Count</th><th>Leader</th>
EOFORM;
if (!$hasalliance) {
echo "<th></th>";
}
echo "</tr>";
foreach ($alliances AS $allianceinfo) {
if ($allianceinfo['nations']) {
if (!$hasalliance) {
$request =<<<EOFORM
<td><form action="alliances.php" method="post"><input type="hidden" name="token_alliances" value="{$_SESSION['token_alliances']}"/>
<input type="hidden" name="alliance_id" value="{$allianceinfo['alliance_id']}"/>
EOFORM;
if ($allianceinfo['alliancerequested']) {
$request .=<<<EOFORM
<input type="submit" name="rescindrequest" value="Rescind Join Request" class="btn btn-danger btn-sm"/><br/>
EOFORM;
} else {
$request .=<<<EOFORM
<input type="submit" name="requestjoin" value="Request to Join" class="btn btn-success btn-sm"/><br/>
EOFORM;
}
$request .= "</form></td>";
}
echo <<<EOFORM
<tr><td><a href="viewalliance.php?alliance_id={$allianceinfo['alliance_id']}">{$allianceinfo['name']}</a></td>
<td>{$allianceinfo['players']}</td><td>{$allianceinfo['nations']}</td><td><a href="viewuser.php?user_id={$allianceinfo['owner_id']}">{$allianceinfo['leader']}</a></td>{$request}</tr>
EOFORM;
}
}
echo <<<EOFORM
</table></center>
EOFORM;
include("footer.php");
<?php
include("backend/backend_alliances.php");
$extratitle = "Alliances - ";
include("header.php");
if ($hasalliance) {
echo <<<EOFORM
<center><h4><a href="myalliance.php">My Alliance</a></h4></center>
EOFORM;
} else {
echo <<<EOFORM
<center><form name="alliance" method="post" action="alliances.php">
<input type="hidden" name="token_alliances" value="{$_SESSION['token_alliances']}"/>
<table>
<tr><td>Alliance Name</td><td><input type="text" class="form-control" style="width:250px" name="alliancename" value="{$display['alliancename']}"/></td></tr>
<tr><td>Alliance Description</td><td><textarea class="form-control" name="alliancedescription">{$display['alliancedescription']}</textarea></td></tr>
</table>
<input type="submit" name="action" value="Make New Alliance" class="btn btn-success"/>
</form>
</center>
EOFORM;
}
echo <<<EOFORM
<center><table class="table table-striped table-bordered">
<tr><th>Alliance Name</th><th>Active<br/>Member Count</th><th>Active<br/>Nation Count</th><th>Leader</th>
EOFORM;
if (!$hasalliance) {
echo "<th></th>";
}
echo "</tr>";
foreach ($alliances AS $allianceinfo) {
if ($allianceinfo['nations']) {
if (!$hasalliance) {
$request =<<<EOFORM
<td><form action="alliances.php" method="post"><input type="hidden" name="token_alliances" value="{$_SESSION['token_alliances']}"/>
<input type="hidden" name="alliance_id" value="{$allianceinfo['alliance_id']}"/>
EOFORM;
if ($allianceinfo['alliancerequested']) {
$request .=<<<EOFORM
<input type="submit" name="rescindrequest" value="Rescind Join Request" class="btn btn-danger btn-sm"/><br/>
EOFORM;
} else {
$request .=<<<EOFORM
<input type="submit" name="requestjoin" value="Request to Join" class="btn btn-success btn-sm"/><br/>
EOFORM;
}
$request .= "</form></td>";
}
echo <<<EOFORM
<tr><td><a href="viewalliance.php?alliance_id={$allianceinfo['alliance_id']}">{$allianceinfo['name']}</a></td>
<td>{$allianceinfo['players']}</td><td>{$allianceinfo['nations']}</td><td><a href="viewuser.php?user_id={$allianceinfo['owner_id']}">{$allianceinfo['leader']}</a></td>{$request}</tr>
EOFORM;
}
}
echo <<<EOFORM
</table></center>
EOFORM;
include("footer.php");
?>
\ No newline at end of file
<?php
include("backend/backend_ascensions.php");
$extratitle = "Ascensions - ";
include("header.php");
if ($nations) {
echo <<<EOFORM
<center>These are the players whose nations have ascended into alicorns and gone on to pursue new pleasures.</center>
<table class="table table-striped table-bordered">
<tr><th>Nation</th><th>User</th><th>Ascended On</th></tr>
EOFORM;
foreach ($nations as $nation) {
echo <<<EOFORM
<tr><td><a href="viewascension.php?user_id={$nation['user_id']}">{$nation['name']}</a></td><td>{$nation['username']}</td><td>{$nation['date']}</td></tr>
EOFORM;
}
echo "</table>";
for ($i = 1; $i * 20 < $numnations + 20; $i++) {
if ($i != $mysql['page']) {
echo <<<EOFORM
<a href="ascensions.php?page={$i}">{$i}</a>
EOFORM;
} else {
echo "{$i} ";
}
}
} else {
echo <<<EOFORM
<center>No nations have yet ascended.</center>
EOFORM;
}
include("footer.php");
<?php
include("backend/backend_ascensions.php");
$extratitle = "Ascensions - ";
include("header.php");
if ($nations) {
echo <<<EOFORM
<center>These are the players whose nations have ascended into alicorns and gone on to pursue new pleasures.</center>
<table class="table table-striped table-bordered">
<tr><th>Nation</th><th>User</th><th>Ascended On</th></tr>
EOFORM;
foreach ($nations as $nation) {
echo <<<EOFORM
<tr><td><a href="viewascension.php?user_id={$nation['user_id']}">{$nation['name']}</a></td><td>{$nation['username']}</td><td>{$nation['date']}</td></tr>
EOFORM;
}
echo "</table>";
for ($i = 1; $i * 20 < $numnations + 20; $i++) {
if ($i != $mysql['page']) {
echo <<<EOFORM
<a href="ascensions.php?page={$i}">{$i}</a>
EOFORM;
} else {
echo "{$i} ";
}
}
} else {
echo <<<EOFORM
<center>No nations have yet ascended.</center>
EOFORM;
}
include("footer.php");
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
include_once("allfunctions.php");
$nationinfo = needsnation();
$attacks = array();
if (($nationinfo['government'] == "Decentralization" || $nationinfo['government'] == "Alicorn Elite" || $nationinfo['government'] == "Transponyism") && $nationinfo['alliance_id']) {
$sql=<<<EOSQL
SELECT SUM(f.size) AS totalsize, n.name AS attackername, n.nation_id AS attackerid, u.username AS attackeruser, u.user_id AS attackeruserid,
n2.name AS defendername, n2.nation_id AS defenderid, u2.username AS defenderuser, u2.user_id AS defenderuserid
FROM nations n
INNER JOIN forcegroups fg ON fg.nation_id = n.nation_id
INNER JOIN forces f ON fg.forcegroup_id = f.forcegroup_id
INNER JOIN users u ON u.user_id = n.user_id
INNER JOIN nations n2 ON (fg.destination_id = n2.nation_id AND departuredate IS NOT NULL)
INNER JOIN users u2 ON u2.user_id = n2.user_id
WHERE fg.attack_mission = 1
AND u2.alliance_id = '{$nationinfo['alliance_id']}'
GROUP BY n.nation_id, n2.nation_id
ORDER BY totalsize DESC
EOSQL;
$sth = $GLOBALS['mysqli']->query($sql);
while ($rs = mysqli_fetch_array($sth)) {
$attacks[] = $rs;
}
}
<?php
include_once("allfunctions.php");
$nationinfo = needsnation();
$attacks = array();
if (($nationinfo['government'] == "Decentralization" || $nationinfo['government'] == "Alicorn Elite" || $nationinfo['government'] == "Transponyism") && $nationinfo['alliance_id']) {
$sql=<<<EOSQL
SELECT SUM(f.size) AS totalsize, n.name AS attackername, n.nation_id AS attackerid, u.username AS attackeruser, u.user_id AS attackeruserid,
n2.name AS defendername, n2.nation_id AS defenderid, u2.username AS defenderuser, u2.user_id AS defenderuserid
FROM nations n
INNER JOIN forcegroups fg ON fg.nation_id = n.nation_id
INNER JOIN forces f ON fg.forcegroup_id = f.forcegroup_id
INNER JOIN users u ON u.user_id = n.user_id
INNER JOIN nations n2 ON (fg.destination_id = n2.nation_id AND departuredate IS NOT NULL)
INNER JOIN users u2 ON u2.user_id = n2.user_id
WHERE fg.attack_mission = 1
AND u2.alliance_id = '{$nationinfo['alliance_id']}'
GROUP BY n.nation_id, n2.nation_id
ORDER BY totalsize DESC
EOSQL;
$sth = $GLOBALS['mysqli']->query($sql);
while ($rs = mysqli_fetch_array($sth)) {
$attacks[] = $rs;
}
}
?>
\ No newline at end of file
<?php
include_once("allfunctions.php");
needsnation();
$sql =<<<EOSQL
SELECT alliance_id FROM users WHERE user_id = '{$_SESSION['user_id']}'
EOSQL;
$rs = onelinequery($sql);
if ($rs['alliance_id']) {
$hasalliance = true;
}
foreach ($_POST as $key => $value) {
$mysql[$key] = $GLOBALS['mysqli']->real_escape_string($value);
$display[$key] = htmlentities($value);
}
if ($_POST && (($_POST['token_alliances'] == "") || ($_POST['token_alliances'] != $_SESSION['token_alliances']))) {
$errors[] = "Try again.";
}
if ($_POST || ($_SESSION['token_alliances'] == "")) {
$_SESSION['token_alliances'] = sha1(rand() . $_SESSION['token_alliances']);
}
if (!$errors) {
if ($_POST['action'] == "Make New Alliance") {
if ($hasalliance) {
header("Location: myalliance.php");
exit;
}
if ($_POST['alliancename'] != preg_replace('/[^0-9a-zA-Z_\s]/' ,"", $_POST['alliancename'])) {
$errors[] = "Only English letters and numbers for the alliance name.";
}
if (!$_POST['alliancename']) {
$errors[] = "No name entered.";
}
if (!$errors) {
$sql =<<<EOFORM
INSERT INTO alliances (name, description, owner_id, creationdate)
VALUES ('{$mysql['alliancename']}', '{$mysql['alliancedescription']}', {$_SESSION['user_id']}, NOW())
EOFORM;
$GLOBALS['mysqli']->query($sql);
$sql=<<<EOSQL
SELECT alliance_id FROM alliances WHERE owner_id = '{$_SESSION['user_id']}'
EOSQL;
$rs = onelinequery($sql);
$sql =<<<EOFORM
UPDATE users SET alliance_id = '{$rs['alliance_id']}' WHERE user_id = '{$_SESSION['user_id']}'
EOFORM;
$GLOBALS['mysqli']->query($sql);