Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Get IP address that can pass current $user_ID?

@vegasparty607

Participant

idk I found one that seemed like it passed the $user_id for the comments

`// applied to the comment author’s IP address prior to saving the comment in the database.
function auto_reverse_proxy_pre_comment_user_ip()
{
if ( !empty($_SERVER) )
{
$X_FORWARDED_FOR=explode(“,”, $_SERVER);
$REMOTE_ADDR=trim($X_FORWARDED_FOR[0]); //take the first element in the array
} else {
$REMOTE_ADDR=$_SERVER;
}
return $REMOTE_ADDR;
}
add_filter ( ‘pre_comment_user_ip’,’auto_reverse_proxy_pre_comment_user_ip’);`

but i tried it, and the ips are still all mine.

for some reason when i put your code in bp-custom.php it doesn’t work, so i think what is holding it up is the

`if ( update_user_meta( $user_id, ‘ip_address’, $ip_address ) )`

Skip to toolbar