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.

About: Colin Kells

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 3 topics - 1 through 3 (of 3 total)
Topic Count Last Reply
PHP not working on Login Welcome Page

By:  Colin Kells in: Community Forum

voices: 3
replies: 11

3 years, 12 months ago  Colin Kells

User Field – Short Code works PHP does not

By:  Colin Kells in: Community Forum

voices: 1
replies: 1

4 years ago  Colin Kells

Setting User "Role" using Custom Registration

By:  Colin Kells in: Community Forum

voices: 1
replies: 0

4 years ago  Colin Kells

Viewing 3 topics - 1 through 3 (of 3 total)

Topics I've Started

Viewing 3 topics - 1 through 3 (of 3 total)
Topic Count Last Reply
PHP not working on Login Welcome Page

By:  Colin Kells in: Community Forum

voices: 3
replies: 11

3 years, 12 months ago  Colin Kells

User Field – Short Code works PHP does not

By:  Colin Kells in: Community Forum

voices: 1
replies: 1

4 years ago  Colin Kells

Setting User "Role" using Custom Registration

By:  Colin Kells in: Community Forum

voices: 1
replies: 0

4 years ago  Colin Kells

Viewing 3 topics - 1 through 3 (of 3 total)

My Latest Replies (From Various Topics)

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Sunday Jan 13th, 2013 at 4:57 pm #37307
Colin Kells
Username: cpufix

Work around solution.

There really is something wrong with if(current_user_is(“s2member_level[1-4]″)) on my site.
I have now created a new role named paid and given it the effective rights of s2member_level1, this
is working fine.

Posted: Sunday Jan 13th, 2013 at 4:06 pm #37303
Colin Kells
Username: cpufix

Hi

I have changed the Theme to a WP default theme and still have the same challenge.
Deactivated pluggins just running:
wp no category base WPML compatible
User role editor
S2 framework and Pro V121213
Exec-PHP V4.9.
Same challenge.

I have noted in the settings of Exec PHP that its reffering to users permitted on articles and not pages.

What pluggin does S2 Member suggest for PHP and User Role Edit?

After this I’ll try fresh installed WP and S2 on another site

  • This reply was modified 3 years, 12 months ago by  Colin Kells.
Posted: Sunday Jan 13th, 2013 at 2:04 pm #37284
Colin Kells
Username: cpufix

Hi Jason

Thank you for your reply and help.
I’ll step through your suggestions and see how it goes.

I have tried the Rest Roles several times.

Can you please confirm that you ran the tests on the S2 protected login page and that this was done on Word Press 3.5 ?

The following piece of code works fine and returns the correct condition for the Level 1 member ID

<?php
if(user_is(29, "subscriber"))
	echo 'User ID# 29 is a Free Subscriber at Level #0.';
 
else if(user_is(29, "s2member_level1"))
	echo 'User ID# 29 is a Member at Level #1.';
 
else if(user_can(29, "access_s2member_level2"))
	echo 'User ID# 29 has access to content protected at Level #2.';
	# But, (important) they could actually be a Level #3 or #4 Member;
	# because Membership Levels provide incremental access.
?>

<?php
if(user_is(28, "subscriber"))
	echo 'User ID# 28 is a Free Subscriber at Level #0.';
 
else if(user_is(28, "s2member_level1"))
	echo 'User ID# 28 is a Member at Level #1.';
 
else if(user_can(28, "access_s2member_level2"))
	echo 'User ID# 28 has access to content protected at Level #2.';
	# But, (important) they could actually be a Level #3 or #4 Member;
	# because Membership Levels provide incremental access.
?>

Which to me looks like a problem in the if(current_user_is(“s2member_level1”)).

The function http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_current_user_is%28%29
implies a change at version 3.5 (I assume this is Word Press) as follows:

“Since:
3.5
Parameters:
str $role – A WordPress® Role ID ( i.e. s2member_level[0-9]+, administrator, editor, author, contributor, subscriber ).
Returns:”

Posted: Saturday Jan 12th, 2013 at 3:51 pm #37176
Colin Kells
Username: cpufix

If I use the following code from your article.

<?php
if(current_user_is("subscriber"))
	echo 'You ARE a Free Subscriber at Level #0.';
 
else if(current_user_is("s2member_level1"))
	echo 'You ARE a Member at Level #1.';
 
else if(current_user_can("access_s2member_level2"))
	echo 'You DO have access to content protected at Level #2.';
	# But, (important) they could actually be a Level #3 or #4 Member;
	# because Membership Levels provide incremental access.
?>

And use the following S2

[s2If current_user_is(subscriber)]
You ARE a Free Subscriber at Level #0.
[/s2If]
[s2If current_user_is(s2member_level1)]
You ARE a Member at Level #1.
[/s2If]
[s2If current_user_can(access_s2member_level2)]
You DO have access to content protected at Level #2.
[/s2If]

Logon as Subsriber both PHP and S2 return
You ARE a Free Subscriber at Level #0.

Logon as Level 1
PHP returns – You ARE a Free Subscriber at Level #0.
S2 returns – You ARE a Member at Level #1.

Posted: Saturday Jan 12th, 2013 at 3:37 pm #37173
Colin Kells
Username: cpufix

Ok I have changed from “Role Manager” to “User Role Editor” this does seem a lot better to use. Have reset S2 member levels and labels. Removed test users and created new users.

Using the following code

<?php if (current_user_is("s2member_level4")){ ?>
   Some premium content for Level 4 Members.
<?php } else if (current_user_is("s2member_level3")){ ?>
   Some premium content for Level 3 Members.
<?php } else if (current_user_is("s2member_level2")){ ?>
   Some premium content for Level 2 Members.
<?php } else if (current_user_is("s2member_level1")){ ?>
   Some premium content for Level 1 Members.
<?php } else if (current_user_is("s2member_level0")){ ?>
   Some content for Free Subscribers.
<?php } else { ?>
   Some public content.
<?php } ?> 

<?php 
if (current_user_can("access_s2member_ccap_free")) 
{
echo "Content for ccap free Members.";
}
elseif (current_user_can("access_s2member_ccap_bapaid"))
{
echo "Content for ccap bapaid Members.";
}
?>

Login using s2member level0 – I get displayed
Some Content For Free Subscribers
Content For ccap free members

Login using s2member level1 – I also get displayed
Some Content For Free Subscribers
Content For ccap free members

This is the problem its seeing all logons as Free Subs.

I’ll look throught the articles that you have included in your reply.
Cheers

Posted: Wednesday Jan 9th, 2013 at 1:10 pm #36794
Colin Kells
Username: cpufix

Hi Cristian

Code was inserted in TEXT mode.

I have added the line below and the ws_table works fine.

<?php echo do_shortcode('[ws_table id="1"]'); ?>
  • This reply was modified 3 years, 12 months ago by  Colin Kells.
Posted: Wednesday Dec 26th, 2012 at 6:47 pm #35527
Colin Kells
Username: cpufix

Resolved

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

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.