Community Support Forums — WordPress® ( Users Helping Users ) — 2011-06-19T19:44:27-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=10198 2011-06-19T19:44:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21168#p21168 <![CDATA[Re: start restricted file download on log in]]>

Statistics: Posted by Cristián Lávaque — June 19th, 2011, 7:44 pm


]]>
2011-06-19T16:21:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21160#p21160 <![CDATA[Re: start restricted file download on log in]]> Statistics: Posted by sidera — June 19th, 2011, 4:21 pm


]]>
2011-06-19T14:27:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21154#p21154 <![CDATA[Re: start restricted file download on log in]]> Statistics: Posted by Cristián Lávaque — June 19th, 2011, 2:27 pm


]]>
2011-06-19T14:01:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21152#p21152 <![CDATA[Re: start restricted file download on log in]]>
Code:

add_action('genesis_after_post_title','wpc_do_s2member_notify');

function wpc_do_s2member_notify(){

list($seeking, $file) = preg_split("/-/", $_GET["s2member_seeking"], 2);


if(is_page('membership-signup')){
set_transient('wpc_file_name', $file, 1800);
if($seeking === "file"){

?>
<p style="background-color:#ffffe0;padding:10px;border:1px solid #E6DB55;text-align:center;">In order to gain access to this free content, you must become a member. <a href="/wp-login.php?action=register"><u>Click here to register</u></a> and you will be automatically brought back to the free content you were trying to access. If you are an existing member, you can <a href="/wp-login.php"><u>login here</u></a>.</p>
<?php
}
}
if(is_page('login-welcome-page')){
?>
   <p style="background-color:#ffffe0;padding:10px;border:1px solid #E6DB55;text-align:center;"><a href="/?s2member_file_download=<?php echo get_transient('wpc_file_name'); ?>">download your file now</a></p>
<?php
}
//delete_transient('wpc_file_name');
}


let me know if you see any problems that I don't

Statistics: Posted by sidera — June 19th, 2011, 2:01 pm


]]>
2011-06-19T11:43:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21143#p21143 <![CDATA[Re: start restricted file download on log in]]> Statistics: Posted by Cristián Lávaque — June 19th, 2011, 11:43 am


]]>
2011-06-19T06:34:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21134#p21134 <![CDATA[Re: start restricted file download on log in]]> /wp-login.php?action=register&redirect_to=wp-login.php?redirect_to=http://example.com/s2member_file_download-example-file.pdf

now I'm looking at another solution : would it be possible to save the file name in a global variable, then display it in a link on the login welcome page?
I tried setting a global $filename variable in a function, but once the user logs in it's out of scope

Statistics: Posted by sidera — June 19th, 2011, 6:34 am


]]>
2011-06-18T22:43:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21113#p21113 <![CDATA[Re: start restricted file download on log in]]> wp-login.php?redirect_to=/%3Fs2member_file_download%3Dexample-file.zip

Statistics: Posted by Cristián Lávaque — June 18th, 2011, 10:43 pm


]]>
2011-06-18T08:47:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21094#p21094 <![CDATA[Re: start restricted file download on log in]]> register -> login -> direct file download -> home page, instead of register -> login -> page
but it seems I can't use the redirect_to without the login part, so I'm stuck on the login page and each time I click on the login button it downloads the file instead of logging in
is that possible?

Statistics: Posted by sidera — June 18th, 2011, 8:47 am


]]>
2011-06-18T08:06:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21093#p21093 <![CDATA[Re: start restricted file download on log in]]> http://keithjameslock.com/offering-free ... ore-money/

Statistics: Posted by sidera — June 18th, 2011, 8:06 am


]]>
2011-06-18T06:20:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10198&p=21091#p21091 <![CDATA[start restricted file download on log in]]> Statistics: Posted by sidera — June 18th, 2011, 6:20 am


]]>