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™

Single Page Restrictions

s2Member Plugin. A Membership plugin for WordPress®.

Single Page Restrictions

Postby fcp2011 » November 17th, 2011, 11:25 am

I am considered using the singular page/post feature but need a little help with it. I am using gravity forms to complete a very detailed form. After submission of that form, I want to be able to refer the member to a page that is protected via this singular protection feature. No payment is needed.

So, is there a way to dynamically create the link after the form submission and then refer the webbrowser to that page. I have access to perform php code upon submission of the form, I am just not sure what php code I need to run.

I see that the source code for s2member has a function that would allow the creation of a link, I am just not exactly sure how to use it.

Any help? Thanks in advance.

Daniel
User avatar
fcp2011
Experienced User
Experienced User
 
Posts: 72
Joined: March 30, 2011

Re: Single Page Restrictions

Postby fcp2011 » November 17th, 2011, 9:04 pm

I was thinking something like:

form submission is complete
run sp_access_link_gen() function
then redirect to page with the php code header( 'Location: http://www.yoursite.com/new_page.html' ) ;

Anyone have any extra help to throw my way on this?
User avatar
fcp2011
Experienced User
Experienced User
 
Posts: 72
Joined: March 30, 2011

Re: Single Page Restrictions

Postby Cristián Lávaque » November 21st, 2011, 2:13 am

viewtopic.php?f=40&t=13074&src_doc_v=111105

Yeah, your idea seems good. With sp_access_link_gen create the URL that you'll redirect the person to. viewtopic.php?f=40&t=13074&src_doc_v=111105

Code: Select all
header('Location: ' sp_access_link_gen ($page_ids$hoursfalse)); 

* Haven't tested it.

I hope it helps. :)
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: Single Page Restrictions

Postby fcp2011 » November 21st, 2011, 8:19 am

How should I use the code you have provided? Can you explain a little more about it? I am adding a hook to gravity forms for a particular form. So, when the form is submitted it will run this code. Do I need to add anything to this code, like the url, or leave 'Location: ' the way it is?
User avatar
fcp2011
Experienced User
Experienced User
 
Posts: 72
Joined: March 30, 2011

Re: Single Page Restrictions

Postby fcp2011 » November 22nd, 2011, 3:19 pm

Is this all the code I will need to run upon submission of the form?
User avatar
fcp2011
Experienced User
Experienced User
 
Posts: 72
Joined: March 30, 2011

Re: Single Page Restrictions

Postby fcp2011 » November 22nd, 2011, 3:32 pm

I added exactly what you put in there but it doesn't work. Any other idea?
User avatar
fcp2011
Experienced User
Experienced User
 
Posts: 72
Joined: March 30, 2011

Re: Single Page Restrictions

Postby Cristián Lávaque » November 27th, 2011, 6:45 pm

You need to define $page_ids and $hours.

* @param str|int $sp_ids Comma-delimited list of Specific Post/Page IDs *( numerical )*.
* @param int|str $hours Optional. A numeric expiration time for this link, in hours. Defaults to `72`.
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: Yahoo [Bot] and 2 guests

cron