latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Syntax of custom options on PHP Login Box.

Home Forums Community Forum Syntax of custom options on PHP Login Box.

Tagged: , , ,

This topic contains 5 replies, has 4 voices. Last updated by  Bruce 3 years, 9 months ago.

Topic Author Topic
Posted: Sunday Mar 10th, 2013 at 11:12 pm #44235
uywi
Username: thomasjterry

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Monday Mar 11th, 2013 at 11:41 pm #44309
Eduan
Username: Eduan
Moderator

Hello there,

I haven’t used the login widget in this way before, but f the method you tried does not work, then it’s probably used this way:

<?php
$options = array(
	"signup_url",
	"login_redirect",
);

$args = array(
	"%%automatic%%",
	"%%previous%%",
);

echo s2member_pro_login_widget($options, $args);
?>

Try and see if that works better. :)

If it doesn’t then I’ll have to ask Jason for clarification on how to do this properly.

– Eduan

Posted: Tuesday Mar 12th, 2013 at 12:00 am #44316
uywi
Username: thomasjterry

That method didn’t work.

It represented small progress in this way: Your syntax is valid, and it didn’t cause errors on the page (as all my previous attempts had done.)

However, it was not successful at redirecting the user back to the post they were already on, which is what the login _redirect / %%previous%% is supposed to do. (Instead it directed them to a member dashboard page we previously created.)

Can you go ahead and ask Jason?

Thanks,
Julie

Posted: Wednesday Mar 13th, 2013 at 2:44 pm #44516

Julie, could you see if this video helps you with that? Video » s2Member (Login Welcome Page Conflicts?)

Posted: Wednesday Mar 13th, 2013 at 3:43 pm #44526
uywi
Username: thomasjterry

Sorry, no that video did not help.

When I use the sidebar login box, there’s a bunch of configuration options, and one of them is where to send the person upon login, and I can select “Previous”. I select this option and everything works perfectly.

However, I’d rather have the login box in the middle of my page instead of in the sidebar, so for that I want to use the PHP widget. It has all the same configuration options, but you have to know a little more about coding to use them, and I don’t have enough knowledge about the proper syntax to use it properly.

This is the core of it.

<?php echo s2member_pro_login_widget(); ?>

This is the parameter I want to add:
“login_redirect” => “%%previous%%”

What’s the proper way to express that in the PHP code? I just don’t know whether to use the quotation marks, or where to put commas, or wether that “=>” belongs anywhere at all.

Thanks,
Julie

Posted: Friday Mar 15th, 2013 at 7:34 pm #44843
Bruce
Username: Bruce
Staff Member

Thanks for your reply. :-)

Your original post’s attempt was the closest here:

<?php echo s2member_pro_login_widget("signup_url" => "%%automatic%%" "login_redirect" => "%%previous%%"); ?>

Try this:

<?php echo s2member_pro_login_widget(array("signup_url" => "%%automatic%%", "login_redirect" => "%%previous%%")); ?>

That should create a Pro Login Widget that will redirect to the previous page that the User was on.

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.