| ( ! ) Notice: Undefined index: player in /var/www/html/pages/wiki.php(49) : eval()'d code on line 59 | ||||
|---|---|---|---|---|
| Call Stack | ||||
| # | Time | Memory | Function | Location |
| 1 | 0.0000 | 358760 | {main}( ) | .../index.php:0 |
| 2 | 0.0033 | 390192 | include( '/var/www/html/pages/wiki.php' ) | .../index.php:48 |
| 3 | 0.0075 | 479168 | includestring( ) | .../wiki.php:488 |
| 4 | 0.0078 | 526920 | eval( '?>
= $minDay && this.day_id <= $maxDay}";
$filter["username"] = $playerName;
$days = Keldatabase::playerDaysDocument()->find($filter, ["sort" => ["day_id" => -1]]);
function getDay($previous, $row)
{
$infos = [];
$infos["username"] = $row["username"];
$infos["afk_time"] = (isset($previous) ? $previous["afk_time"] : 0) + $row["afk_time"];
$infos["build_time"] = (isset($previous) ? $previous["build_time"] : 0) + (isset($row["build_time"]) ? $row["build_time"] : 0);
$infos["sessions"] = $row["sessions"];
$totalTime = isset($previous) ? $previous["total_time"] : 0;
foreach ($row["sessions"] as $sess)
{
$totalTime += $sess["last_seen"] - $sess["log_date"];
}
$infos["total_time"] = $totalTime;
return $infos;
}
$hourCount = [];
$totalHourCount = [];
$lastDayIdFound = -1;
foreach ($days as $day)
{
if($day != null)
{
//$stat = [];
$username = $day["username"];
$dayId = $day["day_id"];
if($lastDayIdFound != -1)
{
for($iii = $lastDayIdFound - 1; $iii > $dayId; $iii --)
{
$hourCount[$iii] = (isset($hourCount[$iii]) ? $hourCount[$iii] : 0);
$totalHourCount[$iii] = (isset($totalHourCount[$iii]) ? $totalHourCount[$iii] : 0);
}
}
if($username == $playerName)
{
$lastDayIdFound = $dayId;
$dayInfos = getDay(isset($stats[$username]) ? $stats[$username] : null, $day);
$singleDayInfos = getDay(null, $day);
$stats[$username] = $dayInfos;
$hourCount[$dayId] = (
isset($hourCount[$dayId]) ? $hourCount[$dayId] : 0)
+ ((($singleDayInfos["total_time"] - $singleDayInfos["afk_time"] - $singleDayInfos["build_time"]) / 1000) / 60) / 60;
$totalHourCount[$dayId] = (
isset($totalHourCount[$dayId]) ? $totalHourCount[$dayId] : 0)
+ ((($singleDayInfos["total_time"] ) / 1000) / 60) / 60;
$strictDay = ["sessions" => $dayInfos["sessions"]];
}
else
{
$hourCount[$dayId] = (isset($hourCount[$dayId]) ? $hourCount[$dayId] : 0);
$totalHourCount[$dayId] = (isset($totalHourCount[$dayId]) ? $totalHourCount[$dayId] : 0);
}
}
}
//usort($stats, "cmp");
function cmpActiveTime($a, $b)
{
return (($b["total_time"] - $b["afk_time"] - $b["build_time"]) - ($a["total_time"] - $a["afk_time"] - $a["afk_time"]));
}
usort($stats, "cmpActiveTime");
?>
$value)
{
$tmsp = DateIdConverter::convertIdToTimestamp($key);
if($tmsp < $i)
{
$i = $tmsp;
}
$points[] = [$tmsp, $value];
}
$points[] = [$i - (24 * (60 * 60 * 1000)), 0];
$i = 10000000000000;
foreach($totalHourCount as $key => $value)
{
$tmsp = DateIdConverter::convertIdToTimestamp($key);
if($tmsp < $i)
{
$i = $tmsp;
}
$points2[] = [$tmsp, $value];
}
//echo $tmsp . " )"; $points2[] = [$i - (24 * (60 * 60 * 1000)), 0]; $jsonChart = ["max_players" => $points]; $jsonChart2 = ["max_players2" => $points2]; ?> Statistiques d'activité getName(); ?>Définir l'interval: Définir Filtres par défaut: Depuis toujours Depuis 7 jours Depuis 30 jours Ce mois Cette semaine Aujourd'hui | .../wiki.php:49 |