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.

Login widget, redirects & shortcodes

Home Forums Community Forum Login widget, redirects & shortcodes

This topic contains 10 replies, has 4 voices. Last updated by  Eduan 4 years, 3 months ago.

Topic Author Topic
Posted: Thursday Sep 6th, 2012 at 7:08 am #24286

Hi,

Thanks for this plugin. I have a few questions before potentially purchasing the Pro version for a client website. Any advice would be gratefully received!

1. I would really like to re-create the drop-down login form as used on this S2 site. I have searched the forums & it seems it’s a custom installation of the Pro login widget. Can the code be shared?

2. I really don’t want the user ever seeing the WP login screen (albeit I realise it can be customised). Therefore, does the Pro login widget allow you show login error messages within the widget, rather than redirecting to the default WP login failed page? If not, any pointers as to how I’d go about achieving this?

3. Is there a shortcode which allows an admin to hide only part of a post – e.g. Intro content here [hide]Rest of content here[/hide]. Was trying to find a list of available shortcodes but couldn’t find it!

4. We need to take manual payment. My plan is to let people register for free, then have an admin upgrade them to, e.g., level 1 when payment has been taken. Is this possible?

Thanks in advance – I know that’s a bit of a list!
Sarah

List Of Topic Replies

Viewing 10 replies - 1 through 10 (of 10 total)
Author Replies
Author Replies
Posted: Thursday Sep 6th, 2012 at 12:07 pm #24336
Eduan
Username: Eduan
Moderator

Hello Sarah,

1. I would really like to re-create the drop-down login form as used on this S2 site. I have searched the forums & it seems it’s a custom installation of the Pro login widget. Can the code be shared?

This is some customized code, and we really can’t share the code, since it wouldn’t work unless you have the pro version of s2Member.

2. I really don’t want the user ever seeing the WP login screen (albeit I realise it can be customised). Therefore, does the Pro login widget allow you show login error messages within the widget, rather than redirecting to the default WP login failed page? If not, any pointers as to how I’d go about achieving this?

This isn’t quite possible, you would have to modify s2Member (specifically the widget) in order to completely replace the wp-login.php page, for this you would also need to modify the WordPress side of it if I’m not mistaken.

3. Is there a shortcode which allows an admin to hide only part of a post – e.g. Intro content here [hide]Rest of content here[/hide]. Was trying to find a list of available shortcodes but couldn’t find it!

There are, check out this article: Knowledge Base » s2Member® Conditionals

4. We need to take manual payment. My plan is to let people register for free, then have an admin upgrade them to, e.g., level 1 when payment has been taken. Is this possible?

This is possible, you would just edit the user’s role under Dashboard -› Users -› All Users -› [Username], just make sure to receive the payment first. ;)


Hope this helps. :)

Posted: Thursday Sep 6th, 2012 at 1:15 pm #24352

Thanks for your answers Eduan.

I’m working on a custom solution to the first two, so that might be resolvable.

Thanks for the link to the conditionals – knew they must be somewhere :)

Posted: Thursday Sep 6th, 2012 at 2:29 pm #24364
Eduan
Username: Eduan
Moderator

Glad I was able to help Sarah. :)

Posted: Thursday Sep 20th, 2012 at 4:55 am #25887

Just following up on the shortcodes; I am now using something like the following to protect content:

[s2If current_user_can(access_s2member_level1)]
Restricted content here…
[/s2If] [s2If !current_user_can(access_s2member_level1)]
Please login to view this content.
[/s2If]

This works beautifully on the single post page, but doesn’t work on the posts index page (i.e. my main blog page). I’ve tried activating the ‘Alternative View Protection’ option (‘Filter ALL WordPress® queries; protecting all Alternative Views.’) which I thought would do the trick but it hasn’t??

Am I doing something wrong or is there another way around this?

Many thanks for your help
Sarah

Posted: Thursday Sep 20th, 2012 at 6:42 am #25901

I think I worked out what was causing the problem… I had a ‘Read more’ tag inside the restricted content i.e.

[s2If current_user_can(access_s2member_level1)]
Restricted content here…
<!--more-->
More content here...
[/s2If] [s2If !current_user_can(access_s2member_level1)]

This seems to cause a problem with this (any?) shortcode. Does anyone know how I can create a shortcode which allows me to hide the content but also let the admin user include a read more tag within the restricted content (for logged in users)? This is what I have at the moment:

function hex_protected( $atts, $content = null ) {
     extract(shortcode_atts(array(
  	), $atts));
  	
    if (current_user_can("access_s2member_level1")){ 
      $html = $content;
    } else {
      $html = 'This content is for members only.  Please <a href="'.get_bloginfo('url').'/login/">log in</a> or <a href="'.get_bloginfo('url').'/membership/">register to join</a>.';
    } 	
    return $html;
}
Posted: Thursday Sep 20th, 2012 at 8:25 am #25928

Right, the More tag breaks the shorcodes, as far as I remember. I think you’ll need to use a conditional before and another after the More tag. Have you tried that?

Posted: Thursday Sep 20th, 2012 at 9:17 am #25942

Yep, that works – thank you!

Posted: Saturday Sep 22nd, 2012 at 5:32 am #26093

Great! :)

Posted: Monday Sep 24th, 2012 at 8:08 am #26293
Jura Website
Username: juraweb

Hi Eduan,

You said (Posted: Thursday Sep 6th, 2012 @ 12:07 pm) on your reply to Sarah that the drop-down login can only work with S2 Pro and that the code can only be shared with users who have the S2 Pro, am I right?

Then I am luck as I bought the S2 Pro, could you please share the code?

“1. I would really like to re-create the drop-down login form as used on this S2 site. I have searched the forums & it seems it’s a custom installation of the Pro login widget. Can the code be shared?
This is some customized code, and we really can’t share the code, since it wouldn’t work unless you have the pro version of s2Member.”

If the code is extremely confidential (which I guess should not be as the idea in the forum is to help customers achieve their goals) could you please advise how to insert two fields (user and password) on the top menu and a button “login”?

Cheers,

Jura.

Posted: Monday Sep 24th, 2012 at 12:39 pm #26331
Eduan
Username: Eduan
Moderator

Hello Jura,

Well, the code is actually the login widget, put inside a div that contains it, and that div slides down with a jQuery function, from what I can guess. So if you have the pro version then check under Dashboard -› s2Member® -› API / Scripting -› Pro Login Widget (via PHP) and you can integrate it like I told you or better.

Hope this helps. :)

Viewing 10 replies - 1 through 10 (of 10 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.