latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Profile box question

Home Forums Community Forum Profile box question

This topic contains 18 replies, has 3 voices. Last updated by  Steve Schafer 3 years, 6 months ago.

Topic Author Topic
Posted: Sunday Jun 30th, 2013 at 2:07 am #52819

Can we, or can we not allow members to use HTML tags when filling out the multi-line text box in the edit profile page? I have been searching for hours on this. Everything I read said that that is not possible, but your site allows it!

” Forum Profile “About Me” (basic HTML is ok, including IMG tags)”

I am creating a member site, where paid members are going to need to be allowed to make their member profiles kind of like sales pages.

Thanks,
Steve

*edit – It seems to have to do with the forum plugin you are using. It also allows for ranking and what not… What are you using?

List Of Topic Replies

Viewing 18 replies - 1 through 18 (of 18 total)
Author Replies
Author Replies
Posted: Monday Jul 1st, 2013 at 2:15 am #52832

Second issue…

You see the link you have in your sidebar widget that says “My public Profile”? How do I do that?

I have been searching everywhere, swearing at Google, pounding on my keyboard, etc. for two days now, just to try to get this plugin to do the most basic things.

I appreciate that there is a lot of functionality to this plugin, and a lot of people have a lot of complex needs, but can we try to focus on some of the more basic aspects – like making the membership plugin more desirable for the members that join through it? I am trying to give my members a high quality experience. A nice profile page, where they can showcase their talents, the availability to navigate through their member dashboard in a way that males sense, etc…

I have not had time to even do anything about how the site will function because I have spent the last 2 days, solid, trying to get through the most basic of things.

How do I allow my members to be able to use html on their profile fields? How do I add a “View Profile” link to my login widget? Is is possible to have a “member profile” that looks halfway decent?

Please do not direct me to the codex. i do not even know what it means, or how to use it.

Thanks.

Posted: Monday Jul 1st, 2013 at 9:28 pm #52850

Guys please? For 3 days I have been trying to get this figured out. I can go no further without this, and I am losing money by the hour.

Really simple. How do I add a “View Your Profile” link to the pro widget (like you did)
How do I allow members to use HTML tags to make tier profiles nicer? (like you did)

I am not asking for anything new. Just give me the code please. Or refund me.

Posted: Tuesday Jul 2nd, 2013 at 3:08 am #52859
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

And thank you for your patience over the weekend.

Can we, or can we not allow members to use HTML tags when filling out the multi-line text box in the edit profile page? I have been searching for hours on this. Everything I read said that that is not possible, but your site allows it!

*edit – It seems to have to do with the forum plugin you are using. It also allows for ranking and what not… What are you using?

We use a modified version of bbPress by Automattic/Matt Mullenweg (the creator of WordPress®):

See: http://wordpress.org/plugins/bbpress/

This is what powers this field.

You see the link you have in your sidebar widget that says “My public Profile”? How do I do that?

To add another link to the top of the links section of the login widget, you’d use this field when you set up the widget:

How do I allow my members to be able to use html on their profile fields? How do I add a “View Profile” link to my login widget? Is is possible to have a “member profile” that looks halfway decent?

You can have your Users input anything you want into the fields there. The issue that arises (as far as I’m aware of) is the way that these fields are presented. If you have a User input HTML code into their profile, you have to display this field so that the code that’s input is displayed correctly. Here at s2Member we use default bbPress Profile data to display that portion of our User’s profile, as I mentioned above.

Here is a thread that this question was also asked in:

http://www.s2member.com/forums/topic/allow-html-in-profile-fields/

As you can see, the User had to change the way that the Profile Fields were being displayed on his Profile Page to achieve what he was looking for. This will have to be the case for you as well. I don’t have any code to give you to help out with this, sorry. I can tell you that s2Member saves its Custom Registration/Profile Fields in the WordPress User Meta table, and you can retrieve the array of values like this:

<?php $fields = get_user_option('s2member_custom_fields', $user_id); ?>

Or, you can retrieve a specific field using the s2Member s2Get Shortcode, documented here:

Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals


Just to clarify, s2Member provides some basic portions for creation of a “Profile Page”, but leaves this available for site owners to set up apart from s2Member. You can change all of the URLs that are displayed in the Login Widget, and if you want to set up a different Profile Page that’s fine. You can even take a look at s2Member’s shortcodes in this section of your Dashboard to make that easier:

Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals

I am not asking for anything new. Just give me the code please. Or refund me.

I’m afraid we can’t just provide code to achieve this. It’s a full setup that will be unique to your installation. If you’re having problems working with s2Member’s advanced portions, then I’d suggest contacting a Freelancer from a site like http://elance.com/, or http://odesk.com/ to help you set some of these features up.

Thank you!

Posted: Tuesday Jul 2nd, 2013 at 7:11 pm #52918

Thank you for your explanations, and I apologize for my frustrated tone. I have spent a lot of time trying to figure things out, to no avail.

Upon reading your explanations, the problem I am seeing right away is that I still do not understand how to create the link to view your profile, like the one you have in your widget. What exactly do you have in that spot in your widget? It is not that I cannot figure out how to do a link in php. The information is out there. Nowhere in the world, however, can I find an answer on how to create the link at all.

For example… The link for me to view my profile is http://mysite.com/members/steve/. That’s great. I can create a link to that, maybe even in php and have it actually read “View Your Profile”. The problem is that that link will always point to MY profile. How do I make that link so that it takes the logged in member to their own profile?

That is what I cannot find an answer to. Please help.

update – Unfortunately, I already read the post you mentioned, and it didn’t help. I really do not know coding. I really need something like “copy this, and paste it here. Change this to your domain…” etc. You guys have a field in your edit profile form that says html tags are allowed. I also have buddypress and bbpress installed.

Posted: Tuesday Jul 2nd, 2013 at 11:01 pm #52929

Public profiles like you mention, I think are added by BuddyPress and you can ask them about it. http://buddypress.org

If you mean the profile page we have here (http://www.s2member.com/profile/) that’s a regular WP page where we put the profile edit form shortcode. See:
[hilite path]Dashboard -› s2Member® -› General Options -› Member Profile Modifications[/hilite]
[hilite path]Dashboard -› s2Member® -› API / Scripting -› Member Profile Modifications[/hilite]

Posted: Tuesday Jul 2nd, 2013 at 11:23 pm #52931

Thank you for your reply, but that not not address my question. I am talking about these:

You know what? Forget about the html in the form field, can you at least tell me how to get the link in the login widget (that points to the logged in users profile)? I do not understand why this is so difficult a question to get answered. It is the simplest of things.

I was VERY thorough, and very precise on exactly what I need here.

Posted: Wednesday Jul 3rd, 2013 at 12:47 am #52934

I am talking about these:

I don’t have access to this site’s configuration, but if I’m not mistaken, that’s a custom profile field created here: [hilite path]Dashboard -› s2Member® -› General Options -› Registration/Profile Fields[/hilite]

tell me how to get the link in the login widget (that points to the logged in users profile)?

In your widget’s settings, please see the section that starts with Profile Title (when logged-in). [hilite path]WP Admin -> Appearance -> Widgets -> s2Member Pro Login -> Profile[/hilite]

Posted: Wednesday Jul 3rd, 2013 at 1:43 am #52935

I understand that it is a custom profile field. The options for creating a custom profile field in the drop down do not allow for a multi line field that allows html tags – only text (as I mentioned in my first post in this thread), although text box on your site (which serves as a representation of what should be able to be done with your plugin) does allow for html tags.

I also understand what that part looks like. Do you see anywhere in there where it allows for a link to view your profile?

I cannot believe that, after 4 days, nobody can tell me how to create a link for logged in members to view their own profile… LIKE YOU HAVE! Seriously, do you not see how simple a question I am asking? I am sorry, I know I sound rude and mean and everything else, but to be honest, if you had spent as much time and energy as I have trying to get the simplest of things solved, you would be too.

Look… I used your site as a representation of what your script can do. Obviously it can do the things I want, because your site does it, but you are not willing to tell me how. I have the same plugins you do. I am not stupid. I am just not a coder. I do not have time to learn php. I expect to purchase a product and have it function as advertised. Had I known that I needed to spend this much time on the simplest of tasks, I would have gone elsewhere.

I mean, you have short code to allow a member to edit his profile, but not one to view it??? great, so I edit my profile, how do I see it? So simple.

Just refund me please. I have lost too many hours on this. If noone can even answer the simplest of questions, just refund me.

Posted: Wednesday Jul 3rd, 2013 at 5:13 am #52938

I’m very sorry about that. I didn’t have much time earlier, so I was going quickly through the threads and I replied to yours having only read the last replies, instead of the whole thread, so you wouldn’t have to wait much longer. I’m back with more time now, so I went over your posts and am answering your two questions below:

You see the link you have in your sidebar widget that says “My public Profile”? How do I do that?

For example… The link for me to view my profile is http://mysite.com/members/steve/. That’s great. I can create a link to that, maybe even in php and have it actually read “View Your Profile”. The problem is that that link will always point to MY profile. How do I make that link so that it takes the logged in member to their own profile?

Of course the username will have to vary depending on the logged in user, so you have to get the current username to change that URL dynamically.

You can do it with a function that gets it, like our get_user_field or WP’s wp_get_current_user, or use one of the constants we provide. Please see the documentation here: [hilite path]Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants[/hilite]

In the box Bruce highlighted in his image:

Try entering something like this (please change “mysite.com” to your actual domain name):

<a href="http://mysite.com/members/<?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>/">View Your Profile</a>

Can we, or can we not allow members to use HTML tags when filling out the multi-line text box in the edit profile page? I have been searching for hours on this. Everything I read said that that is not possible, but your site allows it!

I did a test just now. I set the “Form Field Type” to [hilite mono]Textarea (multi-line)[/hilite] and the “Expected Format” to [hilite mono]Anything Goes[/hilite], saved the field, saved all changes. Logged in as a regular user and entered HTML there, which I then, logged back in as the admin, echoed in a test page to verify that the HTML wasn’t broken, and it was fine.

I don’t understand why you couldn’t use HTML. Could you show me a screenshot of the settings for that field so I copy them and try to reproduce it? How did you test that HTML wasn’t working? Could you show me what you used to display it so I try it too?

Since you’re using BuddyPress, and you most likely want that field to show in the public profile, did you enable the integration of the s2Member profile fields with BuddyPress? [hilite path]Dashboard -› s2Member® -› General Options -› Registration/Profile Fields -> BuddyPress[/hilite], where it says “Integrate Custom Registration/Profile Fields with BuddyPress.”


I hope that helps. :)

Posted: Wednesday Jul 3rd, 2013 at 4:02 pm #52965

Thank you for your response. I apologize for my earlier tone. As I said, I was very frustrated. The code you posted worked like a charm for the dynamic link, and was exactly what I was looking for. Thank you.

As for the text box… I set all the settings as you described. I can’t get them all into one screenshot, but I set up an extra field in s2member. I set it to a multi-line text area, anything goes, available to everyone, etc… All of the checkboxes for buddypress integration are checked.

I logged in as a regular user, edited the profile through the s2member pop-up and entered:

<b>Test</b>
<i> test italic</i>
<a href="http://free-zilla.com">website in href</a>
http://free-zilla.com <- is this clickable?

Upon viewing the profile, I can still see all of the html tags. I logged out, logged in as admin and checked, and I can see the tags as well. Viewing the profile looks exactly like the code I posted above. I went to my profile as admin, and tried the edit profile from the buddypress edit profile area, with the same results.

You can see the results here:
http://free-zilla.com/members/steve/profile/

and here:
http://free-zilla.com/members/sjschafer/profile/

The strange things is that, if I create the profile field with buddypress, it does not render the html tags either, but regularly formatted links are clickable. If I create the field with s2member, the links aren’t clickable. In fact, I will set up another field with BP, so you can see the difference….

I need to set up the custom fields with s2member, because I need different member levels to have access to different fields.

Thanks again..

*** Okay, I created 2 bio fields… one with s2m and one with buddybress. You can see them both here, with the same text:

http://free-zilla.com/members/steve/profile/

Posted: Wednesday Jul 3rd, 2013 at 10:21 pm #52976

Thank you for your response. I apologize for my earlier tone. As I said, I was very frustrated. The code you posted worked like a charm for the dynamic link, and was exactly what I was looking for. Thank you.

Great. :)

Upon viewing the profile, I can still see all of the html tags. I logged out, logged in as admin and checked, and I can see the tags as well. Viewing the profile looks exactly like the code I posted above. I went to my profile as admin, and tried the edit profile from the buddypress edit profile area, with the same results.

I’m guessing this is BuddyPress encoding the HTML code, so it doesn’t work as code anymore, but is displayed as text. The URLs are auto-linked when parsed, that’s why they’re clickable.

s2Member itself is not breaking the HTML, you can verify it displaying the field’s value with an s2Get shortcode in a WP post/page. If you edit the profile field, you’ll notice under the “Unique Field ID” box, that it shows an s2Get shortcode example. So if you called your field bio_test, the shortcode would be: [hilite mono][[s2Get user_field="bio_test" /]][/hilite].

From the pages you linked to, viewing the source code, it looks like you named your custom profile fields with spaces in them. I don’t recommend that, either put the words together or use an underscore.

In this site, s2member.com, we don’t use BuddyPress, just bbPress, and I don’t know if bbPress will allow HTML in the profile fields by default or if Jason had to customize it for that to work. You may need to customize your installation too.

Posted: Wednesday Jul 3rd, 2013 at 11:08 pm #52977

I don’t think it is a buddypress issue, to be honest because there are two different things going on. Yes, buddypress does strip the code now (this is recent, or so I have read), but with buddypress a normal link is clickable. With your form field, it is not. It has to be something to do with your code.

Hell, I will get rid of buddypress if that is what it takes.

Posted: Thursday Jul 4th, 2013 at 12:26 am #52978

but with buddypress a normal link is clickable. With your form field, it is not. It has to be something to do with your code.

It’s the URL that’s clickable in the BP field, and that’s because they seem to parse URLs and autolink them, but it’s not doing it for s2 profile fields. The problem is the way BP is parsing this, not the value stored in the s2 field.

I don’t think removing BP would be the solution, because that’s what’s allowing you to have public profiles. Instead I’d work on customizing BP a bit so it doesn’t break the HTML, encoding parts of it (like [hilite mono]<[/hilite] or [hilite mono]>[/hilite]) to their HTML entities so they are displayed.

Have you asked in their forums how to prevent this encoding? http://buddypress.org/support/

I’ll ask Jason his opinion too.

Posted: Thursday Jul 4th, 2013 at 12:33 am #52979

Yea, I have looked everywhere… Trust me… up to, and including the bp forums and beyond. I would LOVE to know how you guys did it. lol

Posted: Thursday Jul 4th, 2013 at 12:36 am #52980

Like I said, we’re not using BuddyPress, just bbPress. But I’ll ask Jason his opinion. :)

Posted: Thursday Jul 4th, 2013 at 12:37 am #52981

Thanks. I appreciate it.

Posted: Friday Jul 5th, 2013 at 8:37 pm #53063

I just got a reply from Jason. He confirmed that it’s s2Member escaping the HTML when displaying the field in a public profile. I was displaying the field with a shortcode or PHP, and in those cases, since you’re manipulating the data, it’s not escaped and you’re responsible for the risk of having HTML there. I had not noticed it in my installation because I don’t have BuddyPress, so I could only test as I explained above, but when displayed in the BuddyPress public profiles, s2Member escapes the HTML to prevent potential trouble. This is what Jason replied:

This would be a major security issue. By default, s2Member escapes any HTML code before output in any profile view.

See: /s2member/includes/custom-reg-fields.inc.php

If the site owner would like to modify these lines, I recommend they allow only basic HTML (e.g. specific tags) that would be considered safe (or safer than others at least). Perhaps just a link tag.

if($_editable_context === "profile-view")
    $gen = strip_tags((string)$_value, "<a>");

See: http://php.net/strip_tags

Posted: Friday Jul 5th, 2013 at 11:43 pm #53071

Thank you Cristian. This is exactly the info I needed on this issue. I am not sure why it would be a security issue, seeing as authors can publish posts, using a wysiwyg (and therefore, full html), but I will research that aspect of it and see if I can find a happy medium.

Thanks again for your help.

Viewing 18 replies - 1 through 18 (of 18 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.