# s2member/260927/src/includes/menu-pages/code-samples/current-user-registration-days.x-php

s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls &amp; Member Access Subscriptions, version 260927. 41 lines.

- Page: https://pluginprobe.com/plugins/s2member/260927/code/src/includes/menu-pages/code-samples/current-user-registration-days.x-php
- Raw: https://pluginprobe.com/plugins/s2member/260927/raw/src/includes/menu-pages/code-samples/current-user-registration-days.x-php
- Modified: 2016-11-29T22:22:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/s2member/260927/code/src/includes/menu-pages/code-samples/current-user-registration-days.x-php#L10-L20`.

```
<?php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; ?>
This may output something like: 120 (120 days is approx 4 months)

-------------------------------------------------------------------------

In this example, the longer they've been registered (for free or otherwise), the more they get.

<?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 30){ ?>
	Drip content to Users who've been registered for at least 30 days.
<?php } ?>

<?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 60){ ?>
	Drip content to Users who've been registered for at least 60 days.
<?php } ?>

<?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 90){ ?>
	Drip content to Users who've been registered for at least 90 days.
<?php } ?>

---- s2member Shortcode Equivalent (Requires s2Member Pro) ----

[s2If php="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 30"]
	Drip content to Users who've been registered for at least 30 days.
[/s2If]

[s2If php="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 60"]
	Drip content to Users who've been registered for at least 60 days.
[/s2If]

[s2If php="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 90"]
	Drip content to Users who've been registered for at least 90 days.
[/s2If]

**NOTE** The use of `[s2If php=""]` requires s2Member Pro.
**NOTE** Arbitrary PHP code (via [s2If php=""]) will only work if you enable this functionality.
	Please visit `Dashboard → s2Member → Restriction Options → Simple Shortcode Conditionals`
		to set your preferences and enable `[s2If php=""]` when s2Member Pro is installed.

---- Another s2member Shortcode Equivalent ----

[s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS" /]
```
