declared resolvedHosts array and expand all TABs to spaces

This commit is contained in:
Juri Hamburg 2012-03-03 11:11:50 +01:00
parent df7366a453
commit 4ec6623ed2

View File

@ -840,6 +840,7 @@ class serendipity_event_statistics extends serendipity_event
<dd>
<table width="100%" cellpadding="0" cellspacing="0">
<?php
$resolvedHosts = array();
$i=1;
$color = "col2";
if (is_array($visitors_latest)) {
@ -857,13 +858,13 @@ class serendipity_event_statistics extends serendipity_event
echo "<td class = \"".$color."\">".wordwrap($row['browser'], 25, "<br />", 1)."</td>\n";
echo "<td class = \"".$color."\">";
if ($row['ip']){
$curIP = $row['ip'];
if (array_key_exists($curIP, $resolvedHosts)) {
$resolvedHost = $resolvedHosts[$curIP];
} else {
$resolvedHost = gethostbyaddr($curIP);
$resolvedHosts[$curIP] = $resolvedHost;
}
$curIP = $row['ip'];
if (array_key_exists($curIP, $resolvedHosts)) {
$resolvedHost = $resolvedHosts[$curIP];
} else {
$resolvedHost = gethostbyaddr($curIP);
$resolvedHosts[$curIP] = $resolvedHost;
}
echo wordwrap($resolvedHost, 25, "\n", 1);
} else {
echo "--";