Page 1 of 1

Buy Feature access to specific page / post

PostPosted: October 23rd, 2011, 10:00 pm
by merchant
"Specific Post/Page Access, is sort of like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress®. A Specific Post/Page that is protected by s2Member, might contain a download link for your eBook, access to file & music downloads, access to additional support services, and the list goes on and on."

So when I am trying to sell some ebook / file to the general public without having them to become a member (free or premium) I understand I could achieve this via the Specific Post/Page Access restriction method. But on that page when I put the link to the various digital products where are these products to be stored on the server? Which Directory? I understand the link to the page will expire by default in 72 hours, but they could use the link to the products itself beyond that time frame unless I put it somewhere where it is properly protected correct? so where should these be stored? As these buyers will not even have level 0 access.

Re: Buy Feature access to specific page / post

PostPosted: October 24th, 2011, 7:24 am
by Eduan

Re: Buy Feature access to specific page / post

PostPosted: October 25th, 2011, 1:00 am
by Cristián Lávaque
If you use a download key, which expires, the download link won't work for very long. WP Admin -> s2Member -> Download Options -> Advanced

Each Key it produces ( at the time it is produced ), will be valid for the current day, and only for a specific IP address and User-Agent string; as detected by s2Member. This makes it possible for you to create links on your site, which provide access to protected file downloads; and without having to worry about one visitor sharing their link with another.


I hope this helps. :)

Re: Buy Feature access to specific page / post

PostPosted: October 25th, 2011, 8:19 am
by merchant
The videos do not cover this. Let me restate the specifics:
The restrictions are for the specific page/post. But once you arrive at the page/post that's where my download links are to the various digital products being made available via their purchase. If they click the links to download it opens a new window (inline viewing first) and then they can save the pdf or video on their computer. At this time the link to the digital product is revealed in the browser. How is this link to the actual products being protected? Where do we store these digital products as they do not belong to any particular level of membership and if I store it in the s2Member files directory members can access it without having purchased it if they have the link.
I do not like to use the key as it is only for a limited time (one day).
So I hope you can answer the questions:
1. where do store the products (which directory) and
2. how are the actual links to the product (not just the page / post ) on which these are listed in wordpress protected?
Unfortunately the video does not cover this as it goes till the paypal page and then he does not carry the sale thru to the actual page and continue to the downloading of the files.

Re: Buy Feature access to specific page / post

PostPosted: October 25th, 2011, 11:10 am
by merchant
Currently I have got the php style link working, but would still like to know how to do this without use of php.
Also I take it the time restriction is renewed each time the buyer will click on the link so if I have granted the buyer access to the specific page / post for say 5 days he should still be able to access the file for 5 days correct?

Re: Buy Feature access to specific page / post

PostPosted: October 26th, 2011, 12:20 am
by Cristián Lávaque
The key gets generated each time the page is loaded, so although a key lasts for a day, the user will still be able to get the file on day 5 if he loads the page again.

The files are protected in such a way that they are only downloadable via s2Member. If you had the direct link to the file in the server, you'd not be able to download it.

If you use the download key, levels don't apply to that download.

I hope this helps. :)

Re: Buy Feature access to specific page / post

PostPosted: October 26th, 2011, 5:42 am
by merchant
Hi Cristian and Eduan,
Thanks as always for your prompt responses. Yes it does help and I did finally download the php execution plugin to make this one work.
One more question:
I am not a php programmer and so I was hesitant to do this, but now that i have this working I was intrigued by how the videos show the redirect to the membership options page when someone tries to access content they do not have rights to with a message stating they need to upgrade their membership. This it was explained is done via php code using the plugin.
Can you please post the code so I can use it or do you have any instructions or video that shows how to do this and what code was put there? I can modify code that was already written but cannot write it.
This would be awesome to have if you folks can publish that.
Thanks in advance....

Re: Buy Feature access to specific page / post

PostPosted: October 26th, 2011, 11:09 pm
by Cristián Lávaque
Glad to help. :)

The Membership Options page will be shown without you needing any PHP code in it. WP Admin -> s2Member -> General Options -> Membership Options

You can, of course, use PHP to customize the message. What kind of customization do you want, though?

Re: Buy Feature access to specific page / post

PostPosted: October 27th, 2011, 9:11 am
by merchant
Hi Cristian,
Just a message like the one shown in the video...."The material you are trying to access requires you to have Premium Membership. Please upgrade your membership to access the material.".
I just do not know how to write the code in php to do that and where the code has to be placed (whether on the Membership options page or somewhere else).
If you can provide the code and instructions where to put it that would be awesome.

Re: Buy Feature access to specific page / post

PostPosted: October 28th, 2011, 10:55 pm
by Cristián Lávaque
No code needed for that. You just put that in the body of the Membership Options page using the normal WordPress editing interface for page/posts. :)

Re: Buy Feature access to specific page / post

PostPosted: October 29th, 2011, 1:02 pm
by merchant
If I put that in the body of the Membership Options page which is also accessible via the menu then it will be displayed everytime even if the person has directly landed on it instead of it displaying only when the person is trying to access unauthorized content.
The video states one needs the php execution plugin and some code for the message to display when someone is trying to access unauthorized content.
Could you provide that please?

Re: Buy Feature access to specific page / post

PostPosted: October 30th, 2011, 12:01 am
by Cristián Lávaque
Ah, got it. Something like this, then:

Code: Select all
<?php if (isset($_GET['s2member_level_req'])) { ?>
The material you are trying to access requires you to have Premium Membership. Please upgrade your membership to access the material.
<?php ?>


Re: Buy Feature access to specific page / post

PostPosted: October 30th, 2011, 9:27 pm
by merchant
Thanks much Cristian, it works like a charm. You folks are awesome !!

Re: Buy Feature access to specific page / post

PostPosted: October 31st, 2011, 11:26 pm
by Cristián Lávaque
Thanks for the kudos! Glad I could help. :)