".$lang_iphistory['text_historical_ip_by'] . get_username($userid)."");
if ($countrows > $perpage)
echo $pagertop;
print("
\n");
print("\n
| ".$lang_iphistory['col_last_access']." | \n
".$lang_iphistory['col_ip']." | \n
".$lang_iphistory['col_hostname']." | \n
\n");
while ($arr = mysql_fetch_array($res))
{
$addr = "";
$ipshow = "";
if ($arr["ip"])
{
$ip = $arr["ip"];
$dom = @gethostbyaddr($arr["ip"]);
if ($dom == $arr["ip"] || @gethostbyname($dom) != $arr["ip"])
$addr = $lang_iphistory['text_not_available'];
else
$addr = $dom;
$queryc = "SELECT COUNT(*) FROM
(
SELECT u.id FROM users AS u WHERE u.ip = " . sqlesc($ip) . "
UNION SELECT u.id FROM users AS u RIGHT JOIN iplog ON u.id = iplog.userid WHERE iplog.ip = " . sqlesc($ip) . "
GROUP BY u.id
) AS ipsearch";
$resip = sql_query($queryc) or sqlerr(__FILE__, __LINE__);
$arrip = mysql_fetch_row($resip);
$ipcount = $arrip[0];
if ($ipcount > 1)
$ipshow = "" . $arr['ip'] ." (".$lang_iphistory['text_duplicate'].")";
else
$ipshow = "" . $arr['ip'] ."";
}
$date = gettime($arr["access"]);
print("| ".$date." | \n");
print("".$ipshow." | \n");
print("".$addr." |
\n");
}
print("
");
echo $pagerbottom;
end_main_frame();
stdfoot();
die;
?>