mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
fix: logging works, tech log link added to Admin
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
$id = $_GET['did'];
|
||||
if(isset($id))
|
||||
{
|
||||
?>
|
||||
<br /><br />
|
||||
<table id="profile">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" class="on"><a href="#"><?php echo $village['name']; ?></a>'s Research Log</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 12%">#</td>
|
||||
<td>Event</td>
|
||||
<td>Date</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$sql = "SELECT * FROM ".TB_PREFIX."tech_log WHERE wid = ".(int) $_GET['did']."";
|
||||
$result = mysqli_query($GLOBALS["link"], $sql);
|
||||
$j = 0;
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.++$j.'</td>
|
||||
<td>'.$row['log'].'</td>
|
||||
<td style="white-space: nowrap">'.$row['date'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
</thead>
|
||||
</table><?php
|
||||
}
|
||||
else
|
||||
{
|
||||
include("404.tpl");
|
||||
}
|
||||
?>
|
||||
@@ -54,7 +54,7 @@ if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!");
|
||||
if($_SESSION['access'] == ADMIN)
|
||||
{
|
||||
if($tribe==5) { echo '<span class="none">Upgrades Troops</span>';}
|
||||
else { echo '<a href="admin.php?p=addABTroops&did='.$_GET['did'].'">Upgrades Troops</a>';}
|
||||
else { echo '<a href="admin.php?p=addABTroops&did='.$_GET['did'].'">Upgrades Troops</a><a href="admin.php?p=techlog&did='.$_GET['did'].'" style="float: right">Research Log</a>';}
|
||||
}
|
||||
if(isset($_GET['ab'])){
|
||||
echo '<div align="right"><font color="Red"><b>AB Tech Troops upgrades</font></b></div>';
|
||||
|
||||
@@ -10,20 +10,22 @@ if(isset($id))
|
||||
<th colspan="3" class="on"><a href="#"><?php echo $village['name']; ?></a>'s Build Log</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="on">#</td>
|
||||
<td style="width: 12%">#</td>
|
||||
<td>Event</td>
|
||||
<td>Date</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
$sql = "SELECT * FROM ".TB_PREFIX."build_log WHERE wid = ".(int) $_GET['did']."";
|
||||
$result = mysqli_query($GLOBALS["link"], $sql);
|
||||
$j = 0;
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$j++;
|
||||
echo '
|
||||
<tr>
|
||||
<td class="on">'.$j.'</td>
|
||||
<td>'.++$j.'</td>
|
||||
<td>'.$row['log'].'</td>
|
||||
<td style="white-space: nowrap">'.$row['date'].'</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -351,6 +351,16 @@ if (!empty($_GET['p'])) {
|
||||
$subpage = 'Build Log (no village)';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'techlog':
|
||||
if (!empty($_GET['did'])) {
|
||||
$village = $database->getVillage($_GET['did']);
|
||||
$user = $database->getUserArray($village['owner'],1);
|
||||
$subpage = 'Research Log ('.$village['name'].' » '.$user['username'].')';
|
||||
} else {
|
||||
$subpage = 'Research Log (no village)';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
## Copyright: TravianZ (c) 2010-2014. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
if(!isset($_SESSION)) session_start();
|
||||
if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!");
|
||||
include_once("../../Database.php");
|
||||
@@ -25,7 +24,7 @@ for($i=1; $i<9; $i++) {
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."abdata SET ".$atech.$btech." WHERE vref = $id";
|
||||
$database->query($q);
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop anmount in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop upgrade levels in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=village&did=".$id."&ab");
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ for($i=1; $i<11; $i++) {
|
||||
}
|
||||
$q = "UPDATE ".TB_PREFIX."units SET ".$units." WHERE vref = ".(int) $id;
|
||||
$database->query($q);
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop anmount in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop amounts in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=village&did=".$id."&d");
|
||||
?>
|
||||
@@ -126,7 +126,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Admin Info',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Extra server settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Log Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed NewsBox Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed PLUS setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed PLUS Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed General Server Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Logging {
|
||||
$log .= "access village $ref";
|
||||
break;
|
||||
}
|
||||
$q = "Insert into ".TB_PREFIX."illegal_log values (0,$uid,'$log')";
|
||||
$q = "Insert into ".TB_PREFIX."illegal_log SET user = $uid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class Logging {
|
||||
global $database;
|
||||
list($id,$ip) = $database->escape_input((int) $id,$ip);
|
||||
if(LOG_LOGIN) {
|
||||
$q = "Insert into ".TB_PREFIX."login_log values (0,$id,'$ip')";
|
||||
$q = "Insert into ".TB_PREFIX."login_log SET uid = $id, ip = '".$_SERVER['REMOTE_ADDR']."'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,8 @@ class Logging {
|
||||
else {
|
||||
$log = "Start Upgrade of ";
|
||||
}
|
||||
$log .= $building." at level ".$level;
|
||||
$q = "Insert into ".TB_PREFIX."build_log values (0,$wid,'$log')";
|
||||
$log .= $building." to level ".$level;
|
||||
$q = "Insert into ".TB_PREFIX."build_log SET wid = $wid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ class Logging {
|
||||
list($wid,$tech,$level) = $database->escape_input((int) $wid,$tech,$level);
|
||||
if(LOG_TECH) {
|
||||
$log = "Upgrading of tech ".$tech." to level ".$level;
|
||||
$q = "Insert into ".TB_PREFIX."tech_log values (0,$wid,'$log')";
|
||||
$q = "Insert into ".TB_PREFIX."tech_log SET wid = $wid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class Logging {
|
||||
else if($type == 2) {
|
||||
$log = "Traded resource between ".$wid." and ".$data[0]." market ref is ".$data[1];
|
||||
}
|
||||
$q = "Insert into ".TB_PREFIX."market_log values (0,$wid,'$log')";
|
||||
$q = "Insert into ".TB_PREFIX."market_log SET wid = $wid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -107,8 +107,8 @@ class Logging {
|
||||
//fwrite($fh,"\n".date("Y-m-d H:i:s")." : ".$time.",".$uid.",".$debug_info."\n");
|
||||
//fclose($fh);
|
||||
|
||||
$q = "INSERT INTO ".TB_PREFIX."debug_log (time,uid,debug_info) VALUES ($time,$uid,'$debug_info')";
|
||||
$database->query($q);
|
||||
//$q = "INSERT INTO ".TB_PREFIX."debug_log (time,uid,debug_info) VALUES ($time,$uid,'$debug_info')";
|
||||
//$database->query($q);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ else if(isset($_GET['c'])) {
|
||||
for($i=1;$i<=count($session->villages);++$i){echo'
|
||||
<tr>
|
||||
<td class="dot '.(($_SESSION['wid'] == $returnVillageArray[$i-1]['wref'] ) ? 'hl':'').'">●</td>
|
||||
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&d=".$_GET['d']).(($id>=19) ? "&id=".$id : "&c=".$_GET['c']).'">'.$returnVillageArray[$i-1]['name'].'</a></td>
|
||||
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : (isset($_GET['d']) ? "&d=".$_GET['d'] : '')).(($id>=19) ? "&id=".$id : "&c=".$_GET['c']).'">'.$returnVillageArray[$i-1]['name'].'</a></td>
|
||||
<td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
+28
-1
@@ -10,7 +10,34 @@
|
||||
#################################################################################
|
||||
|
||||
|
||||
$txt="sdsad";
|
||||
$txt="World Wonder Construction Plans
|
||||
|
||||
|
||||
Many moons ago the tribes of Travian were surprised by the unforeseen return of the Natars. This tribe from immemorial times surpassing all in wisdom, might and glory was about to trouble the free ones again. Thus they put all their efforts in preparing a last war against the Natars and vanquishing them forever. Many thought about the so-called 'Wonders of the World', a construction of many legends, as the only solution. It was told that it would render anyone invincible once completed. Ultimately making the constructors the rulers and conquerors of all known Travian.
|
||||
|
||||
However, it was also told that one would need construction plans to construct such a building. Due to this fact, the architects devised cunning plans about how to store these safely. After a while, one could see temple-like buildings in many a city and metropolis - the Treasure Chambers (Treasuries).
|
||||
|
||||
Sadly, no one - not even the wise and well versed - knew where to find these construction plans. The harder people tried to locate them, the more it seemed as if they where only legends.
|
||||
|
||||
Today, however, this last secret will be revealed. Deprivations and endeavors of the past will not have been in vain, as today scouts of several tribes have successfully obtained the whereabouts of the construction plans. Well guarded by the Natars, they lie hidden in several oases to be found all over Travian. Only the most valiant heroes will be able to secure such a plan and bring it home safely so that the construction can begin.
|
||||
|
||||
In the end, we will see whether the free tribes of Travian can once again outwit the Natars and vanquish them once and for all. Do not be so foolish as to assume that the Natars will leave without a fight, though!
|
||||
|
||||
|
||||
|
||||
To steal a set of Construction Plans from the Natars, the following things must happen:
|
||||
- You must Attack the village (NOT Raid!)
|
||||
- You must WIN the Attack
|
||||
- You must DESTROY the Treasure Chamber (Treasury)
|
||||
- Your Hero MUST be in that attack, as he is the only one who may carry the Construction Plans
|
||||
- An empty level 10 Treasure Chamber (Treasury) MUST be in the village where that attack came from
|
||||
NOTE: If the above criteria is not met during the attack, the next attack on that village which does meet the above criteria will take the Construction Plans.
|
||||
|
||||
|
||||
|
||||
To build a Treasure Chamber (Treasury), you will need a Main Building level 10 and the village MUST NOT be contain a World Wonder.
|
||||
|
||||
To build a World Wonder, you must own the Construction Plans yourself (you = the World Wonder Village Owner) from level 0 to 50, and then from level 51 to 100 you will need an additional set of Construction Plans in your Alliance! Two sets of Construction Plans in the World Wonder Village Account will not work!";
|
||||
|
||||
//bbcode = html code
|
||||
$txt = preg_replace("/\[b\]/is",'<b>', $txt);
|
||||
|
||||
Reference in New Issue
Block a user