Limiting membership access based on a preset number

I have a requirement to limit access to a membership based on the number of times it has been accessed.

In other words, “Memberhip Level X” allows you to access this class up to 5 times. no more than that

Does anyone know of a way this is doable within S2Member?

Hi Ahmed.

It’s funny that you mention that, because it’s a feature I plan to build in a future add-on, although no one had asked for it until now. I’m adding your vote for it in my list.

Well, it’d be possible to hack this. You’d need to create a counter, and add to it every time the page is loaded. So you’d need a hook around the time the user’s access is checked, get the level’s limit, add to the user’s counter, check if it’s within the uses limit, and prevent access if not.

:slight_smile:

1 Like

Thanks for getting back to me. I definitely think it would be a very useful feature and would have a lot of possible applications.

The coding you mentioned sounds pretty straightforward but I’m not even sure where to start. Any suggestions? Otherwise I will just have to wait.

1 Like

I see. Yeah, it is, if you already know PHP and WordPress development. If you get a developer, those tips should help him.

But like I said, I plan to look into this myself eventually, and I have a renewed interest in it after your comments here.

Thanks for the input! :slight_smile:

1 Like