Example #1
0
			}
		}
	}
	
	if (count($filtered['accept'])) {
		foreach ($filtered['accept'] as $k) {
			$u = getCachedUser($k);
			if ($u->alliance == $t->alliance->id) {
				$t->alliance->addMember($u, 1);
			}
		}
	}
	
	if (count($filtered['ban'])) {
		foreach ($filtered['ban'] as $k) {
			$u = getCachedUser($k);
			if ($u->alliance == $t->alliance->id) {
				$u->alliance  = 0;
				$u->aaccepted = 0;
				$u->save();
			}
			$ab = new AllianceBan();
			$ab->allianceId = $t->alliance->id;
			$ab->targetId   = $k;
			$ab->date       = time();
			$ab->create();
		}
	}
	
	if ($filtered['leader1'] and $filtered['leader1'] != $t->alliance->leaderId1) {
		$t->alliance->leaderId1 = $filtered['leader1'];
Example #2
0
	</div>


	<div class="panel">
		<div class="panel-title">
			Attack Logs
		</div>
		<table>
			<tr>
				<th>Time</th>
				<th>Defender</th>
				<th>Result</th>
				<th>Report</th>
			</tr>
			<? foreach ($this->attackLogs as $log) { ?>
				<? $defender = getCachedUser($log->targetId) ?>
				<tr>
					<td class="time"><?php 
echo $log->getTime();
?>
</td>
					<td>
						<?php 
echo $defender->getNameLink();
?>
					</td>
					<td>
						<? if ($log->getSuccess()) { ?>
							<?php 
echo numecho($log->goldStolen);
?>
Example #3
0
$filteredG = filter_input_array(INPUT_GET, $filter);
$filtered  = filter_input_array(INPUT_POST, $filter);

$uid   = $filtered['uid'] ? $filtered['uid'] : ($filteredG['uid'] ? $filteredG['uid'] : 0);
$error = $filtered['e']   ? $filtered['e']   : ($filteredG['e']   ? $filteredG['e']   : 0);

$uid = max($uid, 0);

if (!$uid) {
	header('Location: base.php');
	exit;
}

$t->user = $user;

$t->target = getCachedUser($uid);

if ($filtered['mkcommander'] and $t->target->numofficers < $t->target->maxofficers) {
	$user->commander = $uid;
	$user->accepted = 0;
	$user->save();
}

switch ($error) {
	case 1:
		$t->err = 'You do not have enough attack turns';
		break;
	case 2:
		$t->err = 'You cannot attack yourself';
		break;
	case 3:
Example #4
0
			</div>
			<table>
				<tr>
					<th>Date</th>
					<th>User</th>
					<th>Note</th>
					<th><input type="submit" name="ignore-remove-submit" value="Remove" /></th>
				</tr>
				<? foreach ($this->ignoreList as $i) { ?>
					<tr>
						<td><?php 
echo date('H:i d/M', $i->time);
?>
</td>
						<td><?php 
echo getCachedUser($i->targetId)->getNameLink();
?>
</td>
						<td><?php 
echo htmlentities($i->note);
?>
 </td>
						<td>
							<input name="ignore-remove[]" type="checkbox" value="<?php 
echo $i->id;
?>
" />
						</td>
					</tr>
				<? } ?>
			</table>					
Example #5
0
?>
 Top 10 Hits
			</div>
			<table class="large">
				<tr>
					<th>Amount</th>
					<th>Attacker</th>
					<th>Defender</th>
				</tr>
			<? foreach ($this->stats[$k]['hits']['top10'] as $k => $v) { ?>
				<tr>
					<td><?php 
echo numecho($v['goldStolen']);
?>
</td>
					<td><?php 
echo getCachedUser($v['attackerId'])->getNameLink();
?>
</td>
					<td><?php 
echo getCachedUser($v['targetId'])->getNameLink();
?>
</td>
				</tr>
			<? } ?>
			</table>
		</div>
	<? } ?>
</div>
<!-- End Statistics page -->
Example #6
0
		return substr($output, 0, strlen($output) - 1);
	}
	return $output;
}

function getMercs() {
	$q = mysql_query('SELECT attackSpecCount as samercs, defSpecCount as damercs FROM Mercenaries limit 1') or die(mysql_error());
	$ret = mysql_fetch_object($q);
	return $ret;
}
function saveMercs($samercs, $damercs) {
	mysql_query("UPDATE Mercenaries set attackSpecCount = $samercs, defSpecCount = $damercs") or die(mysql_error());
}

if (Privacy::isIn()){
	$user = getCachedUser(Privacy::getId());
	if (!$_SESSION['admin']) {
		$user->lastturntime = time();
		$user->currentIP  = $_SERVER['REMOTE_ADDR'];
		$user->save();

		IP::add($user);
	}
	if ($_GET['switch-primary']) {
		$s = $_GET['switch-primary'];
		unset($_GET['switch-primary']);
		$p = $user->primary ? 0 : 1;
		$user->primary = $p;
		$user->save();
		header('Location: ' . $s . '.php?' .  http_build_query($_GET));
		exit;
Example #7
0
					<!-- TODO: and user caching -->
					<? foreach ($this->messages as $msg) { ?>
						<? 
							$s     = ($this->view == 1 ? $msg->senderStatus : $msg->targetStatus);
							$class = ($s == MSG_STATUS_UNREAD ? 'unread' : '');
						?>
						<tr class="<?php 
echo $class;
?>
">
							<td><?php 
echo $msg->getTime();
?>
</td>
							<td><?php 
echo getCachedUser($this->view == 1 ? $msg->targetId : $msg->senderId)->getNameLink();
?>
</td>

							<td>
								<a href="messages.php?id=<?php 
echo $msg->id;
?>
">
									<?php 
echo $msg->subject;
?>
								</a>
								<? if ($msg->fromadmin) { ?>
									<span style="color:red">[From Admin]</span>
								<? } ?>
		<div class="panel-title">
			Baned Users <? $this->load('alliance-header') ?>
		</div>
		<form method="post" class="large">
			<table class="large">
				<tr>
					<th>Ban Date</th>
					<th>Name</th>
					<th>Area</th>
					<th>Rank</th>
					<? if ($this->alliance->isLeader($user)) { ?>
						<th>Remove</th>
					<? } ?>
				</tr>
				<? foreach ($this->banned as $b) { ?>
					<? $member = getCachedUser($b->targetId); ?>
					<tr>
						<td><?php 
echo date('H:i d/M', $b->date);
?>
</td>
						<td><?php 
echo $member->getNameLink();
?>
</td>
						<td><?php 
echo $member->getAreaName();
?>
</td>
						<td><?php 
echo numecho($member->rank);