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.

About: Richard Wells

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
URI Restriction for BuddyPress profile

By:  Richard Wells in: Community Forum

voices: 3
replies: 8

4 years, 7 months ago  Richard Wells

Styling BuddyPress integrated profiles

By:  Richard Wells in: Community Forum

voices: 2
replies: 7

4 years, 7 months ago  Cristián Lávaque

Viewing 2 topics - 1 through 2 (of 2 total)

Topics I've Started

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
URI Restriction for BuddyPress profile

By:  Richard Wells in: Community Forum

voices: 3
replies: 8

4 years, 7 months ago  Richard Wells

Styling BuddyPress integrated profiles

By:  Richard Wells in: Community Forum

voices: 2
replies: 7

4 years, 7 months ago  Cristián Lávaque

Viewing 2 topics - 1 through 2 (of 2 total)

My Latest Replies (From Various Topics)

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Tuesday Jun 12th, 2012 at 12:00 pm #16262

Bob

Confusingly the second bit of code should go before the first in order to set the value for $displayed_username (eg line 101 in my version of ruris.inc.php).

I have then put /members/%%displayed_username%%/ in the box for “URIs That Require Level #0 Or Higher:” in s2Member>Restriction Options>URI Restrictions.

This means when someone clicks a Member in the Member list they are redirected to the upgrade page.

Posted: Monday May 28th, 2012 at 8:26 am #14809

Yes, it does seem to work. Anyone can view /members/ but only chosen levels can view /members/username of displayed profile/.

I have put the edited contents of ruris.inc.php into /wp-content/mu-plugins/s2-hacks.php so it will not be overwritten when s2Member is updated.

Posted: Wednesday May 23rd, 2012 at 11:07 am #14333

I think I have found a way to do this! But it involves a hack:

I have created my own custom Replacement Code %%displayed_username%% and added it in wp-content/plugins/s2member/includes/classes/ruris.inc.php:

$uris = (strlen ($displayed_username)) ? preg_replace ("/%%displayed_username%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($displayed_username), $uris) : $uris;

I extracted the value for $displayed_username from the URL of the page using $_SERVER[“REQUEST_URI”].

$displayed_username = str_replace("/members/", "", $_SERVER["REQUEST_URI);
$slash = strpos($displayed_username, "/");
$displayed_username = substr_replace($displayed_username, "", $slash);

There must be a neater way to do this, eg using preg_match() but I spent ages trying with no luck!

  • This reply was modified 4 years, 7 months ago by  Richard Wells.
Posted: Tuesday May 22nd, 2012 at 7:45 am #14174

My bad again!

I had my mu-plugins directory inside wp-content/plugins/ rather than inside wp-content/. Changes to mu-plugins/custom-reg-fields-4bp.inc.php work fine now of course.

I really want to ask another question in another topic but I have already wasted too much of your time and patience…

Posted: Sunday May 20th, 2012 at 7:08 am #14014

Thank you for the suggestion but sadly edits to a

/wp-content/mu-plugins/custom-reg-fields-4bp.inc.php

file don’t seem to have any effect.

Posted: Friday May 18th, 2012 at 1:41 pm #13890

Cristián

Thank you, I think this is my bad, I am afraid to say.

I had adapted the default BuddyPress profile loop to use divs with individual class names based on the field name, rather than table cells without, so that I could change the layout.

When I started using s2Member fields instead I had the problem described above. I have replaced my profile-loop.php with the default one and I am now getting a stylable table based layout both in source view and Firebug.

I suppose if I now want to convert the s2Member table layout to divs I need to edit custom-reg-fields-4bp.inc.php?

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

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.