Page 1 of 1

S2 Member URL Parameters Error

PostPosted: August 28th, 2011, 2:39 am
by fantasydebate
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

Re: S2 Member URL Parameters Error

PostPosted: August 28th, 2011, 5:12 am
by Cristián Lávaque
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!

Re: S2 Member URL Parameters Error

PostPosted: August 28th, 2011, 2:03 pm
by fantasydebate
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

Re: S2 Member URL Parameters Error

PostPosted: August 29th, 2011, 3:17 pm
by Cristián Lávaque
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/