7
I figured out a way that stores the users ip address when they visit the site.
Using this sql, create a field in the xoops_users table with this criteria.
`last_known_ip` varchar(100) NOT NULL default '',
Ok, now edit the checklogin.php file in the include directory and add these lines to it. Make sure that you find the lines called out below.
// RMV-NOTIFY
// Perform some maintenance of notification records
$notification_handler =& xoops_gethandler('notification');
$notification_handler->doLoginMaintenance($user->getVar('uid'));
////////// BEGIN LOGGING OF USER IP
$lognom = $user->getVar('uname');
$addip = getenv("REMOTE_ADDR");
mysql_query("UPDATE ".$xoopsDB->prefix("users")." SET last_known_ip='$addip' WHERE uname='$lognom'");
//////// END LOGGING OF USER IP
redirect_header($url, 1, sprintf(_US_LOGGINGU, $user->getVar('uname')));
} else {
redirect_header(XOOPS_URL.'/user.php',1,_US_INCORRECTLOGIN);
}
exit();
?>
This code is almost at the bottom of the file. Just add the lines noted above right after the $notification_handler call.
Now what this does is every time that a user logs into the site, it updates his/her information with the ip address of where they were accessing your site from. Granted this information is only valuable if you use it, but being that I need the ip address to associate it with a country flag, it is very much necessary for bf2online.com.
Enjoy!