fix: logging works, tech log link added to Admin

This commit is contained in:
Martin Ambrus
2017-11-07 10:34:50 +01:00
parent 6a332f292b
commit 8a7f12268c
15 changed files with 100 additions and 23 deletions
+8 -8
View File
@@ -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);
}
};