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.

Category Restriction and Buttons

Home Forums Community Forum Category Restriction and Buttons

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

Topic Author Topic
Posted: Sunday Mar 10th, 2013 at 11:29 pm #44237
Angela Zou
Username: angelaz

Hi,

I need to create category restriction automatically. I have the correct action hook, so please let me know how to insert category restriction automatically. Also, instead of binding it to a specific level, I want to sell it once like specific page/post, but unfortunately, I have not found that configuration in button generation page.

Angela

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Mar 12th, 2013 at 12:09 pm #44392

Hi Angela,

I need to create category restriction automatically. I have the correct action hook, so please let me know how to insert category restriction automatically.

I haven’t tried this yet, have you searched the s2Member files/codex?

I think you’d edit the global that has the category IDs protected at the level you’re requiring: [hilite code]$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"][/hilite] (where [hilite mono]$n[/hilite] is the level number).

Not sure what stores that in the database, though. You could browse your db to find the categories you protected, to see where they are and then figure out how to edit it with your hack. Unless you want to do it dynamically, then you can do it from a must-use plugin, I guess.

Also, instead of binding it to a specific level, I want to sell it once like specific page/post, but unfortunately, I have not found that configuration in button generation page.

You’d need your customization to get all the post/page IDs from that category and protect it with the Specific Post/Page Restriction. This may help with the access link generation: http://www.s2member.com/codex/stable/s2member/sp_access/c_ws_plugin__s2member_sp_access/#src_doc_sp_access_link_gen%28%29

[hilite pre_code]

[/hilite]
I hope that helps.

Posted: Wednesday Mar 13th, 2013 at 9:17 am #44484
Angela Zou
Username: angelaz

Hey Cristian,

I thought there should be a much better solution for this, I mean posts in the category changes, and I can’t expect a user who has already paid for the category content to pay for it again. As for the solution on how to automatically create category restriction, can you be a little more specific please?

Cheers,
Angela

Posted: Thursday Mar 14th, 2013 at 12:22 pm #44628

I mean posts in the category changes, and I can’t expect a user who has already paid for the category content to pay for it again.

Correct. Then you shouldn’t use the Specific Post/Page Access restriction, because the link cannot be updated. That restriction uses post IDs, not category IDs. I explained it because you mentioned “specific page/post” and I thought you meant the restriction.

As for the solution on how to automatically create category restriction, can you be a little more specific please?

I’m sorry, I haven’t done it yet so I’m not familiar with the code required. And I’m quite busy at the moment, so I don’t have the time to dedicate figuring it out myself. :/

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