Page 1 of 1
Would like to display member number
Posted:
October 10th, 2011, 2:51 pm
by mochajen
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
Re: Would like to display member number
Posted:
October 10th, 2011, 2:58 pm
by Eduan
You mean like: "Member ID: sjio596kl" or something like that?
Re: Would like to display member number
Posted:
October 10th, 2011, 3:38 pm
by mochajen
Yes, exactly. What is the shortcode or php to call that?
Re: Would like to display member number
Posted:
October 10th, 2011, 4:08 pm
by Eduan
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.
Re: Would like to display member number
Posted:
October 10th, 2011, 4:11 pm
by Eduan
Found something that may work, try to put this where you want to put it:
%%current_user_id%%
Re: Would like to display member number
Posted:
October 10th, 2011, 5:20 pm
by mochajen
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?
Re: Would like to display member number
Posted:
October 10th, 2011, 5:43 pm
by Eduan
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.
Re: Would like to display member number
Posted:
October 10th, 2011, 7:53 pm
by mochajen
So far I've seen those work via email, the widget and the platform but not interpreted as anything but text by Wordpress.
Re: Would like to display member number
Posted:
October 10th, 2011, 8:21 pm
by Eduan
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_idHope this helps
.
P.S. I tried this with the Pro Login Widget.
Re: Would like to display member number
Posted:
October 10th, 2011, 11:05 pm
by mochajen
High five.
Re: Would like to display member number
Posted:
October 11th, 2011, 6:22 am
by Eduan
Re: Would like to display member number
Posted:
October 11th, 2011, 2:11 pm
by Cristián Lávaque
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 ContantsI hope that helps.