i4w_showbefore

Usage:

This shortcode enables segmenting content within a page, post, excerpt or text widget based on either a subscriber’s registration date or a date passed to the shortcode.

The content embedded between the shortcode’s begin and ending tags will be displayed if either the subscriber has been registered fewer than the number of days or weeks specified in the shortcode parameters or, if a date parameter is give, the given number of days or weeks have not yet passed since that date.

[ELSE_showbefore] conditional branching is supported.

Shortcode nesting is NOT supported.

Parameters:

days Specifies the minimum number of “membership” days.
Default: none.
Required: yes, if “weeks” is not selected.
weeks Specifies the minimum number of “membership” weeks.
Default: none.
Required: yes, if “days” is not selected.
tagid Optionally specifies a comma separated list of Infusionsoft tag ID’s for which this shortcode should check. Important: If the visitor doesn’t meet the tag ID requirement, the shortcode is entirely ignored, including the [ELSE] clause.
Default: none.
Required: no.
dateformat Specifies the date display format based on PHP date() syntax to be used.
Default: ‘F jS, Y’.
Required: no.
date Specifies the base date for the time difference calculation.
Default: user’s registration date.
Required: no.

Example:

[i4w_showbefore days='7']
  Display (teaser) if the subscriber has NOT been a member at least 7 days
[ELSE_showbefore]
  Display full content or link to same if the subscriber has been a member for at least 7 days to view this content.
[/i4w_showbefore]

[i4w_showbefore weeks='2']
  Display (teaser) if the subscriber has NOT been a member at least 2 weeks
[ELSE_showbefore]
  Display full content or link to same if the subscriber has been a member for at least 2 weeks to view this content.
[/i4w_showbefore]

Special variables:
Within the “content” part of the shortcode, several variables may be used, which will be resolved at runtime based on realtime factors. These substituted values will be based on the subscriber´s time as a member in comparison to the parameter supplied in the shortcode. Please note that these variables are NOT resolved in the [ELSE_showbefore] portion of the shortcode and should not be used there.
%%days%% : will resolve to “5 days” or “1 day” – or similar.
%%weeks%% : will resolve to “5 weeks” or “1 week” – or similar.
%%date%% : will resolve to the date that the content will be available, such as “December 25th, 2010”.
%%weeksndays%% : will resolve to “5 weeks and 4 days” – or similar.

[i4w_showbefore date='2012-01-01 00:00:00' days='26' dateformat='F jS, Y']
  This super content is not yet available. It will be available in %%days%%, which is also %%weeks%% or, more accurately, in %%weeksndays%%.
  If you're not sure when that will be, the release date will be %%date%%.
[ELSE_showbefore]
  This is your super content.
[/i4w_showbefore]

[i4w_showbefore tagid='12,34,56' days='26' dateformat='F jS, Y']
  This super content is not yet available. It will be available in %%days%%, which is also %%weeks%% or, more accurately, in %%weeksndays%%.
  If you’re not sure when that will be, the release date will be %%date%%.
[ELSE_showbefore]
  This is your super content.
[/i4w_showbefore]

(Note: if the subscriber doesn’t have any of the tag ID’s listed, the shortcode will be ignored in its entirety.)

Notes:

The parameters “days” and “weeks” are mutually exclusive. Only one can be used. If both are used, “days” will have priority.

This shortcode works independently of the “Gradual Content Release” settings in the “Plugin Options” panel. You may segment parts of a page or post even if you have not activated “Gradual Content Release”.

API:

There is no API function equivalent for this shortcode.