You might try this:
[sql]
CREATE TABLE iplog (userid int(10) unsigned NOT NULL, ipaddress varchar(16) NOT NULL, dateline int(10) unsigned NOT NULL, PRIMARY KEY (userid), UNIQUE KEY userip (userid, ipaddress));
[/sql]
Note: If you are using a table prefix you must add it here in front of iplog.
In sessions.php FIND
PHP Code:
$sessioncreated = true;
return $session;
REPLACE that with
PHP Code:
$sessioncreated = true;
if ($session[userid]) {
$DB_site->query("REPLACE INTO " . TABLE_PREFIX . "iplog SET userid=$session[userid], ipaddress='$session[host]', dateline=" . TIMENOW);
}
return $session;
This will create or update records in table iplog whenever a new session is created. To view this log you can use the attached ACP-Script.
If you want, you can also add a link in the ACP menu:
In admincp/index.php FIND
PHP Code:
construct_nav_option($vbphrase['search_ip_addresses'], 'usertools.php?do=doips', '<br />');
BELOW that ADD
PHP Code:
construct_nav_option('IP Log', 'iplog.php?do=searchuser', '<br />');
To keep this simple i've not used phrases, so please forgive me
Keep in mind that this adds a query whenever a new user session is created and the table iplog will get BIG.