PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

IP address lookup?

s2Member Plugin. A Membership plugin for WordPress®.

IP address lookup?

Postby mission media » April 29th, 2011, 10:11 am

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
User avatar
mission media
Registered User
Registered User
 
Posts: 8
Joined: April 3, 2011

Re: IP address lookup?

Postby Cristián Lávaque » April 29th, 2011, 9:21 pm

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. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: IP address lookup?

Postby Jason Caldwell » April 30th, 2011, 8:33 am

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.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: IP address lookup?

Postby Cristián Lávaque » April 30th, 2011, 12:22 pm

In the meantime you could try this http://wordpress.org/extend/plugins/wp-record-ip/
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: IP address lookup?

Postby mission media » May 2nd, 2011, 9:49 am

Thanks!
User avatar
mission media
Registered User
Registered User
 
Posts: 8
Joined: April 3, 2011

Re: IP address lookup?

Postby prabu » May 12th, 2011, 7:04 am

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 !!!
User avatar
prabu
Registered User
Registered User
 
Posts: 1
Joined: May 12, 2011

Re: IP address lookup?

Postby rapunzel » January 23rd, 2012, 6:45 am

informative!!!!!!!!!!!!!
User avatar
rapunzel
Registered User
Registered User
 
Posts: 1
Joined: January 23, 2012

Re: IP address lookup?

Postby Jason Caldwell » January 24th, 2012, 3:36 pm

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()
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron