Page 1 of 1

protected page link in profile if subscribed.

PostPosted: January 4th, 2012, 9:35 am
by squizeers
I was wondering if there is a way to automatically list the links of the protected pages in the profile page if the user has subscribed them.
For example:
    The protected pages are A,B,C and D
    A user subscribes for page A and B.
    When the user logs into the site, the user lands on his profile page (thats how I have set up).
    Now in the same page is there a way to list the links for pages A and B so that the user does not have to go to the options page to click on the links he has subscribed?
    Or is there a better solution for what I am looking to achieve and I am not doing it right?

Any help will be much appreciated.
Thank you.

Re: protected page link in profile if subscribed.

PostPosted: January 4th, 2012, 7:32 pm
by Raam Dev
If you're using Custom Capabilities to determine which page the user has subscribed to, you could use Simple/Shortcode Conditionals to check which Custom Capabilities they have access to and then show the link to the page.

So on the Login Welcome Page, you could do something like this:

[s2If current_user_can(access_s2member_ccap_pageA)]
<a href="/link-to-page-a">Your Page A Link</a>
[/s2If]

[s2If current_user_can(access_s2member_ccap_pageB)]
<a href="/link-to-page-b">Your Page B Link</a>
[/s2If]

[s2If current_user_can(access_s2member_ccap_pageC)]
<a href="/link-to-page-c">Your Page C Link</a>
[/s2If]


Would that work?

Re: protected page link in profile if subscribed.

PostPosted: January 4th, 2012, 8:55 pm
by squizeers
You are my Super Hero.

Re: protected page link in profile if subscribed.

PostPosted: January 4th, 2012, 9:17 pm
by Raam Dev
:) My pleasure!