Support Forum
Hello:
I'm trying to get some of the data collected in my S2member registration form to show up on users' profiles in Simple:Press 5.0. How would I do that? I'm seeing users' usernames, and first and last names in Simple:press, but not any other data collected.
This may not have anything to do with my problem, but just for the record: I've activated the Simple:Press Custom Profile plug-in, and created a new field. However, that custom field is not showing up either.
Let me know what you need, such as login info, and I'll send it to you.
Thanks.
that plugin would have to provide a method for accessing its data...
the custom profile field plugin wont do what you want... its for adding new forms to the sp profile for users to fill in... it wont pull existing data from other locations... how could it possibly know how?
If you used the custom profile field for new data, you need to put the template tag where you want it to display... again, we couldnt possible begin to know where you want to display the data... we put the input parts on the edit profile form for users to add their data, but its up to you to use the template tag to display the info where you want...
The protoype for displaying a tag is:
sp_CustomProfileFieldsDisplay($name, $userid=0)
where you pass the field name (see the admin profile panel where you named it) for $name and pass the user id in $userid for the user whose info you want to display... leave it blank if you want the current user...
alternatively, if you want to just grab the data for the current user, you can get it at $spThisUser->field_slug, where field_slug is the slug of the custom profile field (again visible on the admin form)... or if you have a sp user object, such as the profile user ($spProfileUser) or post user ($spThisPostUser) object, you can get at it similarly...
or use the user object to pass in the id to the template tag...
you can see more on this here: https://simple-press.com/suppo.....-1/page-2/
Visit Cruise Talk Central and Mr Papa's World
Hi Mr. Papa,
So, I went to S2member's forum and told that developer I needed a method for accessing the S2member data…
This is what I got back:
"You can get most if not all of your user details through pre-defined tags like:
[s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]
S2MEMBER_CURRENT_USER_FIRST_NAME
S2MEMBER_CURRENT_USER_LAST_NAME
S2MEMBER_CURRENT_USER_ID
S2MEMBER_CURRENT_USER_LOGIN
S2MEMBER_CURRENT_USER_EMAIL
etc.
Not sure how you need to use it but there you go. You can also access the constants via php like so:
<?php echo S2MEMBER_CURRENT_USER_EMAIL; ?>
EDIT: This also works with custom registration fields I believe."
So, I tried to use the above tags in the spProfileShow.php template in the Simple:Press Theme Editor. However, it kept coming up with errors. I suspect I'm not putting the tags in the template properly, or something is missing, as I'm still learning .php. Could you show me where in the spProfileShow.php template the tags should go, and anything else I'm missing?
Thank you so much. I think I'm close to the getting the custom profile fields in S2member to show up in the Simple:Press user profiles.
not sure what you are trying to do... are you trying to output some of the s2member data on the profile page or popup?
you wouldnt need the custom profile field plugin for that.... but suspect you are trying to do 2 things here...
so to display s2 data in the profile page (not edit form) or popup, yes, edit the template file in the sp theme you are using... and do something like
do_shortcode('[s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]')
if you want different data, just change the string for constant to be the one you want...
Visit Cruise Talk Central and Mr Papa's World
"not sure what you are trying to do… are you trying to output some of the s2member data on the profile page or popup?"
Yes, output in the popup in Simple:Press.
Note: I realize I wouldn't need the custom profile plugin in for Simple:Press. Thank you for pointing that out.
"so to display s2 data in the profile page (not edit form) or popup, yes, edit the template file in the sp theme you are using… and do something like
if you want different data, just change the string for constant to be the one you want…"
What is the template called (I'm not sure of it's name) to make it show up in a popup of the user's Simple:Press profile? Where in the popup code do I insert the above tag?
And do I include all of this exactly as it's typed: shortcode('[s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]')
I inserted [s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /] just exactly as it's typed before, but it came up with an error.
Thank you for all of your help.
your code does not match mine...
the function call should be do_shortcode
please use that... and if you still get errors, please paste exactly your code plus a couple lines above and below the line...
Visit Cruise Talk Central and Mr Papa's World
After pasting do_shortcode('[s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]'), I keep getting errors like this one:
Parse error: syntax error, unexpected T_STRING in /problem-with-post-edit-buttonome/problem-with-post-edit-buttonazbro/public_html/oddhoursnews.com/wp-content/sp-resources/forum-themes/default/templates/spProfileShow.php on line 35
do you have a semicolor (ie 😉 at the end of the line?
Visit Cruise Talk Central and Mr Papa's World