(s2Member Pro) Improvement. The s2Member Pro Login Widget now has improved handling of its %%previous%% Replacement Code for login redirections.
Statistics: Posted by Jason Caldwell — November 6th, 2011, 11:29 am
<?php
$options = array(
"title" => "",
"signup_url" => "",
"login_redirect" => "%%previous%%",
"profile_title" => "",
"display_gravatar" => "0",
"link_gravatar" => "0",
"display_name" => "0",
"logged_in_code" => "",
"logout_redirect" => "",
"my_account_url" => "0",
"my_profile_url" => "0"
);
$args = array (
"before_widget" => "<div class=\"member_login_widget\">",
"after_widget" => "</div>",
"before_title" => "<h5>",
"after_title" => "</h5>"
);
echo s2member_pro_login_widget($options, $args);
?>
Statistics: Posted by denvert — November 6th, 2011, 2:25 am
Statistics: Posted by denvert — November 1st, 2011, 9:06 pm
Statistics: Posted by Jason Caldwell — October 31st, 2011, 8:25 pm
Statistics: Posted by denvert — October 30th, 2011, 4:15 pm
Statistics: Posted by denvert — October 21st, 2011, 1:53 pm
Statistics: Posted by Jason Caldwell — October 21st, 2011, 1:37 pm
Statistics: Posted by Jason Caldwell — October 20th, 2011, 7:01 pm
Statistics: Posted by denvert — October 20th, 2011, 5:28 pm
<?php echo $_SERVER["HTTP_REFERER"]; ?>
http://example.com/my-custom-login-page/?previous=<?php echo urlencode($_SERVER["REQUEST_URI"]); ?>
"login_redirect" => $_GET["previous"],
Statistics: Posted by Jason Caldwell — October 20th, 2011, 5:18 pm
"login_redirect" => "$_SERVER["HTTP_REFERER"]",
"login_redirect" => $_SERVER["HTTP_REFERER"],
Statistics: Posted by Jason Caldwell — October 20th, 2011, 5:06 pm
<?php
$options = array(
"title" => "",
"signup_url" => "http://xxx.xxxxxx.org/register/",
"login_redirect" => "$_SERVER["HTTP_REFERER"]",
"profile_title" => "",
"display_gravatar" => "0",
"link_gravatar" => "0",
"display_name" => "0",
"logged_in_code" => "",
"logout_redirect" => "http://xxx.xxxxxx.org",
"my_account_url" => "0",
"my_profile_url" => "0"
);
$args = array (
"before_widget" => "<div class=\"member_login_widget\">",
"after_widget" => "</div>",
"before_title" => "<h5>",
"after_title" => "</h5>"
);
echo s2member_pro_login_widget($options, $args);
?>
Statistics: Posted by denvert — October 20th, 2011, 5:04 pm
"login_redirect" => $_SERVER["HTTP_REFERER"],
Right, but since you're redirecting Visitors to your own custom "Login Page" constructed with the s2Member Pro Login Widget, you need to record the page they came from "before" they were redirected to your custom "Login Page", which is not the same thing as %%previous%%. You can read more about $_SERVER["HTTP_REFERER"] here: http://php.net/manual/en/reserved.variables.server.php
I'm not trying to return them to the page they logged in from but the page that directed them to the page they logged in from. Does that make sense?
Statistics: Posted by Jason Caldwell — October 20th, 2011, 4:55 pm
Statistics: Posted by denvert — October 20th, 2011, 4:49 pm
Jason Caldwell wrote:
There is one exception that s2Member treats differently though, and that is your Membership Options Page. If a Customer attempts to log into your site from your Membership Options Page, the %%previous%% Replacement Code is ignored, and instead the Customer will be returned to your Login Welcome Page by default. This is the intended behavior, in this one special scenario, because returning a logged-in User to a set of Membership Options is not intuitive.
"login_redirect" => $_SERVER["HTTP_REFERER"]
Statistics: Posted by Jason Caldwell — October 20th, 2011, 4:32 pm
* Can you elaborate just a bit further for me please?
user is sent to re-directed to login page that has code generated from the document you give link to, specifically,
$redirect_to = preg_replace ("/%%previous%%/i", $_SERVER["REQUEST_URI"], ($redirect_to = $options["login_redirect"]));
Statistics: Posted by Jason Caldwell — October 20th, 2011, 4:05 pm