mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-18 01:01:01 +00:00
The first release of the refactored version
It's still a work in progress, there are a lot of things that will change in the final release
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<Files ~ "\.tpl$">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
$dataarray = explode(",",$message->readingNotice['data']);
|
||||
$colspan = (isset($dataarray[178]) && $dataarray[178] > 0) ? 11 : 10;
|
||||
$spy = !empty($dataarray[177]) && !empty($dataarray[176]) && empty($dataarray[195]);
|
||||
|
||||
if(!isset($isAdmin)){
|
||||
$mapUrl = "karte.php?d=";
|
||||
$playerUrl = "spieler.php?uid=";
|
||||
}elseif($isAdmin){
|
||||
$mapUrl = "admin.php?p=village&did=";
|
||||
$playerUrl = "admin.php?p=player&uid=";
|
||||
}
|
||||
|
||||
//Attacker
|
||||
if ($database->getUserField($dataarray[0], 'username', 0) != "[?]") {
|
||||
$user_url="<a href=\"".$playerUrl.$database->getUserField($dataarray[0], 'id', 0)."\">".$database->getUserField($dataarray[0], 'username', 0)."</a>";
|
||||
}
|
||||
else $user_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
|
||||
if($database->getVillageField($dataarray[1], 'name') != "[?]") {
|
||||
$from_url="<a href=\"".$mapUrl.$dataarray[1]."&c=".$generator->getMapCheck($dataarray[1])."\">".$database->getVillageField($dataarray[1], 'name')."</a>";
|
||||
}else $from_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
//defender
|
||||
if ($database->getUserField($dataarray[28], 'username', 0) != "[?]") {
|
||||
$defuser_url="<a href=\"".$playerUrl.$database->getUserField($dataarray[28], 'id', 0)."\">".$database->getUserField($dataarray[28], 'username', 0)."</a>";
|
||||
}
|
||||
else $defuser_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
if($database->isVillageOases($dataarray[29])){
|
||||
$deffrom_url="<a href=\"".$mapUrl.$dataarray[29]."&c=".$generator->getMapCheck($dataarray[29])."\">".$dataarray[30]."</a>";
|
||||
}elseif($database->getVillageField($dataarray[29],'name') != "[?]") {
|
||||
$deffrom_url="<a href=\"".$mapUrl.$dataarray[29]."&c=".$generator->getMapCheck($dataarray[29])."\">".$database->getVillageField($dataarray[29], 'name')."</a>";
|
||||
}
|
||||
else $deffrom_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="report_surround">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Subject:</th>
|
||||
<th><?php echo $message->readingNotice['topic']; ?></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
$date = $generator->procMtime($message->readingNotice['time']); ?>
|
||||
<td class="sent">Sent:</td>
|
||||
<td>on <span><?php echo $date[0]." at ".$date[1]; ?></span> <span>hour</span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td colspan="2" class="empty"></td></tr>
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="attacker"><thead>
|
||||
<tr>
|
||||
<td class="role">Attacker</td>
|
||||
<td colspan="<?php echo $colspan ?>"><?php echo ($user_url ? $user_url : 'Natar Counterforce'); ?> <?php echo ($from_url ? 'from the village '.$from_url : '');?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<?php
|
||||
$tribe = $dataarray[2] ? $dataarray[2] : 5;
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
for($i = $start; $i <= ($start + 9); $i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if (isset($dataarray[178]) && $dataarray[178] > 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
|
||||
for($i = 3; $i <= 12; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
|
||||
if (isset($dataarray[178]) && $dataarray[178] > 0){
|
||||
echo "<td>$dataarray[178]</td>";
|
||||
}
|
||||
echo "<tr><th>Casualties</th>";
|
||||
|
||||
for($i = 13; $i <= 22; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
|
||||
if(isset($dataarray[178]) && $dataarray[178] > 0){
|
||||
if ($dataarray[179] == 0) $tdclass='class="none"'; else $tdclass='';
|
||||
echo "<td $tdclass>$dataarray[179]</td>";
|
||||
}
|
||||
if(!$spy && array_sum(array_slice($dataarray, 182, 11)) > 0){
|
||||
echo "</tr><tr><th>Prisoners</th>";
|
||||
for($i = 182; $i <= 191; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
if(isset($dataarray[178]) && $dataarray[178] > 0){
|
||||
if ($dataarray[192] == 0) $tdclass='class="none"'; else $tdclass='';
|
||||
echo "<td $tdclass>$dataarray[192]</td>";
|
||||
}
|
||||
}
|
||||
echo "</tr></tbody>";
|
||||
if (!empty($dataarray[170]) && !empty($dataarray[171])){ //ram
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[170]; ?>" src="img/x.gif" alt="Ram" title="Ram" />
|
||||
<?php echo $dataarray[171]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if (!empty($dataarray[172]) && !empty($dataarray[173])){ //cata
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[172]; ?>" src="img/x.gif" alt="Catapult" title="Catapult" />
|
||||
<?php echo $dataarray[173]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if (!empty($dataarray[174]) && !empty($dataarray[175])){ //chief
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[174]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
|
||||
<?php echo $dataarray[175]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if ($spy){ //spy
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
|
||||
<?php echo $dataarray[177]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if (!empty($dataarray[193])){ //release prisoners
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
|
||||
<?php echo $dataarray[193]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if (!empty($dataarray[196]) && !empty($dataarray[197])){ //hero
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[196]; ?>" src="img/x.gif" alt="Hero" title="Hero" />
|
||||
<?php echo $dataarray[197]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if(isset($dataarray[195]) && !empty($dataarray[195])){ //No troops returned
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<?php echo $dataarray[195]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }elseif(empty($dataarray[176]) && empty($dataarray[177])){?>
|
||||
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
|
||||
<div class="res"><img class="r1" src="img/x.gif" alt="{$smarty.const.LUMBER}" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="{$smarty.const.CLAY}" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="{$smarty.const.IRON}" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="{$smarty.const.CROP}" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
|
||||
</td></tr></tbody></table>
|
||||
<?php } //Defender(s)
|
||||
$defArray = [1, $dataarray[55], $dataarray[76], $dataarray[97], $dataarray[118], $dataarray[139]];
|
||||
$targetTribe = $dataarray[34];
|
||||
foreach($defArray as $index => $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;
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="defender">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role">Defender</td>
|
||||
<td colspan="<?php echo $dataarray[$heroIndex] > 0 ? 11 : 10; ?>"><?php echo ($index == 0) ? $defuser_url." from the village ".$deffrom_url : "Reinforcement"; ?></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
||||
<?php
|
||||
for($i = $start; $i <= ($start + 9); $i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if(isset($dataarray[$heroIndex]) && $dataarray[$heroIndex] > 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
|
||||
for($i = $troopsStart; $i <= $troopsStart + 9; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
|
||||
if(isset($dataarray[$heroIndex]) && $dataarray[$heroIndex] > 0){
|
||||
echo "<td>".$dataarray[$heroIndex]."</td>";
|
||||
}
|
||||
echo "<tr><th>Casualties</th>";
|
||||
|
||||
for($i = $troopsStart + 10; $i <= $troopsStart + 19; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
|
||||
if(isset($dataarray[$heroIndex]) && $dataarray[$heroIndex] > 0){
|
||||
if ($dataarray[$heroIndex + $heroDeadIndex] == 0) $tdclass1 = 'class="none"';
|
||||
echo "<td $tdclass1>".$dataarray[$heroIndex + $heroDeadIndex]."</td>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
$dataarray = explode(",",$message->readingNotice['data']);
|
||||
|
||||
if(!isset($isAdmin)){
|
||||
$mapUrl = "karte.php?d=";
|
||||
$playerUrl = "spieler.php?uid=";
|
||||
}elseif($isAdmin){
|
||||
$mapUrl = "admin.php?p=village&did=";
|
||||
$playerUrl = "admin.php?p=player&uid=";
|
||||
}
|
||||
|
||||
if ($database->getUserField($dataarray[0],'username',0) != "[?]") {
|
||||
$user_url = "<a href=\"".$playerUrl.$database->getUserField($dataarray[0],'id',0)."\">".$database->getUserField($dataarray[0],'username',0)."</a>";
|
||||
}
|
||||
else $user_url = "<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
if($database->getVillageField($dataarray[1],'name') != "[?]") {
|
||||
$from_url = "<a href=\"".$mapUrl.$dataarray[1]."&c=".$generator->getMapCheck($dataarray[1])."\">".$database->getVillageField($dataarray[1],'name')."</a>";
|
||||
}
|
||||
else $from_url = "<font color=\"grey\"><b>[?]</b></font>";
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="report_surround">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Subject:</th>
|
||||
<th><?php echo $message->readingNotice['topic']; ?></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
$date = $generator->procMtime($message->readingNotice['time']); ?>
|
||||
<td class="sent">Sent:</td>
|
||||
<td>on <span><?php echo $date[0]." at ".$date[1]; ?></span> <span>hour</span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td colspan="2" class="empty"></td></tr>
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="trade"><thead><tr>
|
||||
<td> </td>
|
||||
<td><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr></thead><tbody><tr>
|
||||
<th>Resources</th>
|
||||
<td>
|
||||
<img class="r1" src="img/x.gif" alt="Wood" title="Wood" /><?php echo $dataarray[2]; ?> |
|
||||
<img class="r2" src="img/x.gif" alt="{$smarty.const.CLAY}" title="Clay" /><?php echo $dataarray[3]; ?> |
|
||||
<img class="r3" src="img/x.gif" alt="{$smarty.const.IRON}" title="Iron" /><?php echo $dataarray[4]; ?> |
|
||||
<img class="r4" src="img/x.gif" alt="{$smarty.const.CROP}" title="Crop" /><?php echo $dataarray[5]; ?>
|
||||
</td></tr></tbody>
|
||||
|
||||
</table></td></tr></tbody></table>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
//reinforcement is underattack
|
||||
$dataarray = explode(",",$message->readingNotice['data']);
|
||||
|
||||
if(!isset($isAdmin)){
|
||||
$mapUrl = "karte.php?d=";
|
||||
$playerUrl = "spieler.php?uid=";
|
||||
}elseif($isAdmin){
|
||||
$mapUrl = "admin.php?p=village&did=";
|
||||
$playerUrl = "admin.php?p=player&uid=";
|
||||
}
|
||||
|
||||
$colspan = (isset($dataarray[24]) && $dataarray[24] > 0) ? 11 : 10;
|
||||
if ($database->getUserField($dataarray[0], 'username', 0) != "[?]") {
|
||||
$user_url = "<a href=\"".$playerUrl.$database->getUserField($dataarray[0], 'id', 0)."\">".$database->getUserField($dataarray[0], 'username', 0)."</a>";
|
||||
}
|
||||
else $user_url = "<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
if($database->getVillageField($dataarray[26], 'name') != "[?]") {
|
||||
$from_url = "<a href=\"".$mapUrl.$dataarray[26]."&c=".$generator->getMapCheck($dataarray[26])."\">".$database->getVillageField($dataarray[26], 'name')."</a>";
|
||||
}
|
||||
else $from_url = "<font color=\"grey\"><b>[?]</b></font>";
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="report_surround">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Subject:</th>
|
||||
<th><?php echo $message->readingNotice['topic']; ?></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php $date = $generator->procMtime($message->readingNotice['time']); ?>
|
||||
<td class="sent">Sent:</td>
|
||||
<td>on <span><?php echo $date[0]." at ".$date[1]; ?></span> <span>hour</span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td colspan="2" class="empty"></td></tr>
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" class="defender"><thead>
|
||||
<tr>
|
||||
<td class="role">Defender</td>
|
||||
<td colspan="<?php echo $colspan ?>"><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<?php
|
||||
$tribe = $dataarray[3];
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
for($i = $start; $i <= ($start + 9); $i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if(isset($dataarray[24]) && $dataarray[24] > 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
for($i = 4; $i <= 13; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
if(isset($dataarray[24]) && $dataarray[24] > 0){
|
||||
echo "<td>$dataarray[24]</td>";
|
||||
}
|
||||
|
||||
echo "<tr><th>Casualties</th>";
|
||||
for($i = 14; $i <= 23; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
if(isset($dataarray[24]) && $dataarray[24] > 0){
|
||||
if ($dataarray[25] == 0) $tdclass = 'class="none"';
|
||||
echo "<td $tdclass>$dataarray[25]</td>";
|
||||
}
|
||||
?>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
</td></tr></tbody></table>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
$dataarray = explode(",",$message->readingNotice['data']);
|
||||
$colspan = (isset($dataarray[14]) && $dataarray[14] > 0) ? 11 : 10;
|
||||
|
||||
if($dataarray[15] == 1){
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." visited ".$database->getUserField($dataarray[2],"username",0)."'s troops";
|
||||
}else if($dataarray[15] == 2){
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." wishes you Merry Christmas";
|
||||
}else if($dataarray[15] == 3){
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." wishes you Happy New Year";
|
||||
}else{
|
||||
$message1 = "".$database->getUserField($dataarray[0], "username", 0)." wishes you Happy Easter";
|
||||
}
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="report_surround">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Subject:</th>
|
||||
<th><?php echo $message->readingNotice['topic']; ?></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
$date = $generator->procMtime($message->readingNotice['time']); ?>
|
||||
<td class="sent">Sent:</td>
|
||||
<td>on <span><?php echo $date[0]." at ".$date[1]; ?></span> <span>hour</span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td colspan="2" class="empty"></td></tr>
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" class="attacker"><thead>
|
||||
<tr>
|
||||
<td class="role">Attacker</td>
|
||||
<td colspan="<?php echo $colspan ?>"><a href="spieler.php?uid=<?php echo $database->getUserField($dataarray[0],"id",0); ?>"><?php echo $database->getUserField($dataarray[0],"username",0); ?></a> from the village <a href="karte.php?d=<?php echo $dataarray[1]."&c=".$generator->getMapCheck($dataarray[1]); ?>"><?php echo $database->getVillageField($dataarray[1],"name"); ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<?php
|
||||
$tribe = $dataarray[3];
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
for($i = $start; $i <= ($start + 9); $i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if(isset($dataarray[14]) && $dataarray[14] > 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
|
||||
for($i = 4; $i <= 13; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
|
||||
if(isset($dataarray[14]) && $dataarray[14] > 0){
|
||||
echo "<td>$dataarray[14]</td>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img src="<?php echo GP_LOCATE; ?>img/r/<?php echo (["peace", "xmas", "newy", "easter"])[$dataarray[15]-1]; ?>.gif" alt="Peace" title="Peace" />
|
||||
<?php echo $message1; ?>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
</td></tr></tbody></table>
|
||||
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
############################################################
|
||||
## DO NOT REMOVE THIS NOTICE ##
|
||||
## ADVOCAITE ROCKS TRAVIANX NUTS ##
|
||||
## FIX BY RONIX ##
|
||||
## TRAVIANZ ##
|
||||
############################################################
|
||||
$dataarray = explode(",",$message->readingNotice['data']);
|
||||
$colspan = (isset($dataarray[184]) && $dataarray[184] > 0) ? 11 : 10;
|
||||
$colspan2 = 10;
|
||||
|
||||
if(!isset($isAdmin)){
|
||||
$mapUrl = "karte.php?d=";
|
||||
$playerUrl = "spieler.php?uid=";
|
||||
}elseif($isAdmin){
|
||||
$mapUrl = "admin.php?p=village&did=";
|
||||
$playerUrl = "admin.php?p=player&uid=";
|
||||
}
|
||||
|
||||
//Attacker
|
||||
if ($database->getUserField($dataarray[0], 'username', 0) != "[?]") {
|
||||
$user_url="<a href=\"".$playerUrl.$database->getUserField($dataarray[0], 'id', 0)."\">".$database->getUserField($dataarray[0], 'username', 0)."</a>";
|
||||
}
|
||||
else $user_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
|
||||
if($database->getVillageField($dataarray[1],'name') != "[?]") {
|
||||
$from_url="<a href=\"".$mapUrl.$dataarray[1]."&c=".$generator->getMapCheck($dataarray[1])."\">".$database->getVillageField($dataarray[1], 'name')."</a>";
|
||||
}
|
||||
else $from_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
//defender
|
||||
if ($database->getUserField($dataarray[28], 'username', 0) != "[?]") {
|
||||
$defuser_url="<a href=\"".$playerUrl.$database->getUserField($dataarray[28], 'id', 0)."\">".$database->getUserField($dataarray[28], 'username', 0)."</a>";
|
||||
}
|
||||
else $defuser_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
if($database->isVillageOases($dataarray[29])){
|
||||
$deffrom_url="<a href=\"".$mapUrl.$dataarray[29]."&c=".$generator->getMapCheck($dataarray[29])."\">".$dataarray[30]."</a>";
|
||||
}elseif($database->getVillageField($dataarray[29], 'name') != "[?]") {
|
||||
$deffrom_url="<a href=\"".$mapUrl.$dataarray[29]."&c=".$generator->getMapCheck($dataarray[29])."\">".$database->getVillageField($dataarray[29], 'name')."</a>";
|
||||
}
|
||||
else $deffrom_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="report_surround">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Subject:</th>
|
||||
<th><?php echo $message->readingNotice['topic']; ?></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
$date = $generator->procMtime($message->readingNotice['time']); ?>
|
||||
<td class="sent">Sent:</td>
|
||||
<td>on <span><?php echo $date[0]." at ".$date[1]; ?></span> <span>hour</span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td colspan="2" class="empty"></td></tr>
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="attacker"><thead>
|
||||
<tr>
|
||||
<td class="role">Attacker</td>
|
||||
<td colspan="<?php echo $colspan ?>"><?php echo $user_url;?> from the village <?php echo $from_url;?></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<?php
|
||||
$tribe = $dataarray[2];
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
for($i = $start; $i <= ($start + 9); $i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if(isset($dataarray[184]) && $dataarray[184] > 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
|
||||
for($i = 3; $i <= 12; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
|
||||
if(isset($dataarray[184]) && $dataarray[184] > 0){
|
||||
echo "<td>$dataarray[184]</td>";
|
||||
}
|
||||
echo "<tr><th>Casualties</th>";
|
||||
for($i = 13; $i <= 22; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
if(isset($dataarray[184]) && $dataarray[184] > 0){
|
||||
if ($dataarray[185] == 0) $tdclass='class="none"'; else $tdclass='';
|
||||
echo "<td $tdclass>$dataarray[185]</td>";
|
||||
}
|
||||
if(array_sum(array_slice($dataarray, 186, 11)) > 0){
|
||||
echo "</tr><tr><th>Prisoners</th>";
|
||||
|
||||
for($i = 186; $i <= 195; $i++) {
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
}
|
||||
|
||||
if(isset($dataarray[184]) && $dataarray[184] > 0){
|
||||
if ($dataarray[196] == 0) $tdclass='class="none"'; else $tdclass='';
|
||||
echo "<td $tdclass>$dataarray[196]</td>";
|
||||
}
|
||||
}
|
||||
if (!empty($dataarray[198]) && !empty($dataarray[199])){ //ram
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[198]; ?>" src="img/x.gif" alt="Ram" title="Ram" />
|
||||
<?php echo $dataarray[199]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if (!empty($dataarray[200]) && !empty($dataarray[201])){ //cata
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[200]; ?>" src="img/x.gif" alt="Catapult" title="Catapult" />
|
||||
<?php echo $dataarray[201]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if (!empty($dataarray[202]) && !empty($dataarray[203])){ //chief
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[202]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
|
||||
<?php echo $dataarray[203]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if (!empty($dataarray[205]) && !empty($dataarray[206])){ //hero
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<img class="unit u<?php echo $dataarray[205]; ?>" src="img/x.gif" alt="Hero" title="Hero" />
|
||||
<?php echo $dataarray[206]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }
|
||||
if(isset($dataarray[204]) && !empty($dataarray[204])){ //No troops returned
|
||||
?>
|
||||
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
|
||||
<?php echo $dataarray[204]; ?>
|
||||
</td></tr></tbody>
|
||||
<?php }?>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
$target = $dataarray[34] - 1;
|
||||
$start = ($target * 10) + 1;
|
||||
$troopsStart = ($target * 21) + 35;
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" class="defender">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role">Defender</td>
|
||||
<td colspan="<?php echo $colspan2; ?>"><?php echo $defuser_url." from the village ".$deffrom_url; ?></td>
|
||||
</tr></thead>
|
||||
<tbody class="units">
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
||||
<?php
|
||||
for($i = $start; $i <= ($start + 9); $i++)
|
||||
{
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
for($i = $troopsStart; $i <= $troopsStart + 9; $i++) echo "<td class=\"none\">?</td>";
|
||||
|
||||
echo "<tr><th>Casualties</th>";
|
||||
for($i = $troopsStart + 10; $i <= $troopsStart + 19; $i++) echo "<td class=\"none\">?</td>";
|
||||
?>
|
||||
</tr></tbody></table>
|
||||
</td></tr></tbody></table>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
$dataarray = explode(",",$message->readingNotice['data']);
|
||||
$colspan = (!empty($dataarray[13]) && $dataarray[13] > 0) ? 11 : 10;
|
||||
|
||||
if(!isset($isAdmin)){
|
||||
$mapUrl = "karte.php?d=";
|
||||
$playerUrl = "spieler.php?uid=";
|
||||
}elseif($isAdmin){
|
||||
$mapUrl = "admin.php?p=village&did=";
|
||||
$playerUrl = "admin.php?p=player&uid=";
|
||||
}
|
||||
|
||||
if ($database->getUserField($dataarray[1], 'username', 0) != "[?]" || $dataarray[1] == 0) {
|
||||
$user_url="<a href=\"".$playerUrl.$database->getUserField($dataarray[1], "id", 0)."\">".($dataarray[1] == 0 ? "taskmaster" : $database->getUserField($dataarray[1], 'username', 0))."</a>";
|
||||
}
|
||||
else $user_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
|
||||
if($database->getVillageField($dataarray[0],'name') != "[?]" || $dataarray[0] == 0) {
|
||||
$from_url=($dataarray[0] == 0)? "village of the elders" : "<a href=\"".$mapUrl.$dataarray[0]."&c=".$generator->getMapCheck($dataarray[0])."\">".$database->getVillageField($dataarray[0], 'name')."</a>";
|
||||
}
|
||||
else $from_url="<font color=\"grey\"><b>[?]</b></font>";
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="report_surround">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Subject:</th>
|
||||
<th><?php echo $message->readingNotice['topic']; ?></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<?php
|
||||
$date = $generator->procMtime($message->readingNotice['time']); ?>
|
||||
<td class="sent">Sent:</td>
|
||||
<td>on <span><?php echo $date[0]." at ".$date[1]; ?></span><span> </span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td colspan="2" class="empty"></td></tr>
|
||||
<tr><td colspan="2" class="report_content">
|
||||
<table cellpadding="1" cellspacing="1" id="reinforcement">
|
||||
|
||||
<thead><tr>
|
||||
<td class="role">sender</td><td colspan="<?php echo $colspan ?>"><?php echo $user_url;?> from the village <?php echo $from_url;?></td></tr></thead>
|
||||
<tbody class="units"><tr>
|
||||
<td> </td>
|
||||
<?php
|
||||
$tribe = $dataarray[2];
|
||||
$start = ($tribe - 1) * 10 + 1;
|
||||
for($i = $start; $i <= ($start + 9); $i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($dataarray[13] > 0) echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" /></td>";
|
||||
|
||||
echo "</tr><tr><th>Troops</th>";
|
||||
for($i = 3; $i < 13; $i++) {
|
||||
$unitarray['u'.($i - 3 + $start)] = $dataarray[$i];
|
||||
|
||||
if($dataarray[$i] == 0) echo "<td class=\"none\">0</td>";
|
||||
else echo "<td>".$dataarray[$i]."</td>";
|
||||
|
||||
}
|
||||
if($dataarray[13] > 0) {
|
||||
echo "<td>".$dataarray[13]."</td>";
|
||||
$unitarray['hero'] = 1;
|
||||
}
|
||||
|
||||
?></tr></tbody>
|
||||
<tbody class="infos"><tr><th>upkeep</th><td colspan="11">
|
||||
<?php echo $database->getUpkeep($unitarray, $dataarray[2], $village->wid); ?><img src="img/x.gif" class="r4" title="Crop" alt="{$smarty.const.CROP}" />per hour</td>
|
||||
</tr></tbody>
|
||||
</table></td></tr></tbody></table>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include($database->getNotice2($_GET['id'], 'archive').".tpl");
|
||||
?>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
$noticeClass = ["Scout Report", "Won as attacker without losses", "Won as attacker with losses", "Lost as attacker with losses", "Won as defender without losses", "Won as defender with losses", "Lost as defender with losses", "Lost as defender without losses", "Reinforcement arrived", "",
|
||||
"Wood Delivered", "Clay Delivered", "Iron Delivered", "Crop Delivered", "", "Won as defender without losses", "Won as defender with losses", "Lost as defender with losses", "Won scouting as attacker", "Lost scouting as attacker", "Won scouting as defender", "Lost scouting as defender",
|
||||
"Scout Report"];
|
||||
?>
|
||||
<form method="post" action="berichte.php" name="msg">
|
||||
<table cellpadding="1" cellspacing="1" id="overview"
|
||||
class="row_table_data">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">Subject:</th>
|
||||
<th class="sent">
|
||||
<a href="berichte.php?o=1<?php echo (isset($_GET['t']) ? '&t='.$_GET['t'] : ''); ?>">Sent</a></th>
|
||||
</tr>
|
||||
</thead><tfoot>
|
||||
<tr><th><?php
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT plus FROM ".TB_PREFIX."users WHERE `id`='".(int) $session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$date2=strtotime("NOW");
|
||||
if ($golds['plus'] <= $date2) { ?>
|
||||
<?php } else { ?>
|
||||
<input class="check" type="checkbox" id="s10" name="s10" onclick="Allmsg(this.form);" />
|
||||
<?php } ?></th>
|
||||
<th class="buttons"><input name="del" type="image" id="btn_delete" class="dynamic_img" src="img/x.gif" value="delete" alt="delete" />
|
||||
<?php if($session->plus) {
|
||||
if(isset($_GET['t']) && $_GET['t'] == 5) {
|
||||
echo "<input name=\"start\" type=\"image\" value=\"back\" alt=\"back\" id=\"btn_back\" class=\"dynamic_img\" src=\"img/x.gif\" />";
|
||||
}
|
||||
else {
|
||||
echo "<input name=\"archive\" type=\"image\" value=\"Archive\" alt=\"Archive\" id=\"btn_archiv\" class=\"dynamic_img\" src=\"img/x.gif\" />";
|
||||
}
|
||||
}?>
|
||||
</th>
|
||||
<th class=navi>
|
||||
<?php
|
||||
if(!isset($_GET['s']) && count($message->noticearray) < 10) {
|
||||
echo "«»";
|
||||
}
|
||||
else if (!isset($_GET['s']) && count($message->noticearray) > 10) {
|
||||
echo "«<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&' : '')."s=10&o=".(!empty($_GET['o']) ? $_GET['o'] : 0)."\">»</a>";
|
||||
}
|
||||
else if(isset($_GET['s']) && count($message->noticearray) > $_GET['s']) {
|
||||
if(count($message->noticearray) > ($_GET['s']+10) && $_GET['s']-10 < count($message->noticearray) && $_GET['s'] != 0) {
|
||||
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&' : '')."s=".($_GET['s']-10)."&o=".(!empty($_GET['o']) ? $_GET['o'] : 0)."\">«</a><a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&' : '')."s=".($_GET['s']+10)."&o=".(!empty($_GET['o']) ? $_GET['o'] : 0)."\">»</a>";
|
||||
}
|
||||
else if(count($message->noticearray) > $_GET['s']+10) {
|
||||
echo "«<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&' : '')."s=".($_GET['s']+10)."&o=".(!empty($_GET['o']) ? $_GET['o'] : 0)."\">»</a>";
|
||||
}
|
||||
else if (count($message->noticearray) > 10) {
|
||||
echo "<a href=\"?".(!empty($_GET['t']) ? 't='.$_GET['t'].'&' : '')."s=".($_GET['s']-10)."&o=".(!empty($_GET['o']) ? $_GET['o'] : 0)."\">«</a>»";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if(isset($_GET['s'])) $s = $_GET['s'];
|
||||
else $s = 0;
|
||||
|
||||
$name = 1;
|
||||
$count = 0;
|
||||
for($i = (1 + $s); $i <= (10 + $s); $i++){
|
||||
if(count($message->noticearray) >= $i){
|
||||
echo "<tr><td class=\"sel\"><input class=\"check\" type=\"checkbox\" name=\"n" . $name . "\" value=\"" . $message->noticearray[$i - 1]['id'] . "\" /></td>
|
||||
<td class=\"sub\">";
|
||||
$type = (isset($_GET['t']) && $_GET['t'] == 5) ? $message->noticearray[$i - 1]['archive'] : $message->noticearray[$i - 1]['ntype'];
|
||||
if($type == 23) $type = 22;
|
||||
if($type >= 15 && $type <= 17){
|
||||
$type -= 11;
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"" . $noticeClass[$type] . "\" title=\"" . $noticeClass[$type] . "\" />";
|
||||
}else if($type >= 18 && $type <= 22){
|
||||
echo "<img src=\"gpack/travian_default/img/scouts/$type.gif\" alt=\"" . $noticeClass[$type] . "\" title=\"" . $noticeClass[$type] . "\" />";
|
||||
}else{
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport$type\" alt=\"" . $noticeClass[$type] . "\" title=\"" . $noticeClass[$type] . "\" />";
|
||||
}
|
||||
echo "<div><a href=\"berichte.php?id=" . $message->noticearray[$i - 1]['id'] . "\">" . $message->noticearray[$i - 1]['topic'] . "</a> ";
|
||||
if($message->noticearray[$i - 1]['viewed'] == 0){
|
||||
echo "(new)";
|
||||
}
|
||||
$date = $generator->procMtime($message->noticearray[$i - 1]['time']);
|
||||
echo "</div></td><td class=\"dat\">" . $date[0] . " " . $date[1] . "</td></tr>";
|
||||
}
|
||||
$name++;
|
||||
}
|
||||
if(count($message->noticearray) == 0) echo "<td colspan=\"3\" class=\"none\">There are no reports available.</td></tr>";
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user