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.

URI Restricitons Needing Replacement Code

Home Forums Community Forum URI Restricitons Needing Replacement Code

This topic contains 5 replies, has 3 voices. Last updated by  Cristián Lávaque 3 years, 7 months ago.

Topic Author Topic
Posted: Friday Jun 7th, 2013 at 1:06 pm #51618
cory irish
Username: ninjalust

I am trying to restrict non paying members from viewing the galleries of other members but allow the viewing of the logged in users gallery. In the URI restrictions that require level #1 I have:

gallery/

What I need is something like:

%%username_not_logged_in%%/gallery/

The replacement code would be the username created in registration for the member that is not the logged in member. This allowing access to the gallery for the logged in user if at level #0.

Is there replacement code for this or is there a hack I can put in the s2member hack file?

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Saturday Jun 8th, 2013 at 9:17 am #51677
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

The replacement code would be the username created in registration for the member that is not the logged in member. This allowing access to the gallery for the logged in user if at level #0.

s2Member provides many replacement codes, which you can see with the link here:

However, assuming that this is the only place that contains the URI segment /gallery/, you should be able to just put this segment into your URIs That Require Level #0 Or Higher section, and that would be just fine. s2Member would block access from non-logged-in Users to any User’s gallery. Would that work for you?

Posted: Saturday Jun 8th, 2013 at 10:36 am #51680
cory irish
Username: ninjalust

What Im trying to do is the exact opposite of the replacement codes. All of the replacement codes are based on the current user that is logged in. I want to do the opposite of that and base the replacement code on every member except the current user logged in.

This way if I am logged in I can access: /member/MY-USERNAME/gallery/

However I will be redirected when I try: /member/OTHER-USERNAME/gallery/

So what I need is: %%OTHER-USERNAME%%/gallery/ as the replacement code or hack to accomplish that.

All of the restrict URI fields are based on restrictions and do not take into account any exceptions which would be useful with my current need. However that is not available to my knowledge so the opposite needs to be accomplished.

Posted: Tuesday Jun 11th, 2013 at 4:49 am #51743
Bruce
Username: Bruce
Staff Member

Thanks for your patience.

What Im trying to do is the exact opposite of the replacement codes. All of the replacement codes are based on the current user that is logged in. I want to do the opposite of that and base the replacement code on every member except the current user logged in.

I see. Well unfortunately this isn’t possible. I imagine the only way to accomplish this would be to have a developer set up something with s2Member’s Advanced PHP Conditionals. I’d recommend writing into the BuddyPress forums and asking if there is a way to find out if a User is on another User’s Profile Page in PHP.

See: Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals
See Also: http://buddypress.org/support/

Posted: Tuesday Jun 11th, 2013 at 10:27 am #51768
cory irish
Username: ninjalust

This is the forums. And this is the kind of answer Im looking for. Of course it is possible, Im just trying to find out how.

Posted: Wednesday Jun 12th, 2013 at 5:58 am #51813

He’s talking about the BuddyPress forum, this is the s2Member forum:

Bruce Caldwell said:
I’d recommend writing into the BuddyPress forums and asking if there is a way to find out if a User is on another User’s Profile Page in PHP.

Viewing 5 replies - 1 through 5 (of 5 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.