Page 1 of 1

IP address lookup?

PostPosted: April 29th, 2011, 10:11 am
by mission media
Hello,

Is there a way I can lookup the ip address of a user on my site? I know that S2 keeps track of the ip addresses for security, is there a way I can find the ip address of a certain user?

Thanks,
Brennan

Re: IP address lookup?

PostPosted: April 29th, 2011, 9:21 pm
by Cristián Lávaque
Hi Brennan.

Try the documentation here WP Admin -> s2Member -> API / Scription -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_FIELDS

Let me know if that helps. :)

Re: IP address lookup?

PostPosted: April 30th, 2011, 8:33 am
by Jason Caldwell
Sorry, it's not possible ( yet ) to collect the IP address of a specific User.
Only of the current User, using:
Code: Select all
<?php echo S2MEMBER_CURRENT_USER_IP; ?>

However, this IS going to be possible, starting with s2Member v3.6. We've been reluctant to do this, because we feel it's something that WordPress should do at it's core. But since WordPress has not implemented this either, we are going to go ahead and do so in s2Member v3.6.

I'm flagging this thread so it's updated once this change is ready. At that time, I'll provide instructions on how to obtain this information from within WordPress. Until then, you CAN implement this on your own, through the custom="" Attribute in your Shortcode.

custom="www.your-domain.com|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"
This way s2Member will store the IP address in your database. I've done a video tutorial covering integration with iDevAffiliate, and this was something that I went over in detail in that video. So even though you might not be integrating iDev, this video may prove helpful in this regard. You can watch it here: http://www.s2member.com/idevaffiliate-i ... ion-video/

@FLAG @TODO: This is already completed in the development version, soon to be released.

Re: IP address lookup?

PostPosted: April 30th, 2011, 12:22 pm
by Cristián Lávaque
In the meantime you could try this http://wordpress.org/extend/plugins/wp-record-ip/

Re: IP address lookup?

PostPosted: May 2nd, 2011, 9:49 am
by mission media
Thanks!

Re: IP address lookup?

PostPosted: May 12th, 2011, 7:04 am
by prabu
For the good IP address lookup ,
Just visit this site http://www.whoisxy.com/ip-to-domain.aspx
It has the best information of IP address, IP address to domain, domain name to IP,domain name, DNS lookup., IP address lookup and ping test !!!

Re: IP address lookup?

PostPosted: January 23rd, 2012, 6:45 am
by rapunzel
informative!!!!!!!!!!!!!

Re: IP address lookup?

PostPosted: January 24th, 2012, 3:36 pm
by Jason Caldwell
Starting with s2Member v111220, it is possible to do this.

Current User's IP Address.
Code: Select all
<?php echo get_user_field("ip"); ?>
Or: <?php echo S2MEMBER_CURRENT_USER_IP; ?>

For a specific User/Member, do this:
Code: Select all
<?php echo get_user_field("ip", 123); ?>
* Where 123 is the User's ID in WordPress.

In either case, if the User is currently logged in, you will get their current IP address. Otherwise, you will get the last known IP address recorded by s2Member. If you want to ensure that s2Member only returns the original IP address used to register, you can get this field instead.

Code: Select all
<?php echo get_user_field("s2member_registration_ip"); ?>
Or: <?php echo get_user_field("reg_ip"); ?> (same thing)

See Also: get_user_field()