PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

S2 Member URL Parameters Error

s2Member Plugin. A Membership plugin for WordPress®.

S2 Member URL Parameters Error

Postby fantasydebate » August 28th, 2011, 2:39 am

I am having a problem when I use custom url variables with s2 member. When I put a link on my site:

echo "<a href='http://www.fantasydebate.com/ld-profiles/?n=$name' >$name_v1</a>"

s2 member says takes me to my "buy now" page because it says I don't have the custom capabilities. If i go to the link http://www.fantasydebate.com/ld-profiles. S2 member has no problem. Also for reference, if the link is

echo "<a href='http://www.fantasydebate.com/ld-profiles/?id=$number' >$name_v1</a>"

s2 member has no problem

Can anyone help me?

Thanks!

Jon
User avatar
fantasydebate
Registered User
Registered User
 
Posts: 2
Joined: August 28, 2011

Re: S2 Member URL Parameters Error

Postby Cristián Lávaque » August 28th, 2011, 5:12 am

Hi Jon.

You seem to have a custom script in the page, thus the variables in the querystring, correct? I can't see the /ld-profiles page because it's redirecting me to /upgade-to-fantasy-debate-premium, which I assume is the Membership Options Page, but I don't see MOP vars saying what the level required is, so I'm confused. Could you explain more what you're doing so i can understand it to help you better? Screenshots with be great too.

Thanks!
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: S2 Member URL Parameters Error

Postby fantasydebate » August 28th, 2011, 2:03 pm

Hi Christián,

I fixed the problem by manually putting this on all my pages. It wasn't fun, but it got rid of the error.

Code: Select all
if (current_user_can("access_s2member_ccap_ld")):

PAGE CODE

else:
    
$member_options S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL;

   
header("Location: $member_options"); 
endif;
 


There is definitely some kind of error when I use the custom capabilities on the page edit screen that interacts with url variables. If you want me to help you guys figure it out I would be more than happy to provide you with more information.

Thanks!
Jon
Last edited by Cristián Lávaque on August 29th, 2011, 1:48 pm, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
fantasydebate
Registered User
Registered User
 
Posts: 2
Joined: August 28, 2011

Re: S2 Member URL Parameters Error

Postby Cristián Lávaque » August 29th, 2011, 3:17 pm

I'm glad you solved it. Thanks for the update! :)

This at the beginning of your post would probably do the same and be easier to add:

Code: Select all
<? php if (!current_user_can('access_s2member_ccap_ld'))
   header('Location:' . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL); ?> 


But you can do the same with the ccaps field in the s2Member metabox in the top-right of the edit page.

Or in the 2nd segment of the Custom Capabilities video, Jason explains a hack to apply the ccaps restriction. http://www.s2member.com/custom-capabilities-video/
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 3 guests

cron