$_SERVER["REMOTE_ADDR"] works fine, have used it already in "ioHTTPD" on LAN-parties. On the internet u might have to deal with proxyservers (force users to disable them for the RSS-feed).
Edit: something i found between al my crappy code:
Code:
function FindUserIdByIP($ip)
{
$resultid = -1; // default return value
$userlist = io_user_list_init(); // create userlist
$usermask = io_user_mask_init(UINFO_IPLIST); // create usermask; we only need list of IP's
// fetch userid's
$uid = io_user_list_fetch($userlist);
while($resultid == -1 && $uid >= 0)
{
$userfile = io_user_open($uid); // open userfile
$a = io_user_query($userfile, $usermask); // get info
io_user_close($userfile); // close userfile
// check all IP's
for ($i=1; $i <= $a[0]; $i++)
{
// extract ip from "ident@ip" format
if (strpos($a[$i], "@") > 0) { $userip = substr($a[$i], strpos($a[$i],"@")+1, strlen($a[$i])); }
else { $userip = $a[$i]; }
if ($userip == $ip)
{
$resultid = $uid;
break;
}
}
// get next userid from list
$uid = io_user_list_fetch($userlist);
}
io_user_mask_close($usermask); // close usermask
io_user_list_close($userlist); // close userlist
return $resultid;
}