Excluding content for directories below members

I need to find a way to exclude everything but profile under each member. I have tried using URL groups but it just isn’t working right.

My thought is add – http://domain.com/members/%username%/activity and then do this for groups and friends as well, but everytime I do this it hangs up the site. I can no longer load the home page.

What is the best way to exclude all but profiles under each member.

  • David
    • The Incredible Code Injector

    What is baffling to me is

    http://domain.com/members/.* works just fine, but the moment I add

    http://domain.com/members/Admin/activity/ with or without the .* the site acts like it doesn’t even see it, even though I can readily change that URL group back and forth just fine and it works for the one.

    It is like it doesn’t see that URL. I was trying just to see if I could get it to work without a string for the username and then worry about that later, but the concerning part is it won’t even work like that.

  • David
    • The Incredible Code Injector

    I continue to see all kinds of bugginess with the URL groups. As I go back and forth with testing I at times add the basic members block and the whole site just hangs. I go in, completely remove URL groups, then re-add and it works fine. Even once I had to go in and use a new URL group I created with the same code. I am copying from notepad so it shouldn’t be an issue with that. Anyway, this seems like this would be a pretty common request, but the obvious fixes just are not working at all.

  • David
    • The Incredible Code Injector

    I built a completely new test community and tried the following. I added these URL exclusions.

    http://connectingtherapists.com/members/test1/activity/

    http://connectingtherapists.com/members/test1/friends/

    http://connectingtherapists.com/members/test1/groups/

    http://connectingtherapists.com/members/test1/forums/

    I tried with and without the .* after the URL. But what is really weird is I do just that first one, for activity, and it works fine. I add the other 3 and it breaks. Does that exact same thing – completely hangs when no logged in. Site becomes non responsive. Given this is happening in a pristine dev environment makes me think it is a bug. I can give access to this environment if you want to test.

    And really it is super inconsistent – just real buggy. I went back and added these in individual exclusions (meaning one URL per rule) and worked – so I will have exact same settings one time and it works and another and it doesn’t – same thing I found in production which is partly why I put up this pristine environment.

    Ideally I am looking to use a wildcard for the users, but if I have to I will script out to manually create a huge URL exclusion for every user for every directory other than profile. My problem is I HAVE to get this working or basically the site will be shut down and I will be refunding users. What is the syntax to do the above exclusions with variables for the username – %username%?

    Profiles have to be visible and other tabs not to the public. I can’t imagine this is that strange of a request and that the membership plugin should be able to do this.

    Thanks, David

  • David
    • The Incredible Code Injector

    Ok, here is a big tip for those of you doing URL groups. Don’t hit ENTER after a line. That was the problem. Didn’t even occur to me. I still can’t get a variable to work, so I need to figure out that syntax, but worst case as a work around I can create a script to generate the 4 URL’s per user I need to exclude from free membership.

    Oh, and some other feedback. The documentation for this membership plugin to me is not complete – and there is nothing on URL groups that I could find anywhere. The only stuff I could find was in some posts and that was incomplete data, so I was stuck by tons of trial and error.

    So if you can get back to me on the documentation of how to use wildcards/variables in the URL that would be great – given the settings for each one it seems possible and I might just have the wrong syntax.

    Thanks, David

  • Mason
    • DEV MAN’s Sidekick

    Hiya David,

    I’m gonna ask Barry (the plugin developer) to come by and respond here. I’m assuming you’re running WordPress 3.3? Any other plugins?

    You should be able to use any regex to define your rules:

    http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/

    I haven’t tested this with the latest version of Membership, but that is how it has worked previously. I’ll try to get a test membership install going and see if I can reproduce the issues you’re seeing here.

  • David
    • The Incredible Code Injector

    I am using 3.2.1. Yes, other plugins, but tested with no plugins. The main issue was I was hitting enter after manually typing in exclusions and other times copying in from notepad and not hitting enter. Hitting enter breaks it.

    I will look at that link – but really the end result of all this thread is I now need to know what variable I can put in the URL for the username field. Assuming I can, so I can leave open the profile to non registered users and lock down all the other stuff without having to add to these exclusions every time a new user joins.

    It would be great to hear from Barry – I was thinking about reaching out to him. I was also wondering whether you needed the tailing .* after the directories or by default it excludes all sub directories. I just added as it didn’t break it and seemed to be more likely to cover it all.

    David

  • David
    • The Incredible Code Injector

    No offense, but if you are going to step in for a moment please take the time to read the whole thread. That expression does work but doesn’t accomplish my requirements. My challenge is I have to have the profile viewable – which is the default tab, and the others inaccessible – activity, groups, friends and forums.

    Thanks, David

  • Mason
    • DEV MAN’s Sidekick

    Hiya David,

    I’m looking for a solution here – being able to provide a variable within the URL Groups would be necessary -as you mentioned, or deeper integration with BuddyPress so that those individual member-specific elements can have rules applied.

    Thanks for your continued feedback here – we’re looking into several options at the moment, and DO want to get this tackled and working in a way that provides the most flexibility here.

    Thanks again.

  • DavidM
    • DEV MAN’s Mascot

    Hi David,

    My apologies that I didn’t quite understand that one, I had actually skimmed through but totally assumed you were just looking to restrict access to all urls past /members/.

    And actually, you should be able to restrict portions of the url like so:

    http://connectingtherapists.com/members/.*/activity/.*

    http://connectingtherapists.com/members/.*/friends/.*

    http://connectingtherapists.com/members/.*/groups/.*

    http://connectingtherapists.com/members/.*/forums/.*

    The .* refers to any number of any characters in that portion of the string. I just ran through a couple of tests myself and oddly, was going to mention that earlier too, just wanted to clarify that’s what you’re looking for.

    Hope that helps!

    -David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.