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™

Would like to display member number

s2Member Plugin. A Membership plugin for WordPress®.

Would like to display member number

Postby mochajen » October 10th, 2011, 2:51 pm

I would like to display a member's subscriber number or member number on their profile. If not their profile perhaps the S2Member Login widget. If not the widget, perhaps even a page dedicated to this piece of information using a shortcode or something. Do you know how I can display this piece of information to a member?
Thanks,
Jen
User avatar
mochajen
Registered User
Registered User
 
Posts: 22
Joined: August 13, 2011

Re: Would like to display member number

Postby Eduan » October 10th, 2011, 2:58 pm

You mean like: "Member ID: sjio596kl" or something like that?
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Would like to display member number

Postby mochajen » October 10th, 2011, 3:38 pm

Yes, exactly. What is the shortcode or php to call that?
User avatar
mochajen
Registered User
Registered User
 
Posts: 22
Joined: August 13, 2011

Re: Would like to display member number

Postby Eduan » October 10th, 2011, 4:08 pm

I looked over the s2Member's codex documentation and couldn't find it so I don't think it's possible, but I may be mistaken.
I'm sure Jason or Cristián know if it's possible.
Last edited by Eduan on October 10th, 2011, 9:19 pm, edited 1 time in total.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Would like to display member number

Postby Eduan » October 10th, 2011, 4:11 pm

Found something that may work, try to put this where you want to put it:
%%current_user_id%%
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Would like to display member number

Postby mochajen » October 10th, 2011, 5:20 pm

I have tried that one on a page or in the widget and it takes the % literally. Do I need to put it in a php file instead?
User avatar
mochajen
Registered User
Registered User
 
Posts: 22
Joined: August 13, 2011

Re: Would like to display member number

Postby Eduan » October 10th, 2011, 5:43 pm

Here's another one that you can try:
%%subscr_id%%

P.S. These are Replacement Codes for the PayPal® emails, but maybe they work on other places.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Would like to display member number

Postby mochajen » October 10th, 2011, 7:53 pm

So far I've seen those work via email, the widget and the platform but not interpreted as anything but text by Wordpress.
User avatar
mochajen
Registered User
Registered User
 
Posts: 22
Joined: August 13, 2011

Re: Would like to display member number

Postby Eduan » October 10th, 2011, 8:21 pm

Found the code:
Code: Select all
<?php
$user_id = get_current_user_id();
if ($user_id == 0) {
    echo 'You are currently not logged in.';
} else {
    echo 'You are logged in as user '.$user_id;
}
?>

Edit the echo 'You are currently not logged in.'; and echo 'You are logged in as user '.$user_id; as you want so that it shows what you want, and then put it wherever you want.

I found this on http://codex.wordpress.org/WPMU_Functio ... nt_user_id

Hope this helps :) .

P.S. I tried this with the Pro Login Widget.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Would like to display member number

Postby mochajen » October 10th, 2011, 11:05 pm

High five.
User avatar
mochajen
Registered User
Registered User
 
Posts: 22
Joined: August 13, 2011

Re: Would like to display member number

Postby Eduan » October 11th, 2011, 6:22 am

:)
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Would like to display member number

Postby Cristián Lávaque » October 11th, 2011, 2:11 pm

Great, Eduan, thanks for helping her with that! :)

Mochajen, you can also use one of the constants provided by s2Member. WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Contants

I hope 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


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 0 guests

cron