query("SELECT um.Username, p.Level AS Class FROM users_main AS um LEFT JOIN permissions AS p ON p.ID=um.PermissionID WHERE um.ID = ".$UserID); list($Username, $Class) = $DB->next_record(); if(!check_perms('users_view_ips', $Class)) { error(403); } $UsersOnly = $_GET['usersonly']; show_header("IP history for $Username"); ?>
query("SELECT SQL_CALC_FOUND_ROWS h1.IP, h1.StartTime, h1.EndTime, GROUP_CONCAT(h2.UserID SEPARATOR '|'), GROUP_CONCAT(h2.StartTime SEPARATOR '|'), GROUP_CONCAT(h2.EndTime SEPARATOR '|'), GROUP_CONCAT(um2.Username SEPARATOR '|'), GROUP_CONCAT(um2.Enabled SEPARATOR '|'), GROUP_CONCAT(ui2.Donor SEPARATOR '|'), GROUP_CONCAT(ui2.Warned SEPARATOR '|') FROM users_history_ips AS h1 LEFT JOIN users_history_ips AS h2 ON h2.IP=h1.IP AND h2.UserID!=$UserID LEFT JOIN users_main AS um2 ON um2.ID=h2.UserID LEFT JOIN users_info AS ui2 ON ui2.UserID=h2.UserID WHERE h1.UserID='$UserID' AND h2.UserID>0 GROUP BY h1.IP, h1.StartTime ORDER BY h1.StartTime DESC LIMIT $Limit"); } else { $RS = $DB->query("SELECT SQL_CALC_FOUND_ROWS h1.IP, h1.StartTime, h1.EndTime, GROUP_CONCAT(h2.UserID SEPARATOR '|'), GROUP_CONCAT(h2.StartTime SEPARATOR '|'), GROUP_CONCAT(h2.EndTime SEPARATOR '|'), GROUP_CONCAT(um2.Username SEPARATOR '|'), GROUP_CONCAT(um2.Enabled SEPARATOR '|'), GROUP_CONCAT(ui2.Donor SEPARATOR '|'), GROUP_CONCAT(ui2.Warned SEPARATOR '|') FROM users_history_ips AS h1 LEFT JOIN users_history_ips AS h2 ON h2.IP=h1.IP AND h2.UserID!=$UserID LEFT JOIN users_main AS um2 ON um2.ID=h2.UserID LEFT JOIN users_info AS ui2 ON ui2.UserID=h2.UserID WHERE h1.UserID='$UserID' GROUP BY h1.IP, h1.StartTime ORDER BY h1.StartTime DESC LIMIT $Limit"); } $DB->query("SELECT FOUND_ROWS()"); list($NumResults) = $DB->next_record(); $DB->set_query_id($RS); $Pages=get_pages($Page,$NumResults,IPS_PER_PAGE,9); ?>

IP history for

to_array(); foreach($Results as $Index => $Result) { list($IP, $StartTime, $EndTime, $UserIDs, $UserStartTimes, $UserEndTimes, $Usernames, $UsersEnabled, $UsersDonor, $UsersWarned) = $Result; $HasDupe = false; $UserIDs = explode('|', $UserIDs); if(!$EndTime) { $EndTime = sqltime(); } if($UserIDs[0] != 0){ $HasDupe = true; $UserStartTimes = explode('|', $UserStartTimes); $UserEndTimes = explode('|', $UserEndTimes); $Usernames = explode('|', $Usernames); $UsersEnabled = explode('|', $UsersEnabled); $UsersDonor = explode('|', $UsersDonor); $UsersWarned = explode('|', $UsersWarned); } ?> 10); foreach ($UserIDs as $Key => $Val) { if(!$UserEndTimes[$Key]){ $UserEndTimes[$Key] = sqltime(); } ?>
IP address Started Ended Elapsed
()
('.count($UserIDs).')' : '(0)')?>
  »