Page 1 of 1

503 error using the s2member key url

PostPosted: May 22nd, 2011, 2:12 pm
by coloradoflyfisherman
I have a file in the s2member file folder and am using this link.

Code: Select all
<a href='http://www.successfulflyfishing.com/?s2member_file_download=successfulflyfishing-expire.zip&s2member_file_download_key=<?php echo s2member_file_download_key("successfulflyfishing-expire.zip"); ?>'>DOWNLOAD DEMO eBOOK</a>


This is the 503 error I get when clicking the link.
503 ( Invalid Key ): Sorry, your access to this file has expired. Please contact Support for assistance.

I have the download limit set to 10 in 365 days so that should not be it.

Any help appreciated.

Re: 503 error using the s2member key url

PostPosted: May 23rd, 2011, 4:41 am
by Jason Caldwell
Thanks for reporting this important issue.

Did you use this code inside a Post/Page?
If so, make sure you've got a PHP Execution plugin installed first:
http://wordpress.org/extend/plugins/php ... on-plugin/

Re: 503 error using the s2member key url

PostPosted: May 23rd, 2011, 9:26 am
by coloradoflyfisherman
Jason,

1st thanks for wp-show-id plugin. This plugin works great.
2nd I installed the php plugin you recommended and activated it. Then tried the s2member key link in a post and in a page with the same 503 error returned.

Since I had a WP blog get hacked badly in Jan, I am much more careful about php being executed. I am running some code in my .htaccess file that may be causing the problem.

If you wish to see the code I will send directly to you. Is there a way to send you a private email on the forum?

Re: 503 error using the s2member key url

PostPosted: May 23rd, 2011, 1:18 pm
by Cristián Lávaque
You can email him private info using this form http://s2member.com/contact

Re: 503 error using the s2member key url

PostPosted: May 23rd, 2011, 5:38 pm
by Jason Caldwell
Sure, please send that over using the form Cristián provided.

This code snippet:
Code: Select all
 <a href='http://www.successfulflyfishing.com/?s2member_file_download=successfulflyfishing-expire.zip&s2member_file_download_key=<?php echo s2member_file_download_key("successfulflyfishing-expire.zip"); ?>'>DOWNLOAD DEMO eBOOK</a>

... should ultimately produce a clickable link that looks something like this:
Code: Select all
http://www.successfulflyfishing.com/?s2member_file_download=successfulflyfishing-expire.zip&s2member_file_download_key=98234kljsdf9234sssf9wruw
* If your "Key" on the end, doesn't look something like this, I suspect there is a problem with the PHP tag not being evaluated. You might also try placing the code snippet directly into a PHP template file for your theme. This code will not work inside a Post/Page unless you have a PHP execution plugin installed/configured properly.

Re: 503 error using the s2member key url

PostPosted: May 24th, 2011, 5:38 am
by coloradoflyfisherman
this is what I get from inputting the link using the html side of the visual editor. I have changed the name of the download file is all. I think in the S2 download advanced instructions, it said that the ending php tag had to be of the format shown here ?&gt; for the link to work. Maybe the issue is in the conversion of the rest of the UTC8 character coding.

Code: Select all
<a href="http://www.successfulflyfishing.com/?s2member_file_download=successfulflyfishing-demoebook.zip&amp;s2member_file_download_key=&lt;?php echo s2member_file_download_key('successfulflyfishing-demoebook.zip'); ?&gt;">DOWNLOAD DEMO eBOOK</a> 

Re: 503 error using the s2member key url

PostPosted: May 24th, 2011, 11:37 am
by Cristián Lávaque
No, you should enter the PHP in the HTML tab of the editor, not Visual, and you'll need Exec PHP for it to work, too.

Jason, wouldn't it be good to have a shortcode for the key? E.g.
Code: Select all
[s2Get download_key="example.zip" /]


Or even a full URL version like
Code: Select all
<a href="[s2Get download_key_url="example.zip" /]">download</a>

Re: 503 error using the s2member key url

PostPosted: May 24th, 2011, 7:46 pm
by Jason Caldwell
Yes, that's a great idea. I think that came up in the past but never made it on our TODO list.

I'm putting it back on the list now. Thank you!
@TODO: Shortcode for Download Links with Keys.

Re: 503 error using the s2member key url

PostPosted: May 24th, 2011, 8:32 pm
by Cristián Lávaque
Cool!