Home › Forums › Brett Adcock
Brett Adcock
My Latest Replies (From Various Topics)
Author | Replies |
---|---|
Author | Replies |
Posted: Sunday Mar 18th, 2012 at 9:24 am #8485 | |
|
|
Huh. I’m going to try your version, but let me clarify one thing. Your code blocks students, right? I think I need to reverse it to allow students by setting $excluded to FALSE. Thanks for your help.
|
|
Posted: Wednesday Mar 14th, 2012 at 8:16 pm #8187 | |
|
|
I just realized that my question was a little bit strange. I was thinking in terms of do_action (which would need to get called in the right order) but this hack is using a filter, so it doesn’t need to be wrapped in another hook… Good news: For anyone else who stumbles upon this thread, my code looks something like this:
|
|
Posted: Wednesday Mar 14th, 2012 at 2:55 pm #8146 | |
|
|
I’m going to give this a try. Do you have any idea where this happens in the execution order? More to the poin, I’m wondering if I can add an action to the “template_redirect” hook in which I add this filter. Obviously, “template_redirect” has to happen BEFORE the filter gets applied for this to work. |
|
Posted: Wednesday Mar 14th, 2012 at 2:47 pm #8144 | |
|
|
The cloning idea occurred to me, but it’s not practical because there are many different specific post/pages. I’m sure I could get it working initially, but then the client would be left with a bunch of duplicate posts that would inevitably get confused. |
|
Posted: Tuesday Mar 13th, 2012 at 3:50 pm #8040 | |
|
|
I think this can work, but there’s just one thing I’m not sure how to do. It’s #3 below. Here’s the steps: In the video, Jason’s function redirects users if they CAN’T view the post/page but I can’t do this because the posts in question are already protected by specific post/page restrictions (with no level requirement). If I protect them all by adding them to level 1 (like Jason does in the video), then the people I’ve already sold specific posts/page access to won’t be able to view their purchases anymore. Right? (Because they are still level 0) So somehow my function that’s called at the “template_redirect” hook needs to PERMIT access to the intended post/page… somehow overriding the redirect. Please tell me if I’m making sense, and if you have any advice on how to achieve what I’m looking for.
|
|
Posted: Monday Mar 12th, 2012 at 8:24 pm #7935 | |
|
|
I reread your suggestion and I think it might work for what I’m doing if I can combine it with a free membership form. For example, if I could add the id=”##, ###, ###” attribute to the free form this would work. Or maybe there’s another way to achieve this same behavior. Thanks for any suggestions you might have. |
|
Posted: Monday Mar 12th, 2012 at 2:56 pm #7912 | |
|
|
That would work, but the plan is to grant this action automatically to certain approved email addresses. I may not be up to date with all of s2Member’s new features, but I thought the best way to do this was to use the registration notifications api to grant access to new registrants with certain email addresses. The notification would run a custom script to sniff the email address and then (if it passes) upgrade that user to the all-access level automatically. My concern with writing a script to grant specific post/page access is that it would have to be updated (by me) every time the site owner adds a new restricted post/page. |