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: The Golden Warriors of Light

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


Topics I'm Subscribed To


My Latest Replies (From Various Topics)

Viewing 23 replies - 1 through 23 (of 23 total)
Author Replies
Author Replies
Posted: Monday May 27th, 2013 at 4:28 am #50700

Update:

I’ve done some more work on it, this is the result so far, and still nothing is working. Anyone at Level #2 is not being provided with the CCAP Product or having their Sample CCAP removed.

<?php

	if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 2)
    {

		$user = wp_get_current_user();
		$user->add_cap ("access_s2member_ccap_product");
		$user->remove_cap ("access_s2member_ccap_sample");
		
	}

?>

Update #2:

I’ve just put this inside my Header.php file and it is now working. I fear it may have been something to do with my CRON Job, as I just set up email notifications within it, and I’m getting errors that it doesn’t exist, while I can access the directory in my browser.

Posted: Friday May 24th, 2013 at 3:58 am #50542

Just bumping this thread again, as I really need an answer before the s2Member Staff Team go for their Weekend!

Posted: Wednesday May 22nd, 2013 at 8:12 am #50366

Just bumping the thread, as I’d really like a solution to this issue. I’m looking for a way to reward people with CCAPS based on their Level and how long they’ve been a member!

Thank you!

Posted: Tuesday May 21st, 2013 at 8:59 am #50287

Greetings,

I’ve done some testing with this system, and I’ve done everything I can to debug the code, but for some reason it isn’t working. I’ve made another test payment via PayPal to ensure that this system is working with Express Checkout or Website Payment Pro, but so far nothing has been working.

No errors along the way, no issues and no problems, just the Custom Capabilities are not being assigned. I fear this may be due to the code not functioning properly. Any chance someone could take a look at it?

<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL == 2){

	$days_ccap = array(
	
		1  => 'product1',
		7  => 'product2',
		31 => 'product3',
		39 => 'product4',
		
	);

	foreach ($days_ccap as $days => $ccap) {
	
		if (!current_user_can('access_s2member_ccap_'.$ccap) && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= $days) {
		
			$user = new WP_User(S2MEMBER_CURRENT_USER_ID);
			
			$user->add_cap('access_s2member_ccap_'.$ccap);
		}
	}
}
?>
Posted: Wednesday May 15th, 2013 at 10:31 am #50017

The system isn’t working as intended, any possible fix?

Posted: Saturday May 11th, 2013 at 9:25 am #49737

Greetings Bob,

I’m curious to know why you need to perform a whole transfer, rather then simply rebuild the same settings in your new environment. This may be a matter of speed, but I always find it much better to build a checklist, and ensure that the system is built fresh, so I can recap how the system is built.

What you could do (if you have access to the Database) is simply export the whole thing, and then remove the users using a SQL Script?

I don’t have an example to hand, but you should be able to find a script suitable to your needs.

Warning: Always have a backup, stored in a secure and easily accessible place. Should anything go wrong, the last thing you want is extended maintenance, issues or even having to rebuild everything from scratch, when your timetable didn’t allow for it.

Posted: Saturday May 11th, 2013 at 9:21 am #49736

Greetings Saurav,

I’m not entirely sure if this is what you’re after, but it is completely possible to build an Account Profile, Membership Area or User Profile using s2Member.

My method requires the use of a new page template within your WordPress Installation, and some Php Knowledge, but nothing to tricky as all of the information can be found in the s2Member Scripting Section.

<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 0){ ?>
    			
	<p><strong>Account Username:</strong> <?php echo S2MEMBER_CURRENT_USER_LOGIN; ?></p> 
    				
	<p><strong>Account Email Address:</strong> <?php echo S2MEMBER_CURRENT_USER_EMAIL; ?></p>
    				
	<p><strong>Account Registered:</strong> <?php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; ?> Days ago</p>
    				
	<p><strong>Account ID Number:</strong> <?php echo S2MEMBER_CURRENT_USER_ID; ?></p>
    				
	<p><strong>Member Name:</strong> <?php echo S2MEMBER_CURRENT_USER_FIRST_NAME; ?> <?php echo S2MEMBER_CURRENT_USER_LAST_NAME; ?></p>
    				
	<p><strong>Membership Level:</strong> <?php echo S2MEMBER_CURRENT_USER_ACCESS_LABEL; ?></p>
   					
	<p><strong>Membership ID Number:</strong> <?php echo S2MEMBER_CURRENT_USER_SUBSCR_ID; ?></p>	
 	
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>

	<!-- Redirect users who are not logged in, to the Login Page -->

    	<script type="text/javascript">
		window.location = 'http://www.example.com/login/';
	</script>
	 			
<?php } ?>

This is just a sample of our membership page. From this page, people can see their account information, and we simply add a HTML Input Button with an Popup Window that allows them to edit that information in the default s2Member Profile Editing Page, when you set it up.

I hope this goes some way to showing you, that by a little bit of Php (or some Shortcode could do the same trick) you’ll be able to display content specifically for certain users.

Note; The little Javascript at the end just redirects anyone who isn’t logged in, onto the Login Page, so only those with Accounts, and thusly only those who’ve filed their information with us, can access the page.

Posted: Saturday May 11th, 2013 at 9:17 am #49735

Hello Arthur,

I’m not an expert on .htacess files, but by the look of things, it is to do with disabling the GZIP Compression (If you have it active) when dealing with s2Member File Downloads.

Now, I can’t say for certain the impact this’ll have, but I assume it will cause some issues when downloading files from s2Member itself. If all your downloads are handled by other plugin, you shouldn’t experience any issues.

Personally, I would test this to be certain. Set up a new environment (or a page / area members can’t access) and assign a download from both your Easy Digital Download Plugin, and also from s2Member. If you’re not hitting any issues with allowing s2Member Downloads without the code, I would assume it isn’t critical.

However, what I will mention is that s2Member does allow for people to buy certain downloadable content through Buy Now buttons, so the addition of another plugin into your site, to handle a service already provided might be problematic.

I know we’ve switched several of our services over to s2Member, simply because of how reliable they are with their updates, improvements and fixing any issues that WordPress updates may cause.

Carefully assess the implications of additional software when you’ve got a system already capable of performing the same task, especially when it comes to paid services.

Posted: Friday May 10th, 2013 at 9:12 am #49686

Greetings Dedoceo,

I’ve built my own Account Page using s2Member Scripting using Php, although Shortcode would work just as well. Here is the basic concept that we use.

<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 0){ ?>
    			
	<p><strong>Account Username:</strong> <?php echo S2MEMBER_CURRENT_USER_LOGIN; ?></p> 
    				
	<p><strong>Account Email Address:</strong> <?php echo S2MEMBER_CURRENT_USER_EMAIL; ?></p>
    				
	<p><strong>Account Registered:</strong> <?php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; ?> Days ago</p>
    				
	<p><strong>Account ID Number:</strong> <?php echo S2MEMBER_CURRENT_USER_ID; ?></p>
    				
	<p><strong>Member Name:</strong> <?php echo S2MEMBER_CURRENT_USER_FIRST_NAME; ?> <?php echo S2MEMBER_CURRENT_USER_LAST_NAME; ?></p>
    				
	<p><strong>Membership Level:</strong> <?php echo S2MEMBER_CURRENT_USER_ACCESS_LABEL; ?></p>
   					
	<p><strong>Membership ID Number:</strong> <?php echo S2MEMBER_CURRENT_USER_SUBSCR_ID; ?></p>	
 	
<?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>

	<!-- Redirect users who are not logged in, to the Login Page -->

    	<script type="text/javascript">
		window.location = 'http://www.example.com/login/';
	</script>
	 			
<?php } ?>

We’ve put in some more details (I can’t share here, for security reasons) but this is generally the way it works. We’ve then put this code (or the shortcode equivalents) into a page, and so that whenever someone visits the page, their account information is displayed, or they’re redirected away to the Login Page, if they’re not logged in.

Hope that helps!

Posted: Friday May 10th, 2013 at 5:16 am #49679

Greetings,

I’ve made a small change to the way in which it selects the user, and the code is no longer turning up any errors. This is great news, except currently it is not awarding anyone with the Custom Capabilities.

Now, my initial testing is related to a situation where this new system is operating on customers who’ve already been been a member for some time, and I’ve yet to test it over 24 hours (1 day) to see if it works then.

I’ll put the code here, so if anyone else is interested, or has any recommendations, they can let me know. I’ll update this thread again on Monday, with any new issues or problems.

<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL == 2){

	$days_ccap = array(
	
		1  => 'product1',
		7  => 'product2',
		31 => 'product3',
		39 => 'product4',
		
	);

	foreach ($days_ccap as $days => $ccap) {
	
		if (!current_user_can('access_s2member_ccap_'.$ccap) && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= $days) {
		
			$user = new WP_User(S2MEMBER_CURRENT_USER_ID);
			
			$user->add_cap('access_s2member_ccap_'.$ccap);
		}
	}
}
?>
Posted: Friday May 3rd, 2013 at 3:40 am #49102

Quick question then about formatting this CCAP System.

Would this work fine, and be an effective way of handling it, or is there a better way to have this system?

<?php 
if(current_user_is('s2member_level2') && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 1) { 
	$user = new WP_User(S2MEMBER_CURRENT_USER_ID);
	$user->add_cap("access_s2member_ccap_product1");
} 
?>
<?php 
if(current_user_is('s2member_level2') && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 7) { 
	$user = new WP_User(S2MEMBER_CURRENT_USER_ID);
	$user->add_cap("access_s2member_ccap_product2");
} 
?>
<?php 
if(current_user_is('s2member_level2') && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 31) { 
	$user = new WP_User(S2MEMBER_CURRENT_USER_ID);
	$user->add_cap("access_s2member_ccap_product3");
} 
?>
<?php 
if(current_user_is('s2member_level2') && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 39) { 
	$user = new WP_User(S2MEMBER_CURRENT_USER_ID);
	$user->add_cap("access_s2member_ccap_product4");
} 
?>
Posted: Friday May 3rd, 2013 at 3:22 am #49101

Okay. I’ve deactivated Better WP Security, and that has fixed the issue to a degree. Sadly, the PayPal & Card Details section is not operating properly.

When clicking on PayPal, I assume the Card Details box is not meant to be visible. I’ll continue to try a few more plugins, but some of the remaining plugins are critical to our operations.

Quick Question; Do you have any idea as to why it would be Better WP Security causing this issue?

Resolved!

It was a combination of Better WP Security & WP e-Commerce. We were using WP e-Commerce as a one off payment system, but I think I’ll just convert the Web store System to support s2Member and use the Buy Now functionality.

Posted: Friday May 3rd, 2013 at 2:36 am #49090

Fantastic, Thanks.

However, is there anything you can think of, as to why the Style Sheet is not loading for everyone else, but only the Administrator?

I’ve run a clean install, and it hasn’t worked. You can see the page for yourself here; http://thegoldenwarriorsoflight.com/membership-registration/GBP/

Posted: Thursday May 2nd, 2013 at 4:44 pm #49035

Just looking to see if there is any update or response to the issue I posted, and any help with the code I posted.

Thanks!

Posted: Thursday May 2nd, 2013 at 3:06 am #48999

Greetings,

Thanks for the responses. In response to your Cristian, I’m using a bit of code you’ve developed for me before, and you can see it here:

<?php 
if(current_user_is('s2member_level1') && S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS >= 30) { 
	$user = new WP_User(S2MEMBER_CURRENT_USER_ID);
	$user->set_role('s2member_level2');
} 
?>

Essentially, what I want there is then award the Custom Capabilities, instead of upgrading their Membership Level. However! The one issue this system did have, was that the Administrator Account was also constantly being promoted, demoted, and moved around. Is there anyway we could code in so that the Administrator Account is ignored, or set as Administrator every time this is run?

To Eduan, I’ve run all the troubleshooting, turned off all plugins and support systems that are not critical to our site. A lot of our site has been built bespoke, and around a lot of certain functionality.

The only remaining plugins however, shouldn’t have any impact on the CSS. I’d much rather leave that as a last ditch attempt, as I don’t wish to start messing with the site, and removing core features only to have to spend a few more hours fixing it later.

As I said, I’m confused as to why the CSS is just not loading on the Pro Form, yet it does for the Administrator Account. However, even on the Administrator Account, the PayPal & Payment Options box is always present, choosing PayPal doesn’t hide the Card Details box.

Posted: Wednesday May 1st, 2013 at 5:04 pm #48945

Several other topics are getting some attention, and I wanted to just ensure this thread isn’t lost. The two problems I am facing are critical to our company, and I’d like help resolving them as soon as possible.

I know the folks at s2Member are busy, but a few moments to resolve these issues would be great. Thank you.

Posted: Wednesday May 1st, 2013 at 10:22 am #48910

I’m sorry to bump this thread again, but the situation is getting rather critical now, and the issue with the PayPal Form remains, and the CCAP Over Time System I’ve tried with another hack is not functioning at all.

Posted: Wednesday May 1st, 2013 at 5:26 am #48892

Any Staff able to update me on the two issues I am having?

Posted: Tuesday Apr 30th, 2013 at 1:49 pm #48804

Thanks Cassel,

Sadly, I don’t really want to invest any money into this solution, as I know something like this could be achieved easily using one of the intelligent members of the s2Member Staff.

I’ve run a hack before that promoted people automatically over time, with the same parameters that I want, but we changed our design intention from membership levels, to Custom Capabilities. The problem is when I tried to convert it myself, it didn’t function.

Thanks again for the support though.

Posted: Tuesday Apr 30th, 2013 at 10:36 am #48796

Additional Support Needed!

While this problem isn’t related to the one above, I wanted to grab a member of staff while they’re here, so they can help me resolve this problem also.

I’m currently experiencing a very odd situation when it comes to my PayPal Pro Forms. When logged in as an Administrator, the form is presented in the correct manner, the nice icons, layout and the important information, such as Name, Email Address & Payment Gateways are presented.

This can be seen here: http://i.imgur.com/gj3Mccf.jpg

Alternatively, when accessing this page logged in as anything other then an Administrator, the form is not styled at all, and the look is totally ruined. None of the icons load, and nothing functions.

Looking at the issue with Firebug, I can see what the CSS is just not loading at all, but I think this might be down to the fact that the form seems to believe I am not logged in, despite checking several times. I’ve even used sections of code to ensure, by making it only visible when logged in.

The result can be seen here: http://i.imgur.com/Du3tGaS.jpg

I’ve no idea why the CSS is loading on the form only for Administrators, but that clearly indicates to me that there is not a plugin conflicting, as it works in one scenario, and not the other.

Any support, would be fantastic. Thanks.

Posted: Tuesday Mar 5th, 2013 at 12:22 pm #43794

Is it possible to get help with this matter? It is pretty vital to my website.

Posted: Monday Mar 4th, 2013 at 4:50 am #43686

Any update I can get on this matter?

Posted: Saturday Mar 2nd, 2013 at 10:03 am #43615

In the example listed on that page, I see this section:

if (s2member_registration_time ($user->ID) <= $_10_days_ago)

Is is possible to input a Paid Registration Time rather then a Registration Time, so something like this:

if (s2member_paid_registration_time ($user->ID) <= $_10_days_ago)

Update:

After doing some testing with this, I was wondering if I could get some help in building this up to do exactly what I want, because a few issues have arisen from this.

Firstly, it is setting my Administration Account to the appropriate levels during the processing, and I was wondering if there is a way to prevent that.

Secondly, I was wondering if I could maybe have this done multiple times. So, every 3 months, the user is updated into the next level up to a maximum level.

We have 4 levels that we want people to go through, and on the 5th level we want them to stop being promoted every 3 months. Is this at all possible?

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