s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) - Version 3.2.2

Version Description

  • Simple Conditionals ( completely re-written ). Simple Conditionals, first introduced in s2Member v3.2.1; have been completely re-written to support a wider range of features. The new Shortcode is s2If. The older Shortcodes have now been deprecated: s2All, s2Any ( do NOT use ). The older Shortcodes will continue to work with backward compatiblity, but they'll be removed in a future release of s2Member. Please update any existing Shortcodes referencing s2All,s2Any ( do NOT use ), by switching them all over to s2If instead. We apologize for the drastic changes to this new feature; but it was a necessary step forward. The initial release of Simple Conditionals was very buggy, and NOT as extensible as the new s2If logic is now. If you've been using Simple Conditionals, you will need to re-review all documentation and code samples. The new s2If Shortcode is fully documented, inside your WordPress Dashboard under: s2Member -> API Scripting -> Simple Conditionals.
  • Starting with s2Member v3.2.3, "Simple Conditionals" are now available to you from within WordPress, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress. We've been through all of the documentation for s2Member, and updated (again) ALL code samples to provide you with Shortcode equivalents. You can learn more about this new feature in your WP Dashboard, under: s2Member -> API Scripting -> Simple Conditionals. Simple Conditionals are a NEW feature, and they'll have no affect on Advanced Conditionals; which have always been available for s2Member.
  • Bug Dodging. A call to get_defined_constants(true) inside css-js-w-globals.inc.php was causing a segfault on some installations of PHP 5.2. Bug reports at PHP.net indicate this is caused by the (true) argument being passed; and under the right conditions ( e.g. with the right combination of PHP extensions installed ) this can result in a segfault. In this release of s2Member ( v3.2.2 ), we've dodged this PHP bug completely, by implementing a different method for tracking the integrity of API Constants, thereby circumventing this odd behavior on some Apache/PHP installations. s2Member no longer makes any calls to the get_defined_constants() function.
  • New Feature. s2Member can now send automatic API Notification Emails, which include a full Transaction Log for each API Notification event. In other words, you can now tell s2Member to send emails to different addresses, for each of s2Member's API Notification events. For further details, see: s2Member -> API Notifications. Look for "Email Transaction Log" under each sub-section. This new feature will make it easier to integrate s2Member with back-office routines, and in particular, easier to integrate with 3rd-party list servers - other than MailChimp/AWeber, which s2Member already supports natively. This new feature also makes it easier to build confidence in s2Member. As a Site Owner, you may configure email notifications for each event, and monitor s2Member's behavior.
  • New API Notification. s2Member can now process separate API Notifications for "Cancellation" events. For further details, see: s2Member -> API Notifications -> Cancellations. Using this feature in conjunction with the new Email Transaction Logs, you can be notified via email; each time a Cancellation occurs.
  • Bug fix. On a Multisite Blog Farm, s2Member was missing an important Hook/Filter ( signup_hidden_fields ) during a registration that included both an account, and also a Blog. This bug has been resolved with s2Member v3.2.2+.
Download this release

Release Info

Developer PriMoThemes
Plugin Icon 128x128 s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)
Version 3.2.2
Comparing to
See all releases

Code changes from version 3.2.1 to 3.2.2

Files changed (35) hide show
  1. includes/codes.inc.php +21 -9
  2. includes/functions/auto-eots.inc.php +47 -12
  3. includes/functions/constants.inc.php +71 -68
  4. includes/functions/css-js-w-globals.inc.php +14 -22
  5. includes/functions/paypal-button.inc.php +7 -8
  6. includes/functions/paypal-notify.inc.php +301 -6
  7. includes/functions/register-access.inc.php +73 -2
  8. includes/functions/sc-get-details.inc.php +11 -12
  9. includes/functions/sc-if-conditionals.inc.php +237 -0
  10. includes/functions/{sc-conditionals.inc.php → sc-old-conditionals.inc.php} +11 -6
  11. includes/functions/user-deletions.inc.php +51 -15
  12. includes/functions/utilities.inc.php +16 -0
  13. includes/hooks.inc.php +2 -1
  14. includes/menu-pages/api-ops.inc.php +252 -11
  15. includes/menu-pages/code-samples/current-user-access-level-conditional-upgrades.php +10 -10
  16. includes/menu-pages/code-samples/current-user-access-level.php +12 -12
  17. includes/menu-pages/code-samples/current-user-can-ccaps-1.php +8 -8
  18. includes/menu-pages/code-samples/current-user-can-ccaps-2.php +16 -16
  19. includes/menu-pages/code-samples/current-user-fields.php +6 -6
  20. includes/menu-pages/code-samples/current-user-is-logged-in-as-member.php +2 -2
  21. includes/menu-pages/code-samples/current-user-is-logged-in.php +2 -2
  22. includes/menu-pages/code-samples/sc-current-user-can-full-access.php +4 -4
  23. includes/menu-pages/code-samples/sc-current-user-is-specific-content.php +12 -12
  24. includes/menu-pages/code-samples/sc-is-user-logged-in.php +5 -4
  25. includes/menu-pages/code-samples/sc-s2-conditional-nesting.php +5 -0
  26. includes/menu-pages/code-samples/sc-s2-conditional-supplements-1.php +8 -8
  27. includes/menu-pages/code-samples/sc-s2-conditional-supplements-2.php +14 -14
  28. includes/menu-pages/code-samples/sc-s2-conditional-supplements-3.php +18 -12
  29. includes/menu-pages/mms-options.inc.php +3 -3
  30. includes/menu-pages/options.inc.php +3 -3
  31. includes/menu-pages/scripting.inc.php +89 -81
  32. includes/menu-pages/trk-ops.inc.php +4 -4
  33. includes/syscon.inc.php +20 -23
  34. readme.txt +11 -4
  35. s2member.php +3 -3
includes/codes.inc.php CHANGED
@@ -19,15 +19,27 @@ http://codex.wordpress.org/Shortcode_API
19
  */
20
  add_shortcode ("s2Get", "ws_plugin__s2member_sc_get_details");
21
  /**/
22
- add_shortcode ("s2All", "ws_plugin__s2member_sc_conditionals");
23
- add_shortcode ("_s2All", "ws_plugin__s2member_sc_conditionals");
24
- add_shortcode ("__s2All", "ws_plugin__s2member_sc_conditionals");
25
- add_shortcode ("___s2All", "ws_plugin__s2member_sc_conditionals");
26
- /**/
27
- add_shortcode ("s2Any", "ws_plugin__s2member_sc_conditionals");
28
- add_shortcode ("_s2Any", "ws_plugin__s2member_sc_conditionals");
29
- add_shortcode ("__s2Any", "ws_plugin__s2member_sc_conditionals");
30
- add_shortcode ("___s2Any", "ws_plugin__s2member_sc_conditionals");
31
  /**/
32
  add_shortcode ("s2Member-PayPal-Button", "ws_plugin__s2member_sc_paypal_button");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  ?>
19
  */
20
  add_shortcode ("s2Get", "ws_plugin__s2member_sc_get_details");
21
  /**/
22
+ add_shortcode ("s2If", "ws_plugin__s2member_sc_if_conditionals");
23
+ add_shortcode ("_s2If", "ws_plugin__s2member_sc_if_conditionals");
24
+ add_shortcode ("__s2If", "ws_plugin__s2member_sc_if_conditionals");
25
+ add_shortcode ("___s2If", "ws_plugin__s2member_sc_if_conditionals");
 
 
 
 
 
26
  /**/
27
  add_shortcode ("s2Member-PayPal-Button", "ws_plugin__s2member_sc_paypal_button");
28
+ /*
29
+ ----------------------------------------------------------------------------------------
30
+ The following Shortcodes were deprecated in v3.2.2.
31
+ Going forward, use [s2If] instead ( it's more powerful ).
32
+ @NOTE: These Shortcodes were ONLY available in v3.2.1.
33
+ ~ These WILL all be removed in a future release.
34
+ ----------------------------------------------------------------------------------------
35
+ */
36
+ add_shortcode ("s2All", "ws_plugin__s2member_sc_old_conditionals");
37
+ add_shortcode ("_s2All", "ws_plugin__s2member_sc_old_conditionals");
38
+ add_shortcode ("__s2All", "ws_plugin__s2member_sc_old_conditionals");
39
+ add_shortcode ("___s2All", "ws_plugin__s2member_sc_old_conditionals");
40
+ /**/
41
+ add_shortcode ("s2Any", "ws_plugin__s2member_sc_old_conditionals");
42
+ add_shortcode ("_s2Any", "ws_plugin__s2member_sc_old_conditionals");
43
+ add_shortcode ("__s2Any", "ws_plugin__s2member_sc_old_conditionals");
44
+ add_shortcode ("___s2Any", "ws_plugin__s2member_sc_old_conditionals");
45
  ?>
includes/functions/auto-eots.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit ("Do not access this file directly.");
16
  /*
17
  Function processed by WP-Cron. This handles Auto-EOTs.
18
 
@@ -71,7 +71,7 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
71
  /**/
72
  ws_plugin__s2member_append_user_notes ($user_id, "Demoted by s2Member: " . date ("D M j, Y g:i a T"));
73
  /**/
74
- if ($subscr_id && $custom && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
75
  {
76
  foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle EOT Notifications. */
77
  /**/
@@ -79,13 +79,48 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
79
  if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
80
  if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
81
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
82
- if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  /**/
84
- if (($url = trim ($url))) /* Empty? */
85
- ws_plugin__s2member_remote ($url);
 
86
  }
87
  /**/
88
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
89
  do_action ("ws_plugin__s2member_during_auto_eot_system_during_demote", get_defined_vars ());
90
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
91
  }
@@ -100,14 +135,14 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
100
  /**/
101
  else /* Otherwise, we can actually delete them. */
102
  /* This will automatically trigger `eot_del_notification_urls` as well. */
103
- wp_delete_user ($user_id); /* `ws_plugin__s2member_handle_user_deletions()` */
104
  /**/
105
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
106
  do_action ("ws_plugin__s2member_during_auto_eot_system_during_delete", get_defined_vars ());
107
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
108
  }
109
  /**/
110
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
111
  do_action ("ws_plugin__s2member_during_auto_eot_system", get_defined_vars ());
112
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
113
  }
@@ -116,7 +151,7 @@ if (!function_exists ("ws_plugin__s2member_auto_eot_system"))
116
  }
117
  }
118
  /**/
119
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
120
  do_action ("ws_plugin__s2member_after_auto_eot_system", get_defined_vars ());
121
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
122
  /**/
@@ -185,8 +220,8 @@ if (!function_exists ("ws_plugin__s2member_delete_auto_eot_system"))
185
  /**/
186
  if (function_exists ("wp_cron"))
187
  {
188
- wp_clear_scheduled_hook ("s2member_auto_eot_system"); /* This is for backward compatibility. */
189
- wp_clear_scheduled_hook ("ws_plugin__s2member_auto_eot_system__schedule"); /* Since v3.0.3. */
190
  /**/
191
  return apply_filters ("ws_plugin__s2member_delete_auto_eot_system", true, get_defined_vars ());
192
  }
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit("Do not access this file directly.");
16
  /*
17
  Function processed by WP-Cron. This handles Auto-EOTs.
18
 
71
  /**/
72
  ws_plugin__s2member_append_user_notes ($user_id, "Demoted by s2Member: " . date ("D M j, Y g:i a T"));
73
  /**/
74
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
75
  {
76
  foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle EOT Notifications. */
77
  /**/
79
  if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
80
  if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
81
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
82
+ if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_login)), $url)))
83
+ if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
84
+ /**/
85
+ if (($url = trim ($url))) /* Empty? */
86
+ ws_plugin__s2member_remote($url);
87
+ }
88
+ /**/
89
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $custom)))
90
+ {
91
+ $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
92
+ $msg .= "\n\n"; /* Spacing in the message body. */
93
+ $msg .= "subscr_id: %%subscr_id%%\n";
94
+ $msg .= "user_first_name: %%user_first_name%%\n";
95
+ $msg .= "user_last_name: %%user_last_name%%\n";
96
+ $msg .= "user_full_name: %%user_full_name%%\n";
97
+ $msg .= "user_email: %%user_email%%\n";
98
+ $msg .= "user_login: %%user_login%%\n";
99
+ $msg .= "user_id: %%user_id%%\n";
100
+ $msg .= "cv0: %%cv0%%\n";
101
+ $msg .= "cv1: %%cv1%%\n";
102
+ $msg .= "cv2: %%cv2%%\n";
103
+ $msg .= "cv3: %%cv3%%\n";
104
+ $msg .= "cv4: %%cv4%%\n";
105
+ $msg .= "cv5: %%cv5%%\n";
106
+ $msg .= "cv6: %%cv6%%\n";
107
+ $msg .= "cv7: %%cv7%%\n";
108
+ $msg .= "cv8: %%cv8%%\n";
109
+ $msg .= "cv9: %%cv9%%";
110
+ /**/
111
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($subscr_id), $msg)))
112
+ if (($msg = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds ($user->first_name), $msg)) && ($msg = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds ($user->last_name), $msg)))
113
+ if (($msg = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (trim ($user->first_name . " " . $user->last_name)), $msg)))
114
+ if (($msg = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds ($user->user_email), $msg)))
115
+ if (($msg = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds ($user->user_login), $msg)))
116
+ if (($msg = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds ($user_id), $msg)))
117
  /**/
118
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"])) as $recipient)
119
+ /**/
120
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_eot_del_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
121
  }
122
  /**/
123
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
124
  do_action ("ws_plugin__s2member_during_auto_eot_system_during_demote", get_defined_vars ());
125
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
126
  }
135
  /**/
136
  else /* Otherwise, we can actually delete them. */
137
  /* This will automatically trigger `eot_del_notification_urls` as well. */
138
+ wp_delete_user($user_id); /* `ws_plugin__s2member_handle_user_deletions()` */
139
  /**/
140
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
141
  do_action ("ws_plugin__s2member_during_auto_eot_system_during_delete", get_defined_vars ());
142
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
143
  }
144
  /**/
145
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
146
  do_action ("ws_plugin__s2member_during_auto_eot_system", get_defined_vars ());
147
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
148
  }
151
  }
152
  }
153
  /**/
154
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
155
  do_action ("ws_plugin__s2member_after_auto_eot_system", get_defined_vars ());
156
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
157
  /**/
220
  /**/
221
  if (function_exists ("wp_cron"))
222
  {
223
+ wp_clear_scheduled_hook("s2member_auto_eot_system"); /* This is for backward compatibility. */
224
+ wp_clear_scheduled_hook("ws_plugin__s2member_auto_eot_system__schedule"); /* Since v3.0.3. */
225
  /**/
226
  return apply_filters ("ws_plugin__s2member_delete_auto_eot_system", true, get_defined_vars ());
227
  }
includes/functions/constants.inc.php CHANGED
@@ -40,71 +40,74 @@ if (!function_exists ("ws_plugin__s2member_constants"))
40
  do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
41
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
42
  /**/
43
- define ("S2MEMBER_VERSION", WS_PLUGIN__S2MEMBER_VERSION); /* Available since 3.0. */
44
- /**/
45
- define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN", (($current_user) ? true : false));
46
- define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER", (($current_user && $level >= 1) ? true : false));
47
- define ("S2MEMBER_CURRENT_USER_ACCESS_LEVEL", (int)$level);
48
- define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]);
49
- define ("S2MEMBER_CURRENT_USER_SUBSCR_ID", (($current_user) ? (($subscr_id) ? (string)$subscr_id : (string)$current_user->ID) : ""));
50
- define ("S2MEMBER_CURRENT_USER_CUSTOM", (string)$custom);
51
- define ("S2MEMBER_CURRENT_USER_REGISTRATION_TIME", (($current_user) ? (int)strtotime ($current_user->user_registered) : 0));
52
- define ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS", (($current_user) ? (int)floor ((strtotime ("now") - strtotime ($current_user->user_registered)) / 86400) : 0));
53
- define ("S2MEMBER_CURRENT_USER_DISPLAY_NAME", (($current_user) ? (string)$current_user->display_name : ""));
54
- define ("S2MEMBER_CURRENT_USER_FIRST_NAME", (($current_user) ? (string)$current_user->first_name : ""));
55
- define ("S2MEMBER_CURRENT_USER_LAST_NAME", (($current_user) ? (string)$current_user->last_name : ""));
56
- define ("S2MEMBER_CURRENT_USER_LOGIN", (($current_user) ? (string)$current_user->user_login : ""));
57
- define ("S2MEMBER_CURRENT_USER_EMAIL", (($current_user) ? (string)$current_user->user_email : ""));
58
- define ("S2MEMBER_CURRENT_USER_IP", (string)$_SERVER["REMOTE_ADDR"]);
59
- define ("S2MEMBER_CURRENT_USER_ID", (($current_user) ? (int)$current_user->ID : 0));
60
- define ("S2MEMBER_CURRENT_USER_FIELDS", (($current_user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "email" => S2MEMBER_CURRENT_USER_EMAIL, "login" => S2MEMBER_CURRENT_USER_LOGIN, "first_name" => S2MEMBER_CURRENT_USER_FIRST_NAME, "last_name" => S2MEMBER_CURRENT_USER_LAST_NAME, "display_name" => S2MEMBER_CURRENT_USER_DISPLAY_NAME, "subscr_id" => S2MEMBER_CURRENT_USER_SUBSCR_ID, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ())));
61
- /**/
62
- define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED", (int)$file_downloads["allowed"]);
63
- define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED", (($file_downloads["allowed"] >= 999999999) ? true : false));
64
- define ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY", (int)$file_downloads["currently"]);
65
- define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS", (int)$file_downloads["allowed_days"]);
66
- /**/
67
- define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
68
- define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]);
69
- define ("S2MEMBER_LOGIN_WELCOME_PAGE_ID", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]);
70
- /**/
71
- define ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL", get_bloginfo ("wpurl") . "/?s2member_profile=1");
72
- define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL", (string)$links["file_download_limit_exceeded_page"]);
73
- define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL", (string)$links["membership_options_page"]);
74
- define ("S2MEMBER_LOGIN_WELCOME_PAGE_URL", (($login_redirection_override) ? (string)$login_redirection_override : (string)$links["login_welcome_page"]));
75
- define ("S2MEMBER_LOGOUT_PAGE_URL", (string)wp_logout_url ());
76
- define ("S2MEMBER_LOGIN_PAGE_URL", (string)wp_login_url ());
77
- /**/
78
- define ("S2MEMBER_LEVEL0_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]);
79
- define ("S2MEMBER_LEVEL1_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]);
80
- define ("S2MEMBER_LEVEL2_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]);
81
- define ("S2MEMBER_LEVEL3_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]);
82
- define ("S2MEMBER_LEVEL4_LABEL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]);
83
- /**/
84
- define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed"]);
85
- define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed"]);
86
- define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed"]);
87
- define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed"]);
88
- define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed"]);
89
- /**/
90
- define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed_days"]);
91
- define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed_days"]);
92
- define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed_days"]);
93
- define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed_days"]);
94
- define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"]);
95
- /**/
96
- define ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]);
97
- /**/
98
- define ("S2MEMBER_REG_EMAIL_FROM_NAME", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]);
99
- define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]);
100
- /**/
101
- define ("S2MEMBER_PAYPAL_NOTIFY_URL", get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1");
102
- define ("S2MEMBER_PAYPAL_RETURN_URL", get_bloginfo ("wpurl") . "/?s2member_paypal_return=1");
103
- define ("S2MEMBER_PAYPAL_ENDPOINT", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"));
104
- define ("S2MEMBER_PAYPAL_BUSINESS", (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]);
105
- /**/
106
- define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0", ((S2MEMBER_CURRENT_USER_SUBSCR_ID) ? "Updating Subscr. ID" : ""));
107
- define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0", ((S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) ? S2MEMBER_CURRENT_USER_SUBSCR_ID : ""));
 
 
 
108
  /**/
109
  do_action ("ws_plugin__s2member_after_constants", get_defined_vars ());
110
  /**/
@@ -133,7 +136,7 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
133
  $membership_options_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"];
134
  $file_download_limit_exceeded_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"];
135
  /**/
136
- if ($login_welcome_page && $login_welcome_page_cache["page"] === $login_welcome_page && $login_welcome_page_cache["link"] && $login_welcome_page_cache["time"] >= strtotime ("-15 minutes"))
137
  {
138
  $l["login_welcome_page"] = $login_welcome_page_cache["link"];
139
  }
@@ -146,7 +149,7 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
146
  $cache_needs_updating = true;
147
  }
148
  /**/
149
- if ($membership_options_page && $membership_options_page_cache["page"] === $membership_options_page && $membership_options_page_cache["link"] && $membership_options_page_cache["time"] >= strtotime ("-15 minutes"))
150
  {
151
  $l["membership_options_page"] = $membership_options_page_cache["link"];
152
  }
@@ -159,7 +162,7 @@ if (!function_exists ("ws_plugin__s2member_constant_links"))
159
  $cache_needs_updating = true;
160
  }
161
  /**/
162
- if ($file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["page"] === $file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["link"] && $file_download_limit_exceeded_page_cache["time"] >= strtotime ("-15 minutes"))
163
  {
164
  $l["file_download_limit_exceeded_page"] = $file_download_limit_exceeded_page_cache["link"];
165
  }
40
  do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
41
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
42
  /**/
43
+ define ("S2MEMBER_VERSION", ($c[] = WS_PLUGIN__S2MEMBER_VERSION)); /* Available since 3.0. */
44
+ /**/
45
+ define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN", ($c[] = (($current_user) ? true : false)));
46
+ define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER", ($c[] = (($current_user && $level >= 1) ? true : false)));
47
+ define ("S2MEMBER_CURRENT_USER_ACCESS_LEVEL", ($c[] = (int)$level));
48
+ define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]));
49
+ define ("S2MEMBER_CURRENT_USER_SUBSCR_ID", ($c[] = (($current_user) ? (($subscr_id) ? (string)$subscr_id : (string)$current_user->ID) : "")));
50
+ define ("S2MEMBER_CURRENT_USER_CUSTOM", ($c[] = (string)$custom));
51
+ define ("S2MEMBER_CURRENT_USER_REGISTRATION_TIME", ($c[] = (($current_user) ? (int)strtotime ($current_user->user_registered) : 0)));
52
+ define ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS", ($c[] = (($current_user) ? (int)floor ((strtotime ("now") - strtotime ($current_user->user_registered)) / 86400) : 0)));
53
+ define ("S2MEMBER_CURRENT_USER_DISPLAY_NAME", ($c[] = (($current_user) ? (string)$current_user->display_name : "")));
54
+ define ("S2MEMBER_CURRENT_USER_FIRST_NAME", ($c[] = (($current_user) ? (string)$current_user->first_name : "")));
55
+ define ("S2MEMBER_CURRENT_USER_LAST_NAME", ($c[] = (($current_user) ? (string)$current_user->last_name : "")));
56
+ define ("S2MEMBER_CURRENT_USER_LOGIN", ($c[] = (($current_user) ? (string)$current_user->user_login : "")));
57
+ define ("S2MEMBER_CURRENT_USER_EMAIL", ($c[] = (($current_user) ? (string)$current_user->user_email : "")));
58
+ define ("S2MEMBER_CURRENT_USER_IP", ($c[] = (string)$_SERVER["REMOTE_ADDR"]));
59
+ define ("S2MEMBER_CURRENT_USER_ID", ($c[] = (($current_user) ? (int)$current_user->ID : 0)));
60
+ define ("S2MEMBER_CURRENT_USER_FIELDS", ($c[] = (($current_user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "email" => S2MEMBER_CURRENT_USER_EMAIL, "login" => S2MEMBER_CURRENT_USER_LOGIN, "first_name" => S2MEMBER_CURRENT_USER_FIRST_NAME, "last_name" => S2MEMBER_CURRENT_USER_LAST_NAME, "display_name" => S2MEMBER_CURRENT_USER_DISPLAY_NAME, "subscr_id" => S2MEMBER_CURRENT_USER_SUBSCR_ID, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ()))));
61
+ /**/
62
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED", ($c[] = (int)$file_downloads["allowed"]));
63
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED", ($c[] = (($file_downloads["allowed"] >= 999999999) ? true : false)));
64
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY", ($c[] = (int)$file_downloads["currently"]));
65
+ define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$file_downloads["allowed_days"]));
66
+ /**/
67
+ define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]));
68
+ define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]));
69
+ define ("S2MEMBER_LOGIN_WELCOME_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
70
+ /**/
71
+ define ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL", ($c[] = get_bloginfo ("wpurl") . "/?s2member_profile=1"));
72
+ define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL", ($c[] = (string)$links["file_download_limit_exceeded_page"]));
73
+ define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL", ($c[] = (string)$links["membership_options_page"]));
74
+ define ("S2MEMBER_LOGIN_WELCOME_PAGE_URL", ($c[] = (($login_redirection_override) ? (string)$login_redirection_override : (string)$links["login_welcome_page"])));
75
+ define ("S2MEMBER_LOGOUT_PAGE_URL", ($c[] = (string)wp_logout_url ()));
76
+ define ("S2MEMBER_LOGIN_PAGE_URL", ($c[] = (string)wp_login_url ()));
77
+ /**/
78
+ define ("S2MEMBER_LEVEL0_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]));
79
+ define ("S2MEMBER_LEVEL1_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"]));
80
+ define ("S2MEMBER_LEVEL2_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]));
81
+ define ("S2MEMBER_LEVEL3_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]));
82
+ define ("S2MEMBER_LEVEL4_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]));
83
+ /**/
84
+ define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed"]));
85
+ define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed"]));
86
+ define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed"]));
87
+ define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed"]));
88
+ define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed"]));
89
+ /**/
90
+ define ("S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed_days"]));
91
+ define ("S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed_days"]));
92
+ define ("S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed_days"]));
93
+ define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed_days"]));
94
+ define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"]));
95
+ /**/
96
+ define ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]));
97
+ /**/
98
+ define ("S2MEMBER_REG_EMAIL_FROM_NAME", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]));
99
+ define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]));
100
+ /**/
101
+ define ("S2MEMBER_PAYPAL_NOTIFY_URL", ($c[] = get_bloginfo ("wpurl") . "/?s2member_paypal_notify=1"));
102
+ define ("S2MEMBER_PAYPAL_RETURN_URL", ($c[] = get_bloginfo ("wpurl") . "/?s2member_paypal_return=1"));
103
+ define ("S2MEMBER_PAYPAL_ENDPOINT", ($c[] = (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")));
104
+ define ("S2MEMBER_PAYPAL_BUSINESS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]));
105
+ /**/
106
+ define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0", ($c[] = ((S2MEMBER_CURRENT_USER_SUBSCR_ID) ? "Updating Subscr. ID" : "")));
107
+ define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0", ($c[] = ((S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) ? S2MEMBER_CURRENT_USER_SUBSCR_ID : "")));
108
+ /**/
109
+ define ("WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5", md5 (serialize ($c))); /* Used as a Checksum against the state of these Constants. */
110
+ /* ^This particular Constant will NOT be included as part of the official API. It is ONLY used internally by s2Member for optimizations. */
111
  /**/
112
  do_action ("ws_plugin__s2member_after_constants", get_defined_vars ());
113
  /**/
136
  $membership_options_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"];
137
  $file_download_limit_exceeded_page_cache = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"];
138
  /**/
139
+ if ($login_welcome_page_cache["page"] === $login_welcome_page && $login_welcome_page_cache["time"] >= strtotime ("-15 minutes"))
140
  {
141
  $l["login_welcome_page"] = $login_welcome_page_cache["link"];
142
  }
149
  $cache_needs_updating = true;
150
  }
151
  /**/
152
+ if ($membership_options_page_cache["page"] === $membership_options_page && $membership_options_page_cache["time"] >= strtotime ("-15 minutes"))
153
  {
154
  $l["membership_options_page"] = $membership_options_page_cache["link"];
155
  }
162
  $cache_needs_updating = true;
163
  }
164
  /**/
165
+ if ($file_download_limit_exceeded_page_cache["page"] === $file_download_limit_exceeded_page && $file_download_limit_exceeded_page_cache["time"] >= strtotime ("-15 minutes"))
166
  {
167
  $l["file_download_limit_exceeded_page"] = $file_download_limit_exceeded_page_cache["link"];
168
  }
includes/functions/css-js-w-globals.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  Function adds styles to the header.
18
  Do NOT enqueue styles in the admin area.
@@ -48,16 +48,16 @@ if (!function_exists ("ws_plugin__s2member_css"))
48
  /**/
49
  if ($_GET["ws_plugin__s2member_css"])
50
  {
51
- header("Content-Type: text/css; charset=utf-8");
52
- header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
53
- header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
54
- header("Cache-Control: max-age=604800");
55
- header("Pragma: public");
56
  /**/
57
  $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
58
  $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
59
  /**/
60
- ob_start("ws_plugin__s2member_compress_css"); /* Compress. */
61
  /**/
62
  include_once dirname (dirname (__FILE__)) . "/s2member.css";
63
  /**/
@@ -84,16 +84,8 @@ if (!function_exists ("ws_plugin__s2member_add_js_w_globals"))
84
  {
85
  if (is_user_logged_in ())
86
  {
87
- $a = get_defined_constants (true);
88
- $c = (array)$a["user"];
89
- unset($a);
90
- /**/
91
- foreach ($c as $k => $v)
92
- if (preg_match ("/^S2MEMBER_/i", $k))
93
- $s2member[$k] = $v;
94
- /**/
95
- $md5 = md5 (serialize ($s2member)); /* This is a hash based on the global key => values. */
96
- /* The md5 hash allows the script to be cached in the browser until the globals happen to change. */
97
  /* For instance, the global variables may change when a User who is logged-in changes their Profile. */
98
  wp_enqueue_script ("ws-plugin--s2member", get_bloginfo ("wpurl") . "/?ws_plugin__s2member_js_w_globals=1&qcABC=1&" . $md5, array ("jquery"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
99
  }
@@ -122,11 +114,11 @@ if (!function_exists ("ws_plugin__s2member_js_w_globals"))
122
  /**/
123
  if ($_GET["ws_plugin__s2member_js_w_globals"])
124
  {
125
- header("Content-Type: text/javascript; charset=utf-8");
126
- header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
127
- header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
128
- header("Cache-Control: max-age=604800");
129
- header("Pragma: public");
130
  /**/
131
  $g = "var S2MEMBER_VERSION = '" . ws_plugin__s2member_esc_sq (S2MEMBER_VERSION) . "',"; /* Since 3.0. */
132
  /**/
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  Function adds styles to the header.
18
  Do NOT enqueue styles in the admin area.
48
  /**/
49
  if ($_GET["ws_plugin__s2member_css"])
50
  {
51
+ header ("Content-Type: text/css; charset=utf-8");
52
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
53
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
54
+ header ("Cache-Control: max-age=604800");
55
+ header ("Pragma: public");
56
  /**/
57
  $u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"];
58
  $i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images";
59
  /**/
60
+ ob_start ("ws_plugin__s2member_compress_css"); /* Compress. */
61
  /**/
62
  include_once dirname (dirname (__FILE__)) . "/s2member.css";
63
  /**/
84
  {
85
  if (is_user_logged_in ())
86
  {
87
+ $md5 = WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5; /* An MD5 hash based on global key => values. */
88
+ /* The MD5 hash allows the script to be cached in the browser until the globals happen to change. */
 
 
 
 
 
 
 
 
89
  /* For instance, the global variables may change when a User who is logged-in changes their Profile. */
90
  wp_enqueue_script ("ws-plugin--s2member", get_bloginfo ("wpurl") . "/?ws_plugin__s2member_js_w_globals=1&qcABC=1&" . $md5, array ("jquery"), $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["options_version"] . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["filemtime"]);
91
  }
114
  /**/
115
  if ($_GET["ws_plugin__s2member_js_w_globals"])
116
  {
117
+ header ("Content-Type: text/javascript; charset=utf-8");
118
+ header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT");
119
+ header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
120
+ header ("Cache-Control: max-age=604800");
121
+ header ("Pragma: public");
122
  /**/
123
  $g = "var S2MEMBER_VERSION = '" . ws_plugin__s2member_esc_sq (S2MEMBER_VERSION) . "',"; /* Since 3.0. */
124
  /**/
includes/functions/paypal-button.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  Function that handles the Shortcode for [s2Member-PayPal-Button /].
18
  Attach to: add_shortcode("s2Member-PayPal-Button");
@@ -29,12 +29,11 @@ if (!function_exists ("ws_plugin__s2member_sc_paypal_button"))
29
  {
30
  function ws_plugin__s2member_sc_paypal_button ($attr = FALSE, $content = FALSE, $shortcode = FALSE)
31
  {
32
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
33
  do_action ("ws_plugin__s2member_before_sc_paypal_button", get_defined_vars ());
34
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
35
  /**/
36
- $attr = ws_plugin__s2member_trim_quot_deep ($attr); /* Fix &quot; in Shortcode attrs
37
- that have been corrupted by a non-default visual editor; ( i.e. CKEditor does this ). */
38
  /**/
39
  $attr["tt"] = strtoupper ($attr["tt"]); /* Term lengths absolutely must be provided in upper-case format. */
40
  $attr["rt"] = strtoupper ($attr["rt"]); /* Term lengths absolutely must be provided in upper-case format. */
@@ -49,7 +48,7 @@ if (!function_exists ("ws_plugin__s2member_sc_paypal_button"))
49
  /**/
50
  $attr = shortcode_atts (array ("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "ps" => "paypal", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default"), $attr);
51
  /**/
52
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
53
  do_action ("ws_plugin__s2member_before_sc_paypal_button_after_shortcode_atts", get_defined_vars ());
54
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
55
  /**/
@@ -61,7 +60,7 @@ if (!function_exists ("ws_plugin__s2member_sc_paypal_button"))
61
  /**/
62
  $code = ($attr["image"] && $attr["image"] !== "default") ? preg_replace ('/ src\="(.*?)"/', ' src="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["image"])) . '"', $code) : $code;
63
  /**/
64
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
65
  do_action ("ws_plugin__s2member_during_sc_paypal_cancellation_button", get_defined_vars ());
66
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
67
  }
@@ -87,7 +86,7 @@ if (!function_exists ("ws_plugin__s2member_sc_paypal_button"))
87
  /**/
88
  $code = ($attr["image"] && $attr["image"] !== "default") ? preg_replace ('/ src\="(.*?)"/', ' src="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["image"])) . '"', $code) : $code;
89
  /**/
90
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
91
  do_action ("ws_plugin__s2member_during_sc_paypal_sp_button", get_defined_vars ());
92
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
93
  }
@@ -133,7 +132,7 @@ if (!function_exists ("ws_plugin__s2member_sc_paypal_button"))
133
  /**/
134
  $code = ($attr["image"] && $attr["image"] !== "default") ? preg_replace ('/ src\="(.*?)"/', ' src="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["image"])) . '"', $code) : $code;
135
  /**/
136
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
137
  ($attr["modify"]) ? do_action ("ws_plugin__s2member_during_sc_paypal_modification_button", get_defined_vars ()) : do_action ("ws_plugin__s2member_during_sc_paypal_button", get_defined_vars ());
138
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
139
  }
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  Function that handles the Shortcode for [s2Member-PayPal-Button /].
18
  Attach to: add_shortcode("s2Member-PayPal-Button");
29
  {
30
  function ws_plugin__s2member_sc_paypal_button ($attr = FALSE, $content = FALSE, $shortcode = FALSE)
31
  {
32
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
33
  do_action ("ws_plugin__s2member_before_sc_paypal_button", get_defined_vars ());
34
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
35
  /**/
36
+ $attr = ws_plugin__s2member_trim_quot_deep ((array)$attr); /* Force array, and fix &quot; in attrs. */
 
37
  /**/
38
  $attr["tt"] = strtoupper ($attr["tt"]); /* Term lengths absolutely must be provided in upper-case format. */
39
  $attr["rt"] = strtoupper ($attr["rt"]); /* Term lengths absolutely must be provided in upper-case format. */
48
  /**/
49
  $attr = shortcode_atts (array ("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "ps" => "paypal", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default"), $attr);
50
  /**/
51
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
52
  do_action ("ws_plugin__s2member_before_sc_paypal_button_after_shortcode_atts", get_defined_vars ());
53
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
54
  /**/
60
  /**/
61
  $code = ($attr["image"] && $attr["image"] !== "default") ? preg_replace ('/ src\="(.*?)"/', ' src="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["image"])) . '"', $code) : $code;
62
  /**/
63
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
64
  do_action ("ws_plugin__s2member_during_sc_paypal_cancellation_button", get_defined_vars ());
65
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
66
  }
86
  /**/
87
  $code = ($attr["image"] && $attr["image"] !== "default") ? preg_replace ('/ src\="(.*?)"/', ' src="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["image"])) . '"', $code) : $code;
88
  /**/
89
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
90
  do_action ("ws_plugin__s2member_during_sc_paypal_sp_button", get_defined_vars ());
91
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
92
  }
132
  /**/
133
  $code = ($attr["image"] && $attr["image"] !== "default") ? preg_replace ('/ src\="(.*?)"/', ' src="' . ws_plugin__s2member_esc_ds (esc_attr ($attr["image"])) . '"', $code) : $code;
134
  /**/
135
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
136
  ($attr["modify"]) ? do_action ("ws_plugin__s2member_during_sc_paypal_modification_button", get_defined_vars ()) : do_action ("ws_plugin__s2member_during_sc_paypal_button", get_defined_vars ());
137
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
138
  }
includes/functions/paypal-notify.inc.php CHANGED
@@ -227,6 +227,46 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
227
  $paypal["s2member_log"][] = "Specific Post/Page Access Notification URLs have been processed.";
228
  }
229
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  if ($processing && ($url = $paypal["proxy_return_url"])) /* A proxy is requesting a return URL for this transaction? */
231
  {
232
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%sp_access_url%%/i", ws_plugin__s2member_esc_ds (rawurlencode ($sp_access_url)), $url)))
@@ -445,6 +485,48 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
445
  $paypal["s2member_log"][] = "Signup Notification URLs have been processed.";
446
  }
447
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
448
  if ($processing && ($code = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"]) && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
449
  {
450
  if (($code = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $code)) && ($code = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $code)))
@@ -511,6 +593,47 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
511
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
512
  }
513
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
515
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
516
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -662,6 +785,47 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
662
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
663
  }
664
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
666
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
667
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -751,7 +915,60 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
751
  }
752
  else
753
  {
754
- $paypal["s2member_log"][] = "Ignoring Cancellation. An Auto-EOT Time is already set for this Member.";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
755
  }
756
  }
757
  else
@@ -822,20 +1039,57 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
822
  /**/
823
  if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
824
  {
825
- foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle eot notifications. */
826
  /**/
827
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
828
  if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
829
  if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
830
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
831
- if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
832
- /**/
833
- if (($url = trim ($url))) /* Empty? */
834
- ws_plugin__s2member_remote ($url);
 
835
  /**/
836
  $paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
837
  }
838
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
839
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
840
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
841
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
@@ -931,6 +1185,47 @@ if (!function_exists ("ws_plugin__s2member_paypal_notify"))
931
  $paypal["s2member_log"][] = "Refund/Reversal Notification URLs have been processed.";
932
  }
933
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
934
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
935
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
936
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
227
  $paypal["s2member_log"][] = "Specific Post/Page Access Notification URLs have been processed.";
228
  }
229
  /**/
230
+ if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_notification_recipients"])
231
+ {
232
+ $msg = $sbj = "( s2Member / API Notification Email ) - Specific Post/Page Access";
233
+ $msg .= "\n\n"; /* Spacing in the message body. */
234
+ $msg .= "sp_access_url: %%sp_access_url%%\n";
235
+ $msg .= "sp_access_exp: %%sp_access_exp%%\n";
236
+ $msg .= "amount: %%amount%%\n";
237
+ $msg .= "txn_id: %%txn_id%%\n";
238
+ $msg .= "item_number: %%item_number%%\n";
239
+ $msg .= "item_name: %%item_name%%\n";
240
+ $msg .= "first_name: %%first_name%%\n";
241
+ $msg .= "last_name: %%last_name%%\n";
242
+ $msg .= "full_name: %%full_name%%\n";
243
+ $msg .= "payer_email: %%payer_email%%\n";
244
+ $msg .= "cv0: %%cv0%%\n";
245
+ $msg .= "cv1: %%cv1%%\n";
246
+ $msg .= "cv2: %%cv2%%\n";
247
+ $msg .= "cv3: %%cv3%%\n";
248
+ $msg .= "cv4: %%cv4%%\n";
249
+ $msg .= "cv5: %%cv5%%\n";
250
+ $msg .= "cv6: %%cv6%%\n";
251
+ $msg .= "cv7: %%cv7%%\n";
252
+ $msg .= "cv8: %%cv8%%\n";
253
+ $msg .= "cv9: %%cv9%%";
254
+ /**/
255
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%sp_access_url%%/i", ws_plugin__s2member_esc_ds ($sp_access_url), $msg)))
256
+ if (($msg = preg_replace ("/%%sp_access_exp%%/i", ws_plugin__s2member_esc_ds (ws_plugin__s2member_approx_time_difference (time (), strtotime ("+" . $paypal["hours"] . " hours"))), $msg)))
257
+ if (($msg = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $msg)) && ($msg = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $msg)))
258
+ if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
259
+ if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
260
+ if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
261
+ if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
262
+ /**/
263
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_notification_recipients"])) as $recipient)
264
+ /**/
265
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_sp_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
266
+ /**/
267
+ $paypal["s2member_log"][] = "Specific Post/Page Access Notification Emails have been processed.";
268
+ }
269
+ /**/
270
  if ($processing && ($url = $paypal["proxy_return_url"])) /* A proxy is requesting a return URL for this transaction? */
271
  {
272
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%sp_access_url%%/i", ws_plugin__s2member_esc_ds (rawurlencode ($sp_access_url)), $url)))
485
  $paypal["s2member_log"][] = "Signup Notification URLs have been processed.";
486
  }
487
  /**/
488
+ if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
489
+ {
490
+ $msg = $sbj = "( s2Member / API Notification Email ) - Signup";
491
+ $msg .= "\n\n"; /* Spacing in the message body. */
492
+ $msg .= "subscr_id: %%subscr_id%%\n";
493
+ $msg .= "initial: %%initial%%\n";
494
+ $msg .= "regular: %%regular%%\n";
495
+ $msg .= "recurring: %%recurring%%\n";
496
+ $msg .= "initial_term: %%initial_term%%\n";
497
+ $msg .= "regular_term: %%regular_term%%\n";
498
+ $msg .= "item_number: %%item_number%%\n";
499
+ $msg .= "item_name: %%item_name%%\n";
500
+ $msg .= "first_name: %%first_name%%\n";
501
+ $msg .= "last_name: %%last_name%%\n";
502
+ $msg .= "full_name: %%full_name%%\n";
503
+ $msg .= "payer_email: %%payer_email%%\n";
504
+ $msg .= "cv0: %%cv0%%\n";
505
+ $msg .= "cv1: %%cv1%%\n";
506
+ $msg .= "cv2: %%cv2%%\n";
507
+ $msg .= "cv3: %%cv3%%\n";
508
+ $msg .= "cv4: %%cv4%%\n";
509
+ $msg .= "cv5: %%cv5%%\n";
510
+ $msg .= "cv6: %%cv6%%\n";
511
+ $msg .= "cv7: %%cv7%%\n";
512
+ $msg .= "cv8: %%cv8%%\n";
513
+ $msg .= "cv9: %%cv9%%";
514
+ /**/
515
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)))
516
+ if (($msg = preg_replace ("/%%initial%%/i", ws_plugin__s2member_esc_ds ($paypal["initial"]), $msg)) && ($msg = preg_replace ("/%%regular%%/i", ws_plugin__s2member_esc_ds ($paypal["regular"]), $msg)) && ($msg = preg_replace ("/%%recurring%%/i", ws_plugin__s2member_esc_ds ($paypal["recurring"]), $msg)))
517
+ if (($msg = preg_replace ("/%%initial_term%%/i", ws_plugin__s2member_esc_ds ($paypal["initial_term"]), $msg)) && ($msg = preg_replace ("/%%regular_term%%/i", ws_plugin__s2member_esc_ds ($paypal["regular_term"]), $msg)))
518
+ if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
519
+ if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
520
+ if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
521
+ if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
522
+ /**/
523
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_notification_recipients"])) as $recipient)
524
+ /**/
525
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_signup_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
526
+ /**/
527
+ $paypal["s2member_log"][] = "Signup Notification Emails have been processed.";
528
+ }
529
+ /**/
530
  if ($processing && ($code = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"]) && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
531
  {
532
  if (($code = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $code)) && ($code = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $code)))
593
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
594
  }
595
  /**/
596
+ if ($processing && preg_match ("/^web_accept$/i", $paypal["txn_type"]) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
597
+ {
598
+ $msg = $sbj = "( s2Member / API Notification Email ) - Payment";
599
+ $msg .= "\n\n"; /* Spacing in the message body. */
600
+ $msg .= "subscr_id: %%subscr_id%%\n";
601
+ $msg .= "subscr_payment: %%subscr_payment%%\n";
602
+ $msg .= "subscr_payment_user_id: %%subscr_payment_user_id%%\n";
603
+ $msg .= "amount: %%amount%%\n";
604
+ $msg .= "txn_id: %%txn_id%%\n";
605
+ $msg .= "item_number: %%item_number%%\n";
606
+ $msg .= "item_name: %%item_name%%\n";
607
+ $msg .= "first_name: %%first_name%%\n";
608
+ $msg .= "last_name: %%last_name%%\n";
609
+ $msg .= "full_name: %%full_name%%\n";
610
+ $msg .= "payer_email: %%payer_email%%\n";
611
+ $msg .= "cv0: %%cv0%%\n";
612
+ $msg .= "cv1: %%cv1%%\n";
613
+ $msg .= "cv2: %%cv2%%\n";
614
+ $msg .= "cv3: %%cv3%%\n";
615
+ $msg .= "cv4: %%cv4%%\n";
616
+ $msg .= "cv5: %%cv5%%\n";
617
+ $msg .= "cv6: %%cv6%%\n";
618
+ $msg .= "cv7: %%cv7%%\n";
619
+ $msg .= "cv8: %%cv8%%\n";
620
+ $msg .= "cv9: %%cv9%%";
621
+ /**/
622
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)))
623
+ if (($msg = preg_replace ("/%%subscr_payment%%/i", ws_plugin__s2member_esc_ds ("0"), $msg)) && ($msg = preg_replace ("/%%subscr_payment_user_id%%/i", ws_plugin__s2member_esc_ds (""), $msg)))
624
+ if (($msg = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $msg)) && ($msg = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $msg)))
625
+ if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
626
+ if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
627
+ if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
628
+ if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
629
+ /**/
630
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_recipients"])) as $recipient)
631
+ /**/
632
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_payment_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
633
+ /**/
634
+ $paypal["s2member_log"][] = "Payment Notification Emails have been processed.";
635
+ }
636
+ /**/
637
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
638
  do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
639
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
785
  $paypal["s2member_log"][] = "Payment Notification URLs have been processed.";
786
  }
787
  /**/
788
+ if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
789
+ {
790
+ $msg = $sbj = "( s2Member / API Notification Email ) - Payment";
791
+ $msg .= "\n\n"; /* Spacing in the message body. */
792
+ $msg .= "subscr_id: %%subscr_id%%\n";
793
+ $msg .= "subscr_payment: %%subscr_payment%%\n";
794
+ $msg .= "subscr_payment_user_id: %%subscr_payment_user_id%%\n";
795
+ $msg .= "amount: %%amount%%\n";
796
+ $msg .= "txn_id: %%txn_id%%\n";
797
+ $msg .= "item_number: %%item_number%%\n";
798
+ $msg .= "item_name: %%item_name%%\n";
799
+ $msg .= "first_name: %%first_name%%\n";
800
+ $msg .= "last_name: %%last_name%%\n";
801
+ $msg .= "full_name: %%full_name%%\n";
802
+ $msg .= "payer_email: %%payer_email%%\n";
803
+ $msg .= "cv0: %%cv0%%\n";
804
+ $msg .= "cv1: %%cv1%%\n";
805
+ $msg .= "cv2: %%cv2%%\n";
806
+ $msg .= "cv3: %%cv3%%\n";
807
+ $msg .= "cv4: %%cv4%%\n";
808
+ $msg .= "cv5: %%cv5%%\n";
809
+ $msg .= "cv6: %%cv6%%\n";
810
+ $msg .= "cv7: %%cv7%%\n";
811
+ $msg .= "cv8: %%cv8%%\n";
812
+ $msg .= "cv9: %%cv9%%";
813
+ /**/
814
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)))
815
+ if (($msg = preg_replace ("/%%subscr_payment%%/i", ws_plugin__s2member_esc_ds ("1"), $msg)) && ($msg = preg_replace ("/%%subscr_payment_user_id%%/i", ws_plugin__s2member_esc_ds ($user_id), $msg)))
816
+ if (($msg = preg_replace ("/%%amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $msg)) && ($msg = preg_replace ("/%%txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["txn_id"]), $msg)))
817
+ if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
818
+ if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
819
+ if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
820
+ if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
821
+ /**/
822
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_recipients"])) as $recipient)
823
+ /**/
824
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_payment_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
825
+ /**/
826
+ $paypal["s2member_log"][] = "Payment Notification Emails have been processed.";
827
+ }
828
+ /**/
829
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
830
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
831
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
915
  }
916
  else
917
  {
918
+ $paypal["s2member_log"][] = "Ignoring Cancellation. An Auto-EOT Time is already set for this Member. An s2Member API Notification will still be processed however.";
919
+ }
920
+ /**/
921
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_urls"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
922
+ {
923
+ foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_urls"]) as $url) /* Handle Cancellation Notifications. */
924
+ /**/
925
+ if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
926
+ if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
927
+ if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
928
+ if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
929
+ if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_login)), $url)))
930
+ if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
931
+ /**/
932
+ if (($url = trim ($url))) /* Empty? */
933
+ ws_plugin__s2member_remote ($url);
934
+ /**/
935
+ $paypal["s2member_log"][] = "Cancellation Notification URLs have been processed.";
936
+ }
937
+ /**/
938
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
939
+ {
940
+ $msg = $sbj = "( s2Member / API Notification Email ) - Cancellation";
941
+ $msg .= "\n\n"; /* Spacing in the message body. */
942
+ $msg .= "subscr_id: %%subscr_id%%\n";
943
+ $msg .= "user_first_name: %%user_first_name%%\n";
944
+ $msg .= "user_last_name: %%user_last_name%%\n";
945
+ $msg .= "user_full_name: %%user_full_name%%\n";
946
+ $msg .= "user_email: %%user_email%%\n";
947
+ $msg .= "user_login: %%user_login%%\n";
948
+ $msg .= "user_id: %%user_id%%\n";
949
+ $msg .= "cv0: %%cv0%%\n";
950
+ $msg .= "cv1: %%cv1%%\n";
951
+ $msg .= "cv2: %%cv2%%\n";
952
+ $msg .= "cv3: %%cv3%%\n";
953
+ $msg .= "cv4: %%cv4%%\n";
954
+ $msg .= "cv5: %%cv5%%\n";
955
+ $msg .= "cv6: %%cv6%%\n";
956
+ $msg .= "cv7: %%cv7%%\n";
957
+ $msg .= "cv8: %%cv8%%\n";
958
+ $msg .= "cv9: %%cv9%%";
959
+ /**/
960
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)))
961
+ if (($msg = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds ($user->first_name), $msg)) && ($msg = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds ($user->last_name), $msg)))
962
+ if (($msg = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (trim ($user->first_name . " " . $user->last_name)), $msg)))
963
+ if (($msg = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds ($user->user_email), $msg)))
964
+ if (($msg = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds ($user->user_login), $msg)))
965
+ if (($msg = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds ($user_id), $msg)))
966
+ /**/
967
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_recipients"])) as $recipient)
968
+ /**/
969
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_cancellation_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
970
+ /**/
971
+ $paypal["s2member_log"][] = "Cancellation Notification Emails have been processed.";
972
  }
973
  }
974
  else
1039
  /**/
1040
  if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
1041
  {
1042
+ foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle EOT Notifications. */
1043
  /**/
1044
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($paypal["subscr_id"])), $url)))
1045
  if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
1046
  if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
1047
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
1048
+ if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_login)), $url)))
1049
+ if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
1050
+ /**/
1051
+ if (($url = trim ($url))) /* Empty? */
1052
+ ws_plugin__s2member_remote ($url);
1053
  /**/
1054
  $paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
1055
  }
1056
  /**/
1057
+ if ($processing && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
1058
+ {
1059
+ $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
1060
+ $msg .= "\n\n"; /* Spacing in the message body. */
1061
+ $msg .= "subscr_id: %%subscr_id%%\n";
1062
+ $msg .= "user_first_name: %%user_first_name%%\n";
1063
+ $msg .= "user_last_name: %%user_last_name%%\n";
1064
+ $msg .= "user_full_name: %%user_full_name%%\n";
1065
+ $msg .= "user_email: %%user_email%%\n";
1066
+ $msg .= "user_login: %%user_login%%\n";
1067
+ $msg .= "user_id: %%user_id%%\n";
1068
+ $msg .= "cv0: %%cv0%%\n";
1069
+ $msg .= "cv1: %%cv1%%\n";
1070
+ $msg .= "cv2: %%cv2%%\n";
1071
+ $msg .= "cv3: %%cv3%%\n";
1072
+ $msg .= "cv4: %%cv4%%\n";
1073
+ $msg .= "cv5: %%cv5%%\n";
1074
+ $msg .= "cv6: %%cv6%%\n";
1075
+ $msg .= "cv7: %%cv7%%\n";
1076
+ $msg .= "cv8: %%cv8%%\n";
1077
+ $msg .= "cv9: %%cv9%%";
1078
+ /**/
1079
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)))
1080
+ if (($msg = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds ($user->first_name), $msg)) && ($msg = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds ($user->last_name), $msg)))
1081
+ if (($msg = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (trim ($user->first_name . " " . $user->last_name)), $msg)))
1082
+ if (($msg = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds ($user->user_email), $msg)))
1083
+ if (($msg = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds ($user->user_login), $msg)))
1084
+ if (($msg = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds ($user_id), $msg)))
1085
+ /**/
1086
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"])) as $recipient)
1087
+ /**/
1088
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_eot_del_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
1089
+ /**/
1090
+ $paypal["s2member_log"][] = "EOT/Deletion Notification Emails have been processed.";
1091
+ }
1092
+ /**/
1093
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
1094
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
1095
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
1185
  $paypal["s2member_log"][] = "Refund/Reversal Notification URLs have been processed.";
1186
  }
1187
  /**/
1188
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ref_rev_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $paypal["custom"])))
1189
+ {
1190
+ $msg = $sbj = "( s2Member / API Notification Email ) - Refund/Reversal";
1191
+ $msg .= "\n\n"; /* Spacing in the message body. */
1192
+ $msg .= "subscr_id: %%subscr_id%%\n";
1193
+ $msg .= "parent_txn_id: %%parent_txn_id%%\n";
1194
+ $msg .= "item_number: %%item_number%%\n";
1195
+ $msg .= "item_name: %%item_name%%\n";
1196
+ $msg .= "-amount: %%-amount%%\n";
1197
+ $msg .= "-fee: %%-fee%%\n";
1198
+ $msg .= "first_name: %%first_name%%\n";
1199
+ $msg .= "last_name: %%last_name%%\n";
1200
+ $msg .= "full_name: %%full_name%%\n";
1201
+ $msg .= "payer_email: %%payer_email%%\n";
1202
+ $msg .= "user_id: %%user_id%%\n";
1203
+ $msg .= "cv0: %%cv0%%\n";
1204
+ $msg .= "cv1: %%cv1%%\n";
1205
+ $msg .= "cv2: %%cv2%%\n";
1206
+ $msg .= "cv3: %%cv3%%\n";
1207
+ $msg .= "cv4: %%cv4%%\n";
1208
+ $msg .= "cv5: %%cv5%%\n";
1209
+ $msg .= "cv6: %%cv6%%\n";
1210
+ $msg .= "cv7: %%cv7%%\n";
1211
+ $msg .= "cv8: %%cv8%%\n";
1212
+ $msg .= "cv9: %%cv9%%";
1213
+ /**/
1214
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($paypal["subscr_id"]), $msg)) && ($msg = preg_replace ("/%%parent_txn_id%%/i", ws_plugin__s2member_esc_ds ($paypal["parent_txn_id"]), $msg)))
1215
+ if (($msg = preg_replace ("/%%item_number%%/i", ws_plugin__s2member_esc_ds ($paypal["item_number"]), $msg)) && ($msg = preg_replace ("/%%item_name%%/i", ws_plugin__s2member_esc_ds ($paypal["item_name"]), $msg)))
1216
+ if (($msg = preg_replace ("/%%-amount%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_gross"]), $msg)) && ($msg = preg_replace ("/%%-fee%%/i", ws_plugin__s2member_esc_ds ($paypal["mc_fee"]), $msg)))
1217
+ if (($msg = preg_replace ("/%%first_name%%/i", ws_plugin__s2member_esc_ds ($paypal["first_name"]), $msg)) && ($msg = preg_replace ("/%%last_name%%/i", ws_plugin__s2member_esc_ds ($paypal["last_name"]), $msg)))
1218
+ if (($msg = preg_replace ("/%%full_name%%/i", ws_plugin__s2member_esc_ds (trim ($paypal["first_name"] . " " . $paypal["last_name"])), $msg)))
1219
+ if (($msg = preg_replace ("/%%payer_email%%/i", ws_plugin__s2member_esc_ds ($paypal["payer_email"]), $msg)))
1220
+ if (($msg = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds ($user_id), $msg)))
1221
+ /**/
1222
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ref_rev_notification_recipients"])) as $recipient)
1223
+ /**/
1224
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_ref_rev_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
1225
+ /**/
1226
+ $paypal["s2member_log"][] = "Refund/Reversal Notification Emails have been processed.";
1227
+ }
1228
+ /**/
1229
  eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
1230
  do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
1231
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
includes/functions/register-access.inc.php CHANGED
@@ -815,6 +815,32 @@ if (!function_exists ("ws_plugin__s2member_register"))
815
  }
816
  }
817
  /*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
818
  Function that adds customs fields to $meta on signup.
819
  Attach to: add_filter("add_signup_meta");
820
 
@@ -831,8 +857,8 @@ if (!function_exists ("ws_plugin__s2member_ms_process_signup_meta"))
831
  do_action ("ws_plugin__s2member_before_ms_process_signup_meta", get_defined_vars ());
832
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
833
  /**/
834
- if (is_multisite ()) /* This event should ONLY be processed with Multisite Networking. */
835
- if ((is_admin () && $pagenow === "user-new.php") || (ws_plugin__s2member_is_multisite_farm () && is_main_site () && preg_match ("/\/wp-signup\.php/", $_SERVER["REQUEST_URI"]) && $_POST["stage"] === "validate-user-signup"))
836
  {
837
  ws_plugin__s2member_email_config (); /* Configures From: header that will be used in notifications. */
838
  /**/
@@ -1285,7 +1311,9 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
1285
  ws_plugin__s2member_process_list_servers ($level, $email, $fname, $lname, $ip, $opt_in);
1286
  /**/
1287
  if ($urls = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"])
 
1288
  foreach (preg_split ("/[\r\n\t]+/", $urls) as $url) /* Notify each of the urls. */
 
1289
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
1290
  if (($url = preg_replace ("/%%role%%/i", ws_plugin__s2member_esc_ds (urlencode ($role)), $url)))
1291
  if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
@@ -1296,10 +1324,52 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
1296
  if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
1297
  if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
1298
  if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
 
1299
  if (($url = trim ($url))) /* Empty? */
1300
  ws_plugin__s2member_remote ($url);
1301
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1302
  if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"])
 
1303
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
1304
  if (($url = preg_replace ("/%%role%%/i", ws_plugin__s2member_esc_ds (urlencode ($role)), $url)))
1305
  if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
@@ -1310,6 +1380,7 @@ if (!function_exists ("ws_plugin__s2member_configure_user_registration"))
1310
  if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
1311
  if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
1312
  if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
 
1313
  if (($url = trim ($url))) /* Empty? ... Otherwise, re-fill. */
1314
  $GLOBALS["ws_plugin__s2member_registration_return_url"] = $url;
1315
  /**/
815
  }
816
  }
817
  /*
818
+ Function that adds hidden fields to POST vars on signup.
819
+ Attach to: add_filter("signup_hidden_fields");
820
+
821
+ This can ONLY be fired through wp-signup.php on the front-side.
822
+ */
823
+ if (!function_exists ("ws_plugin__s2member_ms_process_signup_hidden_fields"))
824
+ {
825
+ function ws_plugin__s2member_ms_process_signup_hidden_fields ()
826
+ {
827
+ do_action ("ws_plugin__s2member_before_ms_process_signup_hidden_fields", get_defined_vars ());
828
+ /**/
829
+ if (is_multisite ()) /* This event should ONLY be processed with Multisite Networking, on a Blog Farm. */
830
+ if (ws_plugin__s2member_is_multisite_farm () && is_main_site () && preg_match ("/\/wp-signup\.php/", $_SERVER["REQUEST_URI"]) && $_POST["stage"] === "validate-user-signup")
831
+ {
832
+ foreach ((array)ws_plugin__s2member_trim_deep (stripslashes_deep ($_POST)) as $key => $value)
833
+ if (preg_match ("/^ws_plugin__s2member_(custom_reg_field|user_new)_/", $key))
834
+ if ($key = preg_replace ("/_user_new_/", "_custom_reg_field_", $key))
835
+ echo '<input type="hidden" name="' . esc_attr ($key) . '" value="' . esc_attr ($value) . '" />' . "\n";
836
+ /**/
837
+ do_action ("ws_plugin__s2member_during_ms_process_signup_hidden_fields", get_defined_vars ());
838
+ }
839
+ /**/
840
+ do_action ("ws_plugin__s2member_after_ms_process_signup_hidden_fields", get_defined_vars ());
841
+ }
842
+ }
843
+ /*
844
  Function that adds customs fields to $meta on signup.
845
  Attach to: add_filter("add_signup_meta");
846
 
857
  do_action ("ws_plugin__s2member_before_ms_process_signup_meta", get_defined_vars ());
858
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
859
  /**/
860
+ if (is_multisite ()) /* This event should ONLY be processed with Multisite Networking. Either in the admin, or on a Blog Farm through wp-signup.php. */
861
+ if ((is_admin () && $pagenow === "user-new.php") || (ws_plugin__s2member_is_multisite_farm () && is_main_site () && preg_match ("/\/wp-signup\.php/", $_SERVER["REQUEST_URI"]) && preg_match ("/^validate-(user|blog)-signup$/", $_POST["stage"])))
862
  {
863
  ws_plugin__s2member_email_config (); /* Configures From: header that will be used in notifications. */
864
  /**/
1311
  ws_plugin__s2member_process_list_servers ($level, $email, $fname, $lname, $ip, $opt_in);
1312
  /**/
1313
  if ($urls = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"])
1314
+ /**/
1315
  foreach (preg_split ("/[\r\n\t]+/", $urls) as $url) /* Notify each of the urls. */
1316
+ /**/
1317
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
1318
  if (($url = preg_replace ("/%%role%%/i", ws_plugin__s2member_esc_ds (urlencode ($role)), $url)))
1319
  if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
1324
  if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
1325
  if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
1326
  if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
1327
+ /**/
1328
  if (($url = trim ($url))) /* Empty? */
1329
  ws_plugin__s2member_remote ($url);
1330
  /**/
1331
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"])
1332
+ {
1333
+ $msg = $sbj = "( s2Member / API Notification Email ) - Registration";
1334
+ $msg .= "\n\n"; /* Spacing in the message body. */
1335
+ $msg .= "role: %%role%%\n";
1336
+ $msg .= "level: %%level%%\n";
1337
+ $msg .= "user_first_name: %%user_first_name%%\n";
1338
+ $msg .= "user_last_name: %%user_last_name%%\n";
1339
+ $msg .= "user_full_name: %%user_full_name%%\n";
1340
+ $msg .= "user_email: %%user_email%%\n";
1341
+ $msg .= "user_login: %%user_login%%\n";
1342
+ $msg .= "user_pass: %%user_pass%%\n";
1343
+ $msg .= "user_id: %%user_id%%\n";
1344
+ $msg .= "cv0: %%cv0%%\n";
1345
+ $msg .= "cv1: %%cv1%%\n";
1346
+ $msg .= "cv2: %%cv2%%\n";
1347
+ $msg .= "cv3: %%cv3%%\n";
1348
+ $msg .= "cv4: %%cv4%%\n";
1349
+ $msg .= "cv5: %%cv5%%\n";
1350
+ $msg .= "cv6: %%cv6%%\n";
1351
+ $msg .= "cv7: %%cv7%%\n";
1352
+ $msg .= "cv8: %%cv8%%\n";
1353
+ $msg .= "cv9: %%cv9%%";
1354
+ /**/
1355
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)))
1356
+ if (($msg = preg_replace ("/%%role%%/i", ws_plugin__s2member_esc_ds ($role), $msg)))
1357
+ if (($msg = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds ($level), $msg)))
1358
+ if (($msg = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds ($fname), $msg)))
1359
+ if (($msg = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds ($lname), $msg)))
1360
+ if (($msg = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds ($name), $msg)))
1361
+ if (($msg = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds ($email), $msg)))
1362
+ if (($msg = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds ($login), $msg)))
1363
+ if (($msg = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds ($pass), $msg)))
1364
+ if (($msg = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds ($user_id), $msg)))
1365
+ /**/
1366
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"])) as $recipient)
1367
+ /**/
1368
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_registration_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
1369
+ }
1370
+ /**/
1371
  if ($url = $GLOBALS["ws_plugin__s2member_registration_return_url"])
1372
+ /**/
1373
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
1374
  if (($url = preg_replace ("/%%role%%/i", ws_plugin__s2member_esc_ds (urlencode ($role)), $url)))
1375
  if (($url = preg_replace ("/%%level%%/i", ws_plugin__s2member_esc_ds (urlencode ($level)), $url)))
1380
  if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($login)), $url)))
1381
  if (($url = preg_replace ("/%%user_pass%%/i", ws_plugin__s2member_esc_ds (urlencode ($pass)), $url)))
1382
  if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
1383
+ /**/
1384
  if (($url = trim ($url))) /* Empty? ... Otherwise, re-fill. */
1385
  $GLOBALS["ws_plugin__s2member_registration_return_url"] = $url;
1386
  /**/
includes/functions/sc-get-details.inc.php CHANGED
@@ -14,7 +14,7 @@ Direct access denial.
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit("Do not access this file directly.");
16
  /*
17
- Function that handles the Shortcode for [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" user_option="s2member_subscr_id" /].
18
  Attach to: add_shortcode("s2Get");
19
  */
20
  if (!function_exists ("ws_plugin__s2member_sc_get_details"))
@@ -28,10 +28,9 @@ if (!function_exists ("ws_plugin__s2member_sc_get_details"))
28
  do_action ("ws_plugin__s2member_before_sc_get_details", get_defined_vars ());
29
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
30
  /**/
31
- $attr = ws_plugin__s2member_trim_quot_deep ($attr); /* Fix &quot; in Shortcode attrs
32
- that have been corrupted by a non-default visual editor; ( i.e. CKEditor does this ). */
33
  /**/
34
- $attr = shortcode_atts (array ("constant" => "", "custom_field" => "", "user_option" => ""), $attr);
35
  /**/
36
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
37
  do_action ("ws_plugin__s2member_before_sc_get_details_after_shortcode_atts", get_defined_vars ());
@@ -43,23 +42,23 @@ if (!function_exists ("ws_plugin__s2member_sc_get_details"))
43
  $get = constant ($attr["constant"]);
44
  }
45
  /**/
46
- else if ($attr["custom_field"] && $current_user) /* Pull details out of the DB, matching a Custom Field being requested. */
47
  {
48
- if (preg_match ("/^(first_name|First Name)$/i", $attr["custom_field"]))
49
  $get = $current_user->first_name;
50
  /**/
51
- else if (preg_match ("/^(last_name|Last Name)$/i", $attr["custom_field"]))
52
  $get = $current_user->last_name;
53
  /**/
54
- else if (preg_match ("/^(email|E-mail|Email Address|E-mail Address)$/i", $attr["custom_field"]))
55
  $get = $current_user->user_email;
56
  /**/
57
- else if (isset ($current_user->$attr["custom_field"]))
58
- $get = $current_user->$attr["custom_field"];
59
  /**/
60
  else /* Otherwise, we assume it's an actual Custom Field. */
61
  {
62
- $field = trim ($attr["custom_field"], "^* \t\n\r\0\x0B");
63
  $field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
64
  /**/
65
  $fields = get_user_option ("s2member_custom_fields");
@@ -68,7 +67,7 @@ if (!function_exists ("ws_plugin__s2member_sc_get_details"))
68
  }
69
  }
70
  /**/
71
- else if ($attr["user_option"] && $current_user) /* Else pull details from meta table. */
72
  $get = get_user_option ($attr["user_option"]);
73
  /**/
74
  return apply_filters ("ws_plugin__s2member_sc_get_details", $get, get_defined_vars ());
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit("Do not access this file directly.");
16
  /*
17
+ Function that handles the Shortcode for [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /].
18
  Attach to: add_shortcode("s2Get");
19
  */
20
  if (!function_exists ("ws_plugin__s2member_sc_get_details"))
28
  do_action ("ws_plugin__s2member_before_sc_get_details", get_defined_vars ());
29
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
30
  /**/
31
+ $attr = ws_plugin__s2member_trim_quot_deep ((array)$attr); /* Force array, and fix &quot; in attrs. */
 
32
  /**/
33
+ $attr = shortcode_atts (array ("constant" => "", "user_field" => "", "user_option" => ""), $attr);
34
  /**/
35
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
36
  do_action ("ws_plugin__s2member_before_sc_get_details_after_shortcode_atts", get_defined_vars ());
42
  $get = constant ($attr["constant"]);
43
  }
44
  /**/
45
+ else if ($attr["user_field"] && $current_user) /* Pull a particular field. */
46
  {
47
+ if (preg_match ("/^(first_name|First Name)$/i", $attr["user_field"]))
48
  $get = $current_user->first_name;
49
  /**/
50
+ else if (preg_match ("/^(last_name|Last Name)$/i", $attr["user_field"]))
51
  $get = $current_user->last_name;
52
  /**/
53
+ else if (preg_match ("/^(email|E-mail|Email Address|E-mail Address)$/i", $attr["user_field"]))
54
  $get = $current_user->user_email;
55
  /**/
56
+ else if (isset ($current_user->$attr["user_field"]))
57
+ $get = $current_user->$attr["user_field"];
58
  /**/
59
  else /* Otherwise, we assume it's an actual Custom Field. */
60
  {
61
+ $field = trim ($attr["user_field"], "^* \t\n\r\0\x0B");
62
  $field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field));
63
  /**/
64
  $fields = get_user_option ("s2member_custom_fields");
67
  }
68
  }
69
  /**/
70
+ else if ($attr["user_option"] && $current_user) /* Here we pull meta options. */
71
  $get = get_user_option ($attr["user_option"]);
72
  /**/
73
  return apply_filters ("ws_plugin__s2member_sc_get_details", $get, get_defined_vars ());
includes/functions/sc-if-conditionals.inc.php ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright: © 2009 WebSharks, Inc. ( coded in the USA )
4
+ <mailto:support@websharks-inc.com> <http://www.websharks-inc.com/>
5
+
6
+ Released under the terms of the GNU General Public License.
7
+ You should have received a copy of the GNU General Public License,
8
+ along with this software. In the main directory, see: /licensing/
9
+ If not, see: <http://www.gnu.org/licenses/>.
10
+ */
11
+ /*
12
+ Direct access denial.
13
+ */
14
+ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit("Do not access this file directly.");
16
+ /*
17
+ Function that handles the Shortcode for [s2If ... simple conditionals][/s2If].
18
+ - These Shortcodes are also safe to use on a Multisite Blog Farm.
19
+
20
+ Attach to: add_shortcode("s2If") + _s2If, __s2If, ___s2If for nesting.
21
+
22
+ Is Multisite Networking enabled? Please keep the following in mind.
23
+ * current_user_can(), will ALWAYS return true for a Super Admin!
24
+ ( this can be confusing when testing conditionals )
25
+
26
+ If you're running a Multisite Blog Farm, you can filter this array:
27
+ ws_plugin__s2member_sc_if_conditionals_blog_farm_safe
28
+ $blog_farm_safe
29
+ */
30
+ if (!function_exists ("ws_plugin__s2member_sc_if_conditionals"))
31
+ {
32
+ function ws_plugin__s2member_sc_if_conditionals ($attr = FALSE, $content = FALSE, $shortcode = FALSE)
33
+ {
34
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
35
+ do_action ("ws_plugin__s2member_before_sc_if_conditionals", get_defined_vars ());
36
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
37
+ /**/
38
+ $attr = ws_plugin__s2member_trim_quot_deep ((array)$attr); /* Force array, and fix &quot; in attrs. */
39
+ /**/
40
+ $blog_farm_safe = apply_filters ("ws_plugin__s2member_sc_if_conditionals_blog_farm_safe", array ("is_user_logged_in", "is_user_not_logged_in", "current_user_is", "current_user_is_not", "current_user_is_for_blog", "current_user_is_not_for_blog", "current_user_can", "current_user_cannot", "current_user_can_for_blog", "current_user_cannot_for_blog", "is_404", "is_home", "is_front_page", "is_singular", "is_single", "is_page", "is_page_template", "is_attachment", "is_feed", "is_archive", "is_search", "is_category", "is_tax", "is_tag", "has_tag", "is_author", "is_date", "is_day", "is_month", "is_time", "is_year", "is_sticky", "is_paged", "is_preview", "in_the_loop", "comments_open", "pings_open", "has_excerpt", "has_post_image"), get_defined_vars ());
41
+ /**/
42
+ foreach ($attr as $attr_key => $attr_value) /* Detects and removes logical attributes. */
43
+ /* It's NOT possible to mix logic. You MUST stick to one type of logic or another. */
44
+ /* If both types of logic are needed, you MUST use two different Shortcodes. */
45
+ if (preg_match ("/^(&&|&amp;&amp;|&#038;&#038;|AND|\|\||OR|[\!\=\<\>]+)$/i", $attr_value))
46
+ { /* Stick with AND/OR. Ampersands are corrupted by the Visual Editor. */
47
+ /**/
48
+ $logicals[] = strtolower ($attr_value); /* Place all logicals into an array here. */
49
+ unset($attr[$attr_key]); /* ^ Detect logic here. We'll use the first key #0. */
50
+ /**/
51
+ if (preg_match ("/^[\!\=\<\>]+$/i", $attr_value)) /* Error on these operators. */
52
+ {
53
+ trigger_error ("s2If, invalid operator [ " . $attr_value . " ]. Simple Conditionals cannot process operators like ( == != <> ). Please use Advanced (PHP) Conditionals instead.", E_USER_ERROR);
54
+ return ""; /* Return now; empty string in this case. */
55
+ }
56
+ }
57
+ /**/
58
+ if (is_array ($logicals) && !empty ($logicals) && count (array_unique ($logicals)) > 1)
59
+ {
60
+ trigger_error ("s2If, AND/OR malformed conditional logic. It's NOT possible to mix logic using AND/OR combinations. You MUST stick to one type of logic or another. If both types of logic are needed, you MUST use two different Shortcode expressions. Or, use Advanced (PHP) Conditionals instead.", E_USER_ERROR);
61
+ return ""; /* Return now; empty string in this case. */
62
+ }
63
+ /**/
64
+ $conditional_logic = (is_array ($logicals) && !empty ($logicals) && preg_match ("/^(\|\||OR)$/i", $logicals[0])) ? "OR" : "AND";
65
+ /**/
66
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
67
+ do_action ("ws_plugin__s2member_before_sc_if_conditionals_after_conditional_logic", get_defined_vars ());
68
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
69
+ /**/
70
+ if ($conditional_logic === "AND") /* This is the AND variation. This routine analyzes conditionals using AND logic ( the default behavior ). */
71
+ {
72
+ foreach ($attr as $attr_value) /* This is the AND variation. This routine analyzes conditionals using AND logic ( the default behavior ). */
73
+ {
74
+ if (preg_match ("/^(\!?)(.+?)(\()(.*?)(\))$/", $attr_value, $m) && ($exclamation = $m[1]) !== "nill" && ($conditional = $m[2]) && ($attr_args = preg_replace ("/[\r\n\t\s ]/", "", $m[4])) !== "nill")
75
+ {
76
+ if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site () || !preg_match ("/[\(\)]/", $attr_args)) /* Disallow functions as arguments on a Multisite Blog Farm. */
77
+ {
78
+ if (is_array ($args = preg_split ("/[;,]+/", $attr_args, 0, PREG_SPLIT_NO_EMPTY))) /* Convert all arguments into an array. And take note; possibly into an empty array. */
79
+ {
80
+ if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site () || in_array (strtolower ($conditional), $blog_farm_safe))
81
+ {
82
+ $test = ($exclamation) ? false : true; /* If !exclamation ( false ) otherwise this defaults to true. */
83
+ /**/
84
+ if (preg_match ("/^\{(.*?)\}$/", $attr_args)) /* Single argument passed as an array. */
85
+ {
86
+ if ($test === true && !call_user_func ($conditional, $args))
87
+ {
88
+ $condition_failed = true;
89
+ break;
90
+ }
91
+ else if ($test === false && call_user_func ($conditional, $args))
92
+ {
93
+ $condition_failed = true;
94
+ break;
95
+ }
96
+ }
97
+ /**/
98
+ else if (empty ($args)) /* No arguments at all. */
99
+ {
100
+ if ($test === true && !call_user_func ($conditional))
101
+ {
102
+ $condition_failed = true;
103
+ break;
104
+ }
105
+ /**/
106
+ else if ($test === false && call_user_func ($conditional))
107
+ {
108
+ $condition_failed = true;
109
+ break;
110
+ }
111
+ }
112
+ /**/
113
+ else if ($test === true && !call_user_func_array ($conditional, $args))
114
+ {
115
+ $condition_failed = true;
116
+ break;
117
+ }
118
+ /**/
119
+ else if ($test === false && call_user_func_array ($conditional, $args))
120
+ {
121
+ $condition_failed = true;
122
+ break;
123
+ }
124
+ }
125
+ else
126
+ {
127
+ trigger_error ("s2If, unsafe conditional function [ " . $attr_value . " ]", E_USER_ERROR);
128
+ return ""; /* Return now; empty string in this case. */
129
+ }
130
+ }
131
+ else
132
+ {
133
+ trigger_error ("s2If, conditional args are NOT an array [ " . $attr_value . " ]", E_USER_ERROR);
134
+ return ""; /* Return now; empty string in this case. */
135
+ }
136
+ }
137
+ else
138
+ {
139
+ trigger_error ("s2If, unsafe conditional args [ " . $attr_value . " ]", E_USER_ERROR);
140
+ return ""; /* Return now; empty string in this case. */
141
+ }
142
+ }
143
+ else
144
+ {
145
+ trigger_error ("s2If, malformed conditional [ " . $attr_value . " ]", E_USER_ERROR);
146
+ return ""; /* Return now; empty string in this case. */
147
+ }
148
+ }
149
+ /* Supports nested Shortcodes. */
150
+ return do_shortcode (apply_filters ("ws_plugin__s2member_sc_if_conditionals", (($condition_failed) ? "" : $content), get_defined_vars ()));
151
+ }
152
+ /**/
153
+ else if ($conditional_logic === "OR") /* This is the OR variation. This routine analyzes conditionals using OR logic, instead of AND logic. */
154
+ {
155
+ foreach ($attr as $attr_value) /* This is the OR variation. This routine analyzes conditionals using OR logic, instead of AND logic. */
156
+ {
157
+ if (preg_match ("/^(\!?)(.+?)(\()(.*?)(\))$/", $attr_value, $m) && ($exclamation = $m[1]) !== "nill" && ($conditional = $m[2]) && ($attr_args = preg_replace ("/[\r\n\t\s ]/", "", $m[4])) !== "nill")
158
+ {
159
+ if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site () || !preg_match ("/[\(\)]/", $attr_args)) /* Disallow functions as arguments on a Multisite Blog Farm. */
160
+ {
161
+ if (is_array ($args = preg_split ("/[;,]+/", $attr_args, 0, PREG_SPLIT_NO_EMPTY))) /* Convert all arguments into an array. And take note; possibly into an empty array. */
162
+ {
163
+ if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site () || in_array (strtolower ($conditional), $blog_farm_safe))
164
+ {
165
+ $test = ($exclamation) ? false : true; /* If !exclamation ( false ) otherwise this defaults to true. */
166
+ /**/
167
+ if (preg_match ("/^\{(.*?)\}$/", $attr_args)) /* Single argument passed as an array. */
168
+ {
169
+ if ($test === true && call_user_func ($conditional, $args))
170
+ {
171
+ $condition_succeeded = true;
172
+ break;
173
+ }
174
+ else if ($test === false && !call_user_func ($conditional, $args))
175
+ {
176
+ $condition_succeeded = true;
177
+ break;
178
+ }
179
+ }
180
+ /**/
181
+ else if (empty ($args)) /* No arguments at all. */
182
+ {
183
+ if ($test === true && call_user_func ($conditional))
184
+ {
185
+ $condition_succeeded = true;
186
+ break;
187
+ }
188
+ /**/
189
+ else if ($test === false && !call_user_func ($conditional))
190
+ {
191
+ $condition_succeeded = true;
192
+ break;
193
+ }
194
+ }
195
+ /**/
196
+ else if ($test === true && call_user_func_array ($conditional, $args))
197
+ {
198
+ $condition_succeeded = true;
199
+ break;
200
+ }
201
+ /**/
202
+ else if ($test === false && !call_user_func_array ($conditional, $args))
203
+ {
204
+ $condition_succeeded = true;
205
+ break;
206
+ }
207
+ }
208
+ else
209
+ {
210
+ trigger_error ("s2If, unsafe conditional function [ " . $attr_value . " ]", E_USER_ERROR);
211
+ return ""; /* Return now; empty string in this case. */
212
+ }
213
+ }
214
+ else
215
+ {
216
+ trigger_error ("s2If, conditional args are NOT an array [ " . $attr_value . " ]", E_USER_ERROR);
217
+ return ""; /* Return now; empty string in this case. */
218
+ }
219
+ }
220
+ else
221
+ {
222
+ trigger_error ("s2If, unsafe conditional args [ " . $attr_value . " ]", E_USER_ERROR);
223
+ return ""; /* Return now; empty string in this case. */
224
+ }
225
+ }
226
+ else
227
+ {
228
+ trigger_error ("s2If, malformed conditional [ " . $attr_value . " ]", E_USER_ERROR);
229
+ return ""; /* Return now; empty string in this case. */
230
+ }
231
+ }
232
+ /* Supports nested Shortcodes. */
233
+ return do_shortcode (apply_filters ("ws_plugin__s2member_sc_if_conditionals", (($condition_succeeded) ? $content : ""), get_defined_vars ()));
234
+ }
235
+ }
236
+ }
237
+ ?>
includes/functions/{sc-conditionals.inc.php → sc-old-conditionals.inc.php} RENAMED
@@ -14,6 +14,11 @@ Direct access denial.
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit("Do not access this file directly.");
16
  /*
 
 
 
 
 
17
  Function that handles the Shortcode for [s2All ... simple conditionals][/s2All].
18
  Function that handles the Shortcode for [s2Any ... simple conditionals][/s2Any].
19
 
@@ -42,12 +47,12 @@ Attach to: add_shortcode("s2Any"), add_shortcode("_s2Any"), add_shortcode("__s2A
42
  [/s2Any]
43
 
44
  */
45
- if (!function_exists ("ws_plugin__s2member_sc_conditionals"))
46
  {
47
- function ws_plugin__s2member_sc_conditionals ($attr = FALSE, $content = FALSE, $shortcode = FALSE)
48
  {
49
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
50
- do_action ("ws_plugin__s2member_before_sc_conditionals", get_defined_vars ());
51
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
52
  /**/
53
  $attr = ws_plugin__s2member_trim_quot_deep ($attr); /* Fix &quot; in Shortcode attrs
@@ -57,7 +62,7 @@ if (!function_exists ("ws_plugin__s2member_sc_conditionals"))
57
  $attr = shortcode_atts (array ("is_user_logged_in" => "", "is_user_not_logged_in" => "", "current_user_is" => "", "current_user_is_not" => "", "current_user_is_for_blog" => "", "current_user_is_not_for_blog" => "", "current_user_can" => "", "current_user_cannot" => "", "current_user_can_for_blog" => "", "current_user_cannot_for_blog" => "", "is_404" => "", "is_home" => "", "is_front_page" => "", "is_singular" => "", "is_single" => "", "is_page" => "", "is_page_template" => "", "is_attachment" => "", "is_feed" => "", "is_archive" => "", "is_search" => "", "is_category" => "", "is_tax" => "", "is_tag" => "", "has_tag" => "", "is_author" => "", "is_date" => "", "is_day" => "", "is_month" => "", "is_time" => "", "is_year" => "", "is_sticky" => "", "is_paged" => "", "is_preview" => "", "in_the_loop" => "", "comments_open" => "", "pings_open" => "", "has_excerpt" => "", "has_post_image" => ""), $attr);
58
  /**/
59
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
60
- do_action ("ws_plugin__s2member_before_sc_conditionals_after_shortcode_atts", get_defined_vars ());
61
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
62
  /**/
63
  if (preg_match ("/^(_*)s2All$/i", $shortcode)) /* This is the AND variation. This routine analyzes conditionals using AND logic, instead of OR. */
@@ -109,7 +114,7 @@ if (!function_exists ("ws_plugin__s2member_sc_conditionals"))
109
  }
110
  }
111
  /* Supports nested Shortcodes. */
112
- return do_shortcode (apply_filters ("ws_plugin__s2member_sc_conditionals", (($condition_failed) ? "" : $content), get_defined_vars ()));
113
  }
114
  /**/
115
  else if (preg_match ("/^(_*)s2Any$/i", $shortcode)) /* This is the OR variation. This routine analyzes conditionals using OR logic, instead of AND. */
@@ -161,7 +166,7 @@ if (!function_exists ("ws_plugin__s2member_sc_conditionals"))
161
  }
162
  }
163
  /* Supports nested Shortcodes. */
164
- return do_shortcode (apply_filters ("ws_plugin__s2member_sc_conditionals", (($condition_succeeded) ? $content : ""), get_defined_vars ()));
165
  }
166
  }
167
  }
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit("Do not access this file directly.");
16
  /*
17
+ The following Shortcodes were deprecated in v3.2.2.
18
+ Going forward, use [s2If] instead ( it's more powerful ).
19
+ @NOTE: These Shortcodes were ONLY available in v3.2.1.
20
+ ~ These WILL all be removed in the next release.
21
+
22
  Function that handles the Shortcode for [s2All ... simple conditionals][/s2All].
23
  Function that handles the Shortcode for [s2Any ... simple conditionals][/s2Any].
24
 
47
  [/s2Any]
48
 
49
  */
50
+ if (!function_exists ("ws_plugin__s2member_sc_old_conditionals"))
51
  {
52
+ function ws_plugin__s2member_sc_old_conditionals ($attr = FALSE, $content = FALSE, $shortcode = FALSE)
53
  {
54
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
55
+ do_action ("ws_plugin__s2member_before_sc_old_conditionals", get_defined_vars ());
56
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
57
  /**/
58
  $attr = ws_plugin__s2member_trim_quot_deep ($attr); /* Fix &quot; in Shortcode attrs
62
  $attr = shortcode_atts (array ("is_user_logged_in" => "", "is_user_not_logged_in" => "", "current_user_is" => "", "current_user_is_not" => "", "current_user_is_for_blog" => "", "current_user_is_not_for_blog" => "", "current_user_can" => "", "current_user_cannot" => "", "current_user_can_for_blog" => "", "current_user_cannot_for_blog" => "", "is_404" => "", "is_home" => "", "is_front_page" => "", "is_singular" => "", "is_single" => "", "is_page" => "", "is_page_template" => "", "is_attachment" => "", "is_feed" => "", "is_archive" => "", "is_search" => "", "is_category" => "", "is_tax" => "", "is_tag" => "", "has_tag" => "", "is_author" => "", "is_date" => "", "is_day" => "", "is_month" => "", "is_time" => "", "is_year" => "", "is_sticky" => "", "is_paged" => "", "is_preview" => "", "in_the_loop" => "", "comments_open" => "", "pings_open" => "", "has_excerpt" => "", "has_post_image" => ""), $attr);
63
  /**/
64
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
65
+ do_action ("ws_plugin__s2member_before_sc_old_conditionals_after_shortcode_atts", get_defined_vars ());
66
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
67
  /**/
68
  if (preg_match ("/^(_*)s2All$/i", $shortcode)) /* This is the AND variation. This routine analyzes conditionals using AND logic, instead of OR. */
114
  }
115
  }
116
  /* Supports nested Shortcodes. */
117
+ return do_shortcode (apply_filters ("ws_plugin__s2member_sc_old_conditionals", (($condition_failed) ? "" : $content), get_defined_vars ()));
118
  }
119
  /**/
120
  else if (preg_match ("/^(_*)s2Any$/i", $shortcode)) /* This is the OR variation. This routine analyzes conditionals using OR logic, instead of AND. */
166
  }
167
  }
168
  /* Supports nested Shortcodes. */
169
+ return do_shortcode (apply_filters ("ws_plugin__s2member_sc_old_conditionals", (($condition_succeeded) ? $content : ""), get_defined_vars ()));
170
  }
171
  }
172
  }
includes/functions/user-deletions.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  Function for handling user deletions.
18
  Attach to: add_action("remove_user_from_blog");
@@ -24,7 +24,7 @@ if (!function_exists ("ws_plugin__s2member_handle_ms_user_deletions"))
24
  static $processed = array (); /* No duplicate processing. */
25
  global $pagenow; /* Need this to detect the current admin page. */
26
  /**/
27
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
28
  do_action ("ws_plugin__s2member_before_handle_ms_user_deletions", get_defined_vars ());
29
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
30
  /**/
@@ -33,19 +33,19 @@ if (!function_exists ("ws_plugin__s2member_handle_ms_user_deletions"))
33
  if (($s2says || (is_admin () && $pagenow === "users.php")) && ($processed[$user_id] = true)) /* If s2Member says, or on users.php. */
34
  /* We don't react on this event globally, because there are many routines that remove Users from a Blog; w/ harmless reasons. */
35
  {
36
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
37
  do_action ("ws_plugin__s2member_during_handle_ms_user_deletions_before", get_defined_vars ());
38
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
39
  /**/
40
- ws_plugin__s2member_handle_user_deletions($user_id); /* Now hand this over. */
41
  /**/
42
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
43
  do_action ("ws_plugin__s2member_during_handle_ms_user_deletions_after", get_defined_vars ());
44
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
45
  }
46
  }
47
  /**/
48
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
49
  do_action ("ws_plugin__s2member_after_handle_ms_user_deletions", get_defined_vars ());
50
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
51
  /**/
@@ -66,7 +66,7 @@ if (!function_exists ("ws_plugin__s2member_handle_user_deletions"))
66
  {
67
  static $processed = array (); /* No duplicate processing. */
68
  /**/
69
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
70
  do_action ("ws_plugin__s2member_before_handle_user_deletions", get_defined_vars ());
71
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
72
  /**/
@@ -87,22 +87,58 @@ if (!function_exists ("ws_plugin__s2member_handle_user_deletions"))
87
  if (is_object ($user = new WP_User ($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
88
  {
89
  foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle EOT Notifications on user deletion. */
 
90
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($subscr_id)), $url)))
91
  if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
92
  if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
93
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
94
- if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
95
- /**/
96
- if (($url = trim ($url))) /* Empty? */
97
- ws_plugin__s2member_remote($url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**/
99
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
100
- do_action ("ws_plugin__s2member_during_handle_user_deletions", get_defined_vars ());
101
- unset ($__refs, $__v); /* Unset defined __refs, __v. */
 
 
 
 
 
 
 
102
  }
 
 
 
 
103
  }
104
  /**/
105
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
106
  do_action ("ws_plugin__s2member_after_handle_user_deletions", get_defined_vars ());
107
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
108
  /**/
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  Function for handling user deletions.
18
  Attach to: add_action("remove_user_from_blog");
24
  static $processed = array (); /* No duplicate processing. */
25
  global $pagenow; /* Need this to detect the current admin page. */
26
  /**/
27
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
28
  do_action ("ws_plugin__s2member_before_handle_ms_user_deletions", get_defined_vars ());
29
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
30
  /**/
33
  if (($s2says || (is_admin () && $pagenow === "users.php")) && ($processed[$user_id] = true)) /* If s2Member says, or on users.php. */
34
  /* We don't react on this event globally, because there are many routines that remove Users from a Blog; w/ harmless reasons. */
35
  {
36
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
37
  do_action ("ws_plugin__s2member_during_handle_ms_user_deletions_before", get_defined_vars ());
38
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
39
  /**/
40
+ ws_plugin__s2member_handle_user_deletions ($user_id); /* Now hand this over. */
41
  /**/
42
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
43
  do_action ("ws_plugin__s2member_during_handle_ms_user_deletions_after", get_defined_vars ());
44
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
45
  }
46
  }
47
  /**/
48
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
49
  do_action ("ws_plugin__s2member_after_handle_ms_user_deletions", get_defined_vars ());
50
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
51
  /**/
66
  {
67
  static $processed = array (); /* No duplicate processing. */
68
  /**/
69
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
70
  do_action ("ws_plugin__s2member_before_handle_user_deletions", get_defined_vars ());
71
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
72
  /**/
87
  if (is_object ($user = new WP_User ($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"] && is_array ($cv = preg_split ("/\|/", $custom)))
88
  {
89
  foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_urls"]) as $url) /* Handle EOT Notifications on user deletion. */
90
+ /**/
91
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)) && ($url = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($subscr_id)), $url)))
92
  if (($url = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->first_name)), $url)) && ($url = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->last_name)), $url)))
93
  if (($url = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (urlencode (trim ($user->first_name . " " . $user->last_name))), $url)))
94
  if (($url = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_email)), $url)))
95
+ if (($url = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds (urlencode ($user->user_login)), $url)))
96
+ if (($url = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds (urlencode ($user_id)), $url)))
97
+ /**/
98
+ if (($url = trim ($url))) /* Empty? */
99
+ ws_plugin__s2member_remote ($url);
100
+ }
101
+ /**/
102
+ if (is_object ($user = new WP_User ($user_id)) && $user->ID && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"] && is_array ($cv = preg_split ("/\|/", $custom)))
103
+ {
104
+ $msg = $sbj = "( s2Member / API Notification Email ) - EOT/Deletion";
105
+ $msg .= "\n\n"; /* Spacing in the message body. */
106
+ $msg .= "subscr_id: %%subscr_id%%\n";
107
+ $msg .= "user_first_name: %%user_first_name%%\n";
108
+ $msg .= "user_last_name: %%user_last_name%%\n";
109
+ $msg .= "user_full_name: %%user_full_name%%\n";
110
+ $msg .= "user_email: %%user_email%%\n";
111
+ $msg .= "user_login: %%user_login%%\n";
112
+ $msg .= "user_id: %%user_id%%\n";
113
+ $msg .= "cv0: %%cv0%%\n";
114
+ $msg .= "cv1: %%cv1%%\n";
115
+ $msg .= "cv2: %%cv2%%\n";
116
+ $msg .= "cv3: %%cv3%%\n";
117
+ $msg .= "cv4: %%cv4%%\n";
118
+ $msg .= "cv5: %%cv5%%\n";
119
+ $msg .= "cv6: %%cv6%%\n";
120
+ $msg .= "cv7: %%cv7%%\n";
121
+ $msg .= "cv8: %%cv8%%\n";
122
+ $msg .= "cv9: %%cv9%%";
123
  /**/
124
+ if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)) && ($msg = preg_replace ("/%%subscr_id%%/i", ws_plugin__s2member_esc_ds ($subscr_id), $msg)))
125
+ if (($msg = preg_replace ("/%%user_first_name%%/i", ws_plugin__s2member_esc_ds ($user->first_name), $msg)) && ($msg = preg_replace ("/%%user_last_name%%/i", ws_plugin__s2member_esc_ds ($user->last_name), $msg)))
126
+ if (($msg = preg_replace ("/%%user_full_name%%/i", ws_plugin__s2member_esc_ds (trim ($user->first_name . " " . $user->last_name)), $msg)))
127
+ if (($msg = preg_replace ("/%%user_email%%/i", ws_plugin__s2member_esc_ds ($user->user_email), $msg)))
128
+ if (($msg = preg_replace ("/%%user_login%%/i", ws_plugin__s2member_esc_ds ($user->user_login), $msg)))
129
+ if (($msg = preg_replace ("/%%user_id%%/i", ws_plugin__s2member_esc_ds ($user_id), $msg)))
130
+ /**/
131
+ foreach (ws_plugin__s2member_trim_deep (preg_split ("/;+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"])) as $recipient)
132
+ /**/
133
+ ($recipient) ? mail ($recipient, $sbj, apply_filters ("ws_plugin__s2member_eot_del_notification_email_msg", $msg, get_defined_vars ()), "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") : null;
134
  }
135
+ /**/
136
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
137
+ do_action ("ws_plugin__s2member_during_handle_user_deletions", get_defined_vars ());
138
+ unset ($__refs, $__v); /* Unset defined __refs, __v. */
139
  }
140
  /**/
141
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
142
  do_action ("ws_plugin__s2member_after_handle_user_deletions", get_defined_vars ());
143
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
144
  /**/
includes/functions/utilities.inc.php CHANGED
@@ -549,4 +549,20 @@ if (!function_exists ("ws_plugin__s2member_compress_css_c3"))
549
  return $m[0];
550
  }
551
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
  ?>
549
  return $m[0];
550
  }
551
  }
552
+ /*
553
+ Functions that highlights PHP, and also Shortcodes.
554
+ */
555
+ if (!function_exists ("ws_plugin__s2member_highlight_php"))
556
+ {
557
+ function ws_plugin__s2member_highlight_php ($str = FALSE)
558
+ {
559
+ $str = highlight_string ($str, true); /* Start with PHP syntax highlighting first. */
560
+ /**/
561
+ return preg_replace_callback ("/(\[)(\/?)(_*s2If|s2Get|s2Member-[A-z_0-9\-]+)(.*?)(\])/i", "_ws_plugin__s2member_highlight_php", $str);
562
+ }
563
+ function _ws_plugin__s2member_highlight_php ($m = FALSE)
564
+ {
565
+ return '<span style="color:#164A61;">' . $m[0] . '</span>';
566
+ }
567
+ }
568
  ?>
includes/hooks.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  Add the plugin actions/filters here.
18
  */
@@ -67,6 +67,7 @@ add_action ("register_form", "ws_plugin__s2member_custom_registration_fields");
67
  add_action ("bp_before_registration_submit_buttons", "ws_plugin__s2member_opt_in_4bp");
68
  /**/
69
  add_filter ("add_signup_meta", "ws_plugin__s2member_ms_process_signup_meta");
 
70
  add_filter ("wpmu_signup_user_notification_email", "ws_plugin__s2member_ms_nice_email_roles", 11);
71
  add_action ("wpmu_activate_user", "ws_plugin__s2member_configure_user_on_ms_user_activation", 10, 3);
72
  add_action ("wpmu_activate_blog", "ws_plugin__s2member_configure_user_on_ms_blog_activation", 10, 5);
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  Add the plugin actions/filters here.
18
  */
67
  add_action ("bp_before_registration_submit_buttons", "ws_plugin__s2member_opt_in_4bp");
68
  /**/
69
  add_filter ("add_signup_meta", "ws_plugin__s2member_ms_process_signup_meta");
70
+ add_action ("signup_hidden_fields", "ws_plugin__s2member_ms_process_signup_hidden_fields");
71
  add_filter ("wpmu_signup_user_notification_email", "ws_plugin__s2member_ms_nice_email_roles", 11);
72
  add_action ("wpmu_activate_user", "ws_plugin__s2member_configure_user_on_ms_user_activation", 10, 3);
73
  add_action ("wpmu_activate_blog", "ws_plugin__s2member_configure_user_on_ms_blog_activation", 10, 5);
includes/menu-pages/api-ops.inc.php CHANGED
@@ -42,7 +42,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
42
  /**/
43
  echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-notifications-section">' . "\n";
44
  echo '<h3>Signup Notification URLs ( optional )</h3>' . "\n";
45
- echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Subscription is created, you\'ll want to read this section. This is marked `Signup`, because the URLs that you list below, will be notified each time a Member signs up. Depending on your fee structure, this may include a first initial payment that establishes their Subscription. This Notification will only be triggered once for each Member. Signup Notifications are sent right after a Member signs up successfully through PayPal®, regardless of whether any money has actually been received. In other words, this Notification is triggered anytime a Member signs up, even if you provided them with a free trial. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Signup Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
46
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_signup_notifications", get_defined_vars ());
47
  /**/
48
  echo '<table class="form-table">' . "\n";
@@ -75,7 +75,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
75
  echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <code><em>level:custom_capabilities:fixed term</em></code> ) for the Membership Subscription.</li>' . "\n";
76
  echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
77
  echo '<li><code>%%initial_term%%</code> = This is the term length of the initial period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe initial period never recurs, so this only lasts for the term length specified, then it is over. If no initial period was even offered, the value of %%initial_term%% will just be: 0 D, meaning zero days.\'); return false;">?</a> ]</li>' . "\n";
78
- echo '<li><code>%%regular_term%%</code> = This is the term length of the regular period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe regular term is usually recurring. So the regular term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the regular term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their membership privileges are going to last after the %%initial_term%% has expired, if there was an initial term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
79
  echo '</ul>' . "\n";
80
  /**/
81
  if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
@@ -95,6 +95,31 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
95
  echo '</tr>' . "\n";
96
  echo '</tbody>' . "\n";
97
  echo '</table>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  echo '</div>' . "\n";
99
  /**/
100
  echo '</div>' . "\n";
@@ -108,7 +133,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
108
  /**/
109
  echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-notifications-section">' . "\n";
110
  echo '<h3>Registration Notification URLs ( optional )</h3>' . "\n";
111
- echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Member is created, you\'ll want to read this section. This is marked `Registration`, because the URLs that you list below, will be notified each time a Member registers a Username. This is usually triggered right after a `Signup` Notification; at the point in which a new Member successfully completes the Registration form, and they are assigned a Username. However, this is ALSO triggered whenever you create a new User inside your WordPress® Dashboard. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Registration Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
112
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_registration_notifications", get_defined_vars ());
113
  /**/
114
  echo '<table class="form-table">' . "\n";
@@ -158,6 +183,31 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
158
  echo '</tr>' . "\n";
159
  echo '</tbody>' . "\n";
160
  echo '</table>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  echo '</div>' . "\n";
162
  /**/
163
  echo '</div>' . "\n";
@@ -173,7 +223,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
173
  /**/
174
  echo '<div class="ws-menu-page-section ws-plugin--s2member-payment-notifications-section">' . "\n";
175
  echo '<h3>Payment Notification URLs ( optional )</h3>' . "\n";
176
- echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever payment transactions take place, and/or for recurring payments, you\'ll want to read this section. This is marked `Payment`, because the URLs that you list below, will be notified each time an actual payment occurs. Depending on your fee structure, this may include a first initial payment that establishes a Subscription. But more importantly, this will be triggered on all future payments that are received for the lifetime of the Subscription. So unlike the `Signup` Notification, `Payment` Notifications take place whenever actual payments are received, instead of just once after signup is completed. If a payment is required during signup ( e.g. no free trial is being offered ), a Signup Notification will be triggered, and a Payment Notification will ALSO be triggered. In other words, a Payment Notification occurs anytime funds are received, no matter what. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
177
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_payment_notifications", get_defined_vars ());
178
  /**/
179
  echo '<table class="form-table">' . "\n";
@@ -225,6 +275,31 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
225
  echo '</tr>' . "\n";
226
  echo '</tbody>' . "\n";
227
  echo '</table>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  echo '</div>' . "\n";
229
  /**/
230
  echo '</div>' . "\n";
@@ -232,6 +307,96 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
232
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_payment_notifications", get_defined_vars ());
233
  }
234
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_eot_deletion_notifications", true, get_defined_vars ()))
236
  {
237
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_eot_deletion_notifications", get_defined_vars ());
@@ -240,9 +405,9 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
240
  /**/
241
  echo '<div class="ws-menu-page-section ws-plugin--s2member-eot-deletion-notifications-section">' . "\n";
242
  echo '<h3>EOT/Deletion Notification URLs ( optional )</h3>' . "\n";
243
- echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have ended ( and a Member is demoted to a Free Subscriber ), or when an account is deleted from the system, you\'ll want to read this section. This is marked `EOT/Deletion`, because the URLs that you list below, will be notified in both cases. EOT = End Of Term. An EOT is triggered <em>immediately</em> when you refund a Customer, when a Customer forces a chargeback to occur, or when a PayPal® Subscription ends naturally ( i.e. expires ), and the PayPal® IPN service sends s2Member a <code>subscr_eot</code> response. Delayed EOTs occur after a cancellation, either as a result of you cancelling a Customer\'s Subscription, or a Customer cancelling their own Subscription through PayPal®. A cancellation usually results in a delayed EOT, because a cancellation does not always warrant an immediate EOT; there could still be time left on their Subscription.</p>' . "\n";
244
- echo '<p>Manual Deletions will trigger an immediate Notification. If you delete an account manually from within your WordPress® Dashboard, your URLs can be notified automatically through this system. So the two events are an EOT and/or a Manual Deletion. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These EOT/Deletion Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
245
- echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s membership privileges when PayPal® sends a <code>subscr_eot</code> notification via the IPN service, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
246
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_eot_deletion_notifications", get_defined_vars ());
247
  /**/
248
  echo '<table class="form-table">' . "\n";
@@ -264,11 +429,12 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
264
  echo 'EOT/Deletion Notifications take place silently behind-the-scene, using an HTTP connection. Each URL will be notified every time a Subscription hits an EOT, or is deleted.<br /><br />' . "\n";
265
  echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
266
  echo '<ul>' . "\n";
267
- echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remained constant throughout the lifetime of the membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring ( i.e. there was only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
268
  echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
269
  echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
270
  echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
271
  echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
 
272
  echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID that references this account in the WordPress® database.</li>' . "\n";
273
  echo '</ul>' . "\n";
274
  /**/
@@ -289,6 +455,31 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
289
  echo '</tr>' . "\n";
290
  echo '</tbody>' . "\n";
291
  echo '</table>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  echo '</div>' . "\n";
293
  /**/
294
  echo '</div>' . "\n";
@@ -305,7 +496,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
305
  echo '<div class="ws-menu-page-section ws-plugin--s2member-refund-reversal-notifications-section">' . "\n";
306
  echo '<h3>Refund/Reversal Notification URLs ( optional )</h3>' . "\n";
307
  echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have been refunded or reversed ( i.e. charged back to you ), you\'ll want to read this section. This is marked `Refund/Reversal`, because the URLs that you list below, will ONLY be notified in those specific cases, as opposed to the EOT Notifications, which are all-inclusive. This is very similar to the EOT/Deletion described above. But, there is an important distinction. EOT includes cancellations, expirations, failed payments, refunds, chargebacks, etc, etc. In other words, ANY time a deletion or End Of Term action takes place.</p>' . "\n";
308
- echo '<p>So the distinction is that Refund/Reversal Notifications are ONLY sent under these specific circumstances: 1. You log into your PayPal® account and refund a payment that is associated with a Subscription. 2. The Customer complains to PayPal® and a chargeback occurs, forcing a Reversal. In both of these cases, an EOT/Deletion Notification will be sent ( as described above ), but since EOT is a more broad Notification, the Refund/Reversal Notification is here so you can nail down specific back-office operations in these two specific scenarios. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Refund/Reversal Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
309
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_refund_reversal_notifications", get_defined_vars ());
310
  /**/
311
  echo '<table class="form-table">' . "\n";
@@ -327,7 +518,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
327
  echo 'Refund/Reversal Notifications take place silently behind-the-scene, using an HTTP connection. Each URL will be notified every time a payment is refunded through PayPal® or a chargeback occurs.<br /><br />' . "\n";
328
  echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
329
  echo '<ul>' . "\n";
330
- echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remained constant throughout the lifetime of the membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring ( i.e. there was only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
331
  echo '<li><code>%%parent_txn_id%%</code> = The PayPal® Transaction ID, associated with the original payment that is being refunded/reversed.</li>' . "\n";
332
  echo '<li><code>%%-amount%%</code> = The Negative Amount of the payment, that was refunded or reversed back to the Customer.</li>' . "\n";
333
  echo '<li><code>%%-fee%%</code> = The Negative PayPal® fee, that was refunded back to you as the Merchant/Seller.</li>' . "\n";
@@ -357,6 +548,31 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
357
  echo '</tr>' . "\n";
358
  echo '</tbody>' . "\n";
359
  echo '</table>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  echo '</div>' . "\n";
361
  /**/
362
  echo '</div>' . "\n";
@@ -372,7 +588,7 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
372
  /**/
373
  echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-notifications-section">' . "\n";
374
  echo '<h3>Specific Post/Page Access Notification URLs ( optional )</h3>' . "\n";
375
- echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Specific Post/Page transactions take place, you\'ll want to read this section. This is marked `Specific Post/Page`, because the URLs that you list below, will be notified each time a payment occurs, for access to a Specific Post/Page sale. This is the only Notification that is sent for Specific Post/Page Access. All of the other API Notifications are designed for Membership Level Access. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member and remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
376
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_sp_notifications", get_defined_vars ());
377
  /**/
378
  echo '<table class="form-table">' . "\n";
@@ -423,6 +639,31 @@ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections
423
  echo '</tr>' . "\n";
424
  echo '</tbody>' . "\n";
425
  echo '</table>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  echo '</div>' . "\n";
427
  /**/
428
  echo '</div>' . "\n";
42
  /**/
43
  echo '<div class="ws-menu-page-section ws-plugin--s2member-signup-notifications-section">' . "\n";
44
  echo '<h3>Signup Notification URLs ( optional )</h3>' . "\n";
45
+ echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Subscription is created, you\'ll want to read this section. This is marked `Signup`, because the URLs that you list below, will be notified each time a Member signs up. Depending on your fee structure, this may include a first initial payment that establishes their Subscription. This Notification will only be triggered once for each Member. Signup Notifications are sent right after a Member signs up successfully through PayPal®, regardless of whether any money has actually been received. In other words, this Notification is triggered anytime a Member signs up, even if you provided them with a free trial. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member, and it remains active at all times. These Signup Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
46
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_signup_notifications", get_defined_vars ());
47
  /**/
48
  echo '<table class="form-table">' . "\n";
75
  echo '<li><code>%%item_number%%</code> = The Item Number ( colon separated <code><em>level:custom_capabilities:fixed term</em></code> ) for the Membership Subscription.</li>' . "\n";
76
  echo '<li><code>%%item_name%%</code> = The Item Name ( as provided by the <code>desc=""</code> attribute in your Shortcode, which briefly describes the Item Number ).</li>' . "\n";
77
  echo '<li><code>%%initial_term%%</code> = This is the term length of the initial period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%initial_term%% = 1 D ( this means 1 Day )\\n%%initial_term%% = 1 W ( this means 1 Week )\\n%%initial_term%% = 1 M ( this means 1 Month )\\n%%initial_term%% = 1 Y ( this means 1 Year )\\n\\nThe initial period never recurs, so this only lasts for the term length specified, then it is over. If no initial period was even offered, the value of %%initial_term%% will just be: 0 D, meaning zero days.\'); return false;">?</a> ]</li>' . "\n";
78
+ echo '<li><code>%%regular_term%%</code> = This is the term length of the regular period. This will be a numeric value, followed by a space, then a single letter. [ <a href="#" onclick="alert(\'Here are some examples:\\n\\n%%regular_term%% = 1 D ( this means 1 Day )\\n%%regular_term%% = 1 W ( this means 1 Week )\\n%%regular_term%% = 1 M ( this means 1 Month )\\n%%regular_term%% = 1 Y ( this means 1 Year )\\n%%regular_term%% = 1 L ( this means 1 Lifetime )\\n\\nThe regular term is usually recurring. So the regular term value represents the period ( or duration ) of each recurring period. If %%recurring%% = 0, then the regular term only applies once, because it is not recurring. So if it is not recurring, the value of %%regular_term%% simply represents how long their Membership privileges are going to last after the %%initial_term%% has expired, if there was an initial term. The value of this variable ( %%regular_term%% ) will never be empty, it will always be at least: 1 D, meaning 1 day. No exceptions.\'); return false;">?</a> ]</li>' . "\n";
79
  echo '</ul>' . "\n";
80
  /**/
81
  if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
95
  echo '</tr>' . "\n";
96
  echo '</tbody>' . "\n";
97
  echo '</table>' . "\n";
98
+ /**/
99
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
100
+ /**/
101
+ echo '<table class="form-table" style="margin-top:0;">' . "\n";
102
+ echo '<tbody>' . "\n";
103
+ echo '<tr>' . "\n";
104
+ /**/
105
+ echo '<th style="padding-top:0;">' . "\n";
106
+ echo '<label for="ws-plugin--s2member-signup-notification-recipients">' . "\n";
107
+ echo 'Send An Email Transaction Log Of This Event?' . "\n";
108
+ echo '</label>' . "\n";
109
+ echo '</th>' . "\n";
110
+ /**/
111
+ echo '</tr>' . "\n";
112
+ echo '<tr>' . "\n";
113
+ /**/
114
+ echo '<td>' . "\n";
115
+ echo '<input type="text" name="ws_plugin__s2member_signup_notification_recipients" id="ws-plugin--s2member-signup-notification-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_notification_recipients"]) . '" /><br />' . "\n";
116
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
117
+ echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
118
+ echo '</td>' . "\n";
119
+ /**/
120
+ echo '</tr>' . "\n";
121
+ echo '</tbody>' . "\n";
122
+ echo '</table>' . "\n";
123
  echo '</div>' . "\n";
124
  /**/
125
  echo '</div>' . "\n";
133
  /**/
134
  echo '<div class="ws-menu-page-section ws-plugin--s2member-registration-notifications-section">' . "\n";
135
  echo '<h3>Registration Notification URLs ( optional )</h3>' . "\n";
136
+ echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever a new Member is created, you\'ll want to read this section. This is marked `Registration`, because the URLs that you list below, will be notified each time a Member registers a Username. This is usually triggered right after a `Signup` Notification; at the point in which a new Member successfully completes the Registration form, and they are assigned a Username. However, this is ALSO triggered whenever you create a new User inside your WordPress® Dashboard. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member, and it remains active at all times. These Registration Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
137
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_registration_notifications", get_defined_vars ());
138
  /**/
139
  echo '<table class="form-table">' . "\n";
183
  echo '</tr>' . "\n";
184
  echo '</tbody>' . "\n";
185
  echo '</table>' . "\n";
186
+ /**/
187
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
188
+ /**/
189
+ echo '<table class="form-table" style="margin-top:0;">' . "\n";
190
+ echo '<tbody>' . "\n";
191
+ echo '<tr>' . "\n";
192
+ /**/
193
+ echo '<th style="padding-top:0;">' . "\n";
194
+ echo '<label for="ws-plugin--s2member-registration-notification-recipients">' . "\n";
195
+ echo 'Send An Email Transaction Log Of This Event?' . "\n";
196
+ echo '</label>' . "\n";
197
+ echo '</th>' . "\n";
198
+ /**/
199
+ echo '</tr>' . "\n";
200
+ echo '<tr>' . "\n";
201
+ /**/
202
+ echo '<td>' . "\n";
203
+ echo '<input type="text" name="ws_plugin__s2member_registration_notification_recipients" id="ws-plugin--s2member-registration-notification-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_recipients"]) . '" /><br />' . "\n";
204
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
205
+ echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
206
+ echo '</td>' . "\n";
207
+ /**/
208
+ echo '</tr>' . "\n";
209
+ echo '</tbody>' . "\n";
210
+ echo '</table>' . "\n";
211
  echo '</div>' . "\n";
212
  /**/
213
  echo '</div>' . "\n";
223
  /**/
224
  echo '<div class="ws-menu-page-section ws-plugin--s2member-payment-notifications-section">' . "\n";
225
  echo '<h3>Payment Notification URLs ( optional )</h3>' . "\n";
226
+ echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever payment transactions take place, and/or for recurring payments, you\'ll want to read this section. This is marked `Payment`, because the URLs that you list below, will be notified each time an actual payment occurs. Depending on your fee structure, this may include a first initial payment that establishes a Subscription. But more importantly, this will be triggered on all future payments that are received for the lifetime of the Subscription. So unlike the `Signup` Notification, `Payment` Notifications take place whenever actual payments are received, instead of just once after signup is completed. If a payment is required during signup ( e.g. no free trial is being offered ), a Signup Notification will be triggered, and a Payment Notification will ALSO be triggered. In other words, a Payment Notification occurs anytime funds are received, no matter what. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member, and it remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
227
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_payment_notifications", get_defined_vars ());
228
  /**/
229
  echo '<table class="form-table">' . "\n";
275
  echo '</tr>' . "\n";
276
  echo '</tbody>' . "\n";
277
  echo '</table>' . "\n";
278
+ /**/
279
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
280
+ /**/
281
+ echo '<table class="form-table" style="margin-top:0;">' . "\n";
282
+ echo '<tbody>' . "\n";
283
+ echo '<tr>' . "\n";
284
+ /**/
285
+ echo '<th style="padding-top:0;">' . "\n";
286
+ echo '<label for="ws-plugin--s2member-payment-notification-recipients">' . "\n";
287
+ echo 'Send An Email Transaction Log Of This Event?' . "\n";
288
+ echo '</label>' . "\n";
289
+ echo '</th>' . "\n";
290
+ /**/
291
+ echo '</tr>' . "\n";
292
+ echo '<tr>' . "\n";
293
+ /**/
294
+ echo '<td>' . "\n";
295
+ echo '<input type="text" name="ws_plugin__s2member_payment_notification_recipients" id="ws-plugin--s2member-payment-notification-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_recipients"]) . '" /><br />' . "\n";
296
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
297
+ echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
298
+ echo '</td>' . "\n";
299
+ /**/
300
+ echo '</tr>' . "\n";
301
+ echo '</tbody>' . "\n";
302
+ echo '</table>' . "\n";
303
  echo '</div>' . "\n";
304
  /**/
305
  echo '</div>' . "\n";
307
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_payment_notifications", get_defined_vars ());
308
  }
309
  /**/
310
+ if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_cancellation_notifications", true, get_defined_vars ()))
311
+ {
312
+ do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_cancellation_notifications", get_defined_vars ());
313
+ /**/
314
+ echo '<div class="ws-menu-page-group" title="Cancellation Notifications">' . "\n";
315
+ /**/
316
+ echo '<div class="ws-menu-page-section ws-plugin--s2member-cancellation-notifications-section">' . "\n";
317
+ echo '<h3>Cancellation Notification URLs ( optional )</h3>' . "\n";
318
+ echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions are cancelled through PayPal®, you\'ll want to read this section. This is marked `Cancellation`, because the URLs that you list below, will be notified each time a Subscription is cancelled. A Cancellation is triggered when you cancel a Customer\'s Subscription through PayPal®, or when a Customer cancels their own Subscription through PayPal®. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member, and it remains active at all times. These Cancellation Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
319
+ echo '<p><em><strong>*Understanding Cancellations*</strong> It\'s important to realize that a Cancellation is not an EOT ( End Of Term ). All that happens during a Cancellation event, is that billing is stopped, and it\'s understood that the Customer is going to lose access, at some point in the future. This does NOT mean, that access will be revoked immediately. A separate EOT event will automatically handle a (demotion|deletion) later, at the appropriate time; which could be several days, or even a year after the Cancellation took place.</em></p>' . "\n";
320
+ echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when PayPal® sends a <code>subscr_eot</code> notification via the IPN service, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT ( End Of Term ) until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
321
+ do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_cancellation_notifications", get_defined_vars ());
322
+ /**/
323
+ echo '<table class="form-table">' . "\n";
324
+ echo '<tbody>' . "\n";
325
+ echo '<tr>' . "\n";
326
+ /**/
327
+ echo '<th>' . "\n";
328
+ echo '<label for="ws-plugin--s2member-cancellation-notification-urls">' . "\n";
329
+ echo 'Cancellation Notification URLs:' . "\n";
330
+ echo '</label>' . "\n";
331
+ echo '</th>' . "\n";
332
+ /**/
333
+ echo '</tr>' . "\n";
334
+ echo '<tr>' . "\n";
335
+ /**/
336
+ echo '<td>' . "\n";
337
+ echo 'You can input multiple Notification URLs by inserting one per line.<br />' . "\n";
338
+ echo '<textarea name="ws_plugin__s2member_cancellation_notification_urls" id="ws-plugin--s2member-cancellation-notification-urls" rows="3" wrap="off">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_urls"]) . '</textarea><br />' . "\n";
339
+ echo 'Cancellation Notifications take place silently behind-the-scene, using an HTTP connection. Each URL will be notified every time a Subscription is cancelled.<br /><br />' . "\n";
340
+ echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
341
+ echo '<ul>' . "\n";
342
+ echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring ( i.e. there was only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
343
+ echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
344
+ echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
345
+ echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
346
+ echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
347
+ echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
348
+ echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID that references this account in the WordPress® database.</li>' . "\n";
349
+ echo '</ul>' . "\n";
350
+ /**/
351
+ if (!is_multisite () || !ws_plugin__s2member_is_multisite_farm () || is_main_site ())
352
+ {
353
+ echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
354
+ echo '<ul>' . "\n";
355
+ echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
356
+ echo '<li><code>%%cv1%%</code> = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode. like this: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3"</code>. You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.</li>' . "\n";
357
+ echo '</ul>' . "\n";
358
+ echo '<strong>This example uses cv1 to track a User\'s IP address:</strong><br />' . "\n";
359
+ echo '<em>( The IP address could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
360
+ echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|&lt;?php echo $_SERVER["REMOTE_ADDR"]; ?&gt;"</code>' . "\n";
361
+ }
362
+ /**/
363
+ echo '</td>' . "\n";
364
+ /**/
365
+ echo '</tr>' . "\n";
366
+ echo '</tbody>' . "\n";
367
+ echo '</table>' . "\n";
368
+ /**/
369
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
370
+ /**/
371
+ echo '<table class="form-table" style="margin-top:0;">' . "\n";
372
+ echo '<tbody>' . "\n";
373
+ echo '<tr>' . "\n";
374
+ /**/
375
+ echo '<th style="padding-top:0;">' . "\n";
376
+ echo '<label for="ws-plugin--s2member-cancellation-notification-recipients">' . "\n";
377
+ echo 'Send An Email Transaction Log Of This Event?' . "\n";
378
+ echo '</label>' . "\n";
379
+ echo '</th>' . "\n";
380
+ /**/
381
+ echo '</tr>' . "\n";
382
+ echo '<tr>' . "\n";
383
+ /**/
384
+ echo '<td>' . "\n";
385
+ echo '<input type="text" name="ws_plugin__s2member_cancellation_notification_recipients" id="ws-plugin--s2member-cancellation-notification-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["cancellation_notification_recipients"]) . '" /><br />' . "\n";
386
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
387
+ echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
388
+ echo '</td>' . "\n";
389
+ /**/
390
+ echo '</tr>' . "\n";
391
+ echo '</tbody>' . "\n";
392
+ echo '</table>' . "\n";
393
+ echo '</div>' . "\n";
394
+ /**/
395
+ echo '</div>' . "\n";
396
+ /**/
397
+ do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_after_cancellation_notifications", get_defined_vars ());
398
+ }
399
+ /**/
400
  if (apply_filters ("ws_plugin__s2member_during_api_ops_page_during_left_sections_display_eot_deletion_notifications", true, get_defined_vars ()))
401
  {
402
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_before_eot_deletion_notifications", get_defined_vars ());
405
  /**/
406
  echo '<div class="ws-menu-page-section ws-plugin--s2member-eot-deletion-notifications-section">' . "\n";
407
  echo '<h3>EOT/Deletion Notification URLs ( optional )</h3>' . "\n";
408
+ echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have ended ( and a Member is demoted to a Free Subscriber ), or when an account is deleted from the system, you\'ll want to read this section. This is marked `EOT/Deletion`, because the URLs that you list below, will be notified in both cases. EOT = End Of Term. An EOT is triggered <em>immediately</em> when you refund a Customer, when a Customer forces a chargeback to occur, or when a PayPal® Subscription ends naturally ( i.e. expires ), and the PayPal® IPN service sends s2Member a <code>subscr_eot</code> response. Delayed EOTs occur after a Cancellation, either as a result of you cancelling a Customer\'s Subscription, or a Customer cancelling their own Subscription through PayPal®. A Cancellation usually results in a delayed EOT, because a Cancellation does NOT always warrant an immediate action; there could still be time left on their Subscription.</p>' . "\n";
409
+ echo '<p>Manual Deletions will trigger an immediate Notification. If you delete an account manually from within your WordPress® Dashboard, your URLs can be notified automatically through this system. So the two events are an EOT and/or a Manual Deletion. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member, and it remains active at all times. These EOT/Deletion Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
410
+ echo '<p><em><strong>*Some Hairy Details*</strong> There might be times whenever you notice that a Members\'s Subscription has been cancelled through PayPal®... but, s2Member continues allowing the User access to your site as a paid Member. Please don\'t be confused by this... in 99.9% of these cases, the reason for this is legitimate. s2Member will only remove the User\'s Membership privileges when PayPal® sends a <code>subscr_eot</code> notification via the IPN service, a refund occurs, a chargeback occurs, or when a cancellation occurs - which would later result in a delayed Auto-EOT by s2Member. s2Member will not process an EOT until the User has completely used up the time they paid for. In other words, if a User signs up for a monthly Subscription on Jan 1st, and then cancels their Subscription on Jan 15th; technically, they should still be allowed to access the site for another 15 days, and then on Feb 1st, the time they paid for has completely elapsed. At that time, s2Member will remove their Membership privileges; by either demoting them to a Free Subscriber, or deleting their account from the system ( based on your configuration ). s2Member also calculates one extra day ( 24 hours ) into its equation, just to make sure access is not removed sooner than a Customer might expect.</em></p>' . "\n";
411
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_eot_deletion_notifications", get_defined_vars ());
412
  /**/
413
  echo '<table class="form-table">' . "\n";
429
  echo 'EOT/Deletion Notifications take place silently behind-the-scene, using an HTTP connection. Each URL will be notified every time a Subscription hits an EOT, or is deleted.<br /><br />' . "\n";
430
  echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
431
  echo '<ul>' . "\n";
432
+ echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring ( i.e. there was only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
433
  echo '<li><code>%%user_first_name%%</code> = The First Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
434
  echo '<li><code>%%user_last_name%%</code> = The Last Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
435
  echo '<li><code>%%user_full_name%%</code> = The Full Name listed on their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
436
  echo '<li><code>%%user_email%%</code> = The Email Address associated with their User account. This might be different than what is on file at PayPal®.</li>' . "\n";
437
+ echo '<li><code>%%user_login%%</code> = The Username associated with their account. The Customer created this during registration.</li>' . "\n";
438
  echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID that references this account in the WordPress® database.</li>' . "\n";
439
  echo '</ul>' . "\n";
440
  /**/
455
  echo '</tr>' . "\n";
456
  echo '</tbody>' . "\n";
457
  echo '</table>' . "\n";
458
+ /**/
459
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
460
+ /**/
461
+ echo '<table class="form-table" style="margin-top:0;">' . "\n";
462
+ echo '<tbody>' . "\n";
463
+ echo '<tr>' . "\n";
464
+ /**/
465
+ echo '<th style="padding-top:0;">' . "\n";
466
+ echo '<label for="ws-plugin--s2member-eot-del-notification-recipients">' . "\n";
467
+ echo 'Send An Email Transaction Log Of This Event?' . "\n";
468
+ echo '</label>' . "\n";
469
+ echo '</th>' . "\n";
470
+ /**/
471
+ echo '</tr>' . "\n";
472
+ echo '<tr>' . "\n";
473
+ /**/
474
+ echo '<td>' . "\n";
475
+ echo '<input type="text" name="ws_plugin__s2member_eot_del_notification_recipients" id="ws-plugin--s2member-eot-del-notification-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["eot_del_notification_recipients"]) . '" /><br />' . "\n";
476
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
477
+ echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
478
+ echo '</td>' . "\n";
479
+ /**/
480
+ echo '</tr>' . "\n";
481
+ echo '</tbody>' . "\n";
482
+ echo '</table>' . "\n";
483
  echo '</div>' . "\n";
484
  /**/
485
  echo '</div>' . "\n";
496
  echo '<div class="ws-menu-page-section ws-plugin--s2member-refund-reversal-notifications-section">' . "\n";
497
  echo '<h3>Refund/Reversal Notification URLs ( optional )</h3>' . "\n";
498
  echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Subscriptions have been refunded or reversed ( i.e. charged back to you ), you\'ll want to read this section. This is marked `Refund/Reversal`, because the URLs that you list below, will ONLY be notified in those specific cases, as opposed to the EOT Notifications, which are all-inclusive. This is very similar to the EOT/Deletion described above. But, there is an important distinction. EOT includes cancellations, expirations, failed payments, refunds, chargebacks, etc, etc. In other words, ANY time a deletion or End Of Term action takes place.</p>' . "\n";
499
+ echo '<p>So the distinction is that Refund/Reversal Notifications are ONLY sent under these specific circumstances: 1. You log into your PayPal® account and refund a payment that is associated with a Subscription. 2. The Customer complains to PayPal® and a chargeback occurs, forcing a Reversal. In both of these cases, an EOT/Deletion Notification will be sent ( as described above ), but since EOT is a more broad Notification, the Refund/Reversal Notification is here so you can nail down specific back-office operations in these two specific scenarios. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member, and it remains active at all times. These Refund/Reversal Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
500
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_refund_reversal_notifications", get_defined_vars ());
501
  /**/
502
  echo '<table class="form-table">' . "\n";
518
  echo 'Refund/Reversal Notifications take place silently behind-the-scene, using an HTTP connection. Each URL will be notified every time a payment is refunded through PayPal® or a chargeback occurs.<br /><br />' . "\n";
519
  echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
520
  echo '<ul>' . "\n";
521
+ echo '<li><code>%%subscr_id%%</code> = The PayPal® Subscription ID, which remained constant throughout the lifetime of the Membership. [ <a href="#" onclick="alert(\'There is one exception. If you are selling Lifetime or Fixed-Term ( non-recurring ) access, using Buy Now functionality; the %%subscr_id%% is actually set to the original Transaction ID for the purchase.\\n\\nPayPal® does not provide a specific Subscription ID for Buy Now purchases. Since Lifetime &amp; Fixed-Term Subscriptions are NOT recurring ( i.e. there was only ONE payment ), using the Transaction ID as the Subscription ID is a graceful way to deal with this minor conflict.\'); return false;">?</a> ]</li>' . "\n";
522
  echo '<li><code>%%parent_txn_id%%</code> = The PayPal® Transaction ID, associated with the original payment that is being refunded/reversed.</li>' . "\n";
523
  echo '<li><code>%%-amount%%</code> = The Negative Amount of the payment, that was refunded or reversed back to the Customer.</li>' . "\n";
524
  echo '<li><code>%%-fee%%</code> = The Negative PayPal® fee, that was refunded back to you as the Merchant/Seller.</li>' . "\n";
548
  echo '</tr>' . "\n";
549
  echo '</tbody>' . "\n";
550
  echo '</table>' . "\n";
551
+ /**/
552
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
553
+ /**/
554
+ echo '<table class="form-table" style="margin-top:0;">' . "\n";
555
+ echo '<tbody>' . "\n";
556
+ echo '<tr>' . "\n";
557
+ /**/
558
+ echo '<th style="padding-top:0;">' . "\n";
559
+ echo '<label for="ws-plugin--s2member-ref-rev-notification-recipients">' . "\n";
560
+ echo 'Send An Email Transaction Log Of This Event?' . "\n";
561
+ echo '</label>' . "\n";
562
+ echo '</th>' . "\n";
563
+ /**/
564
+ echo '</tr>' . "\n";
565
+ echo '<tr>' . "\n";
566
+ /**/
567
+ echo '<td>' . "\n";
568
+ echo '<input type="text" name="ws_plugin__s2member_ref_rev_notification_recipients" id="ws-plugin--s2member-ref-rev-notification-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["ref_rev_notification_recipients"]) . '" /><br />' . "\n";
569
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
570
+ echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
571
+ echo '</td>' . "\n";
572
+ /**/
573
+ echo '</tr>' . "\n";
574
+ echo '</tbody>' . "\n";
575
+ echo '</table>' . "\n";
576
  echo '</div>' . "\n";
577
  /**/
578
  echo '</div>' . "\n";
588
  /**/
589
  echo '<div class="ws-menu-page-section ws-plugin--s2member-sp-notifications-section">' . "\n";
590
  echo '<h3>Specific Post/Page Access Notification URLs ( optional )</h3>' . "\n";
591
+ echo '<p>If you use affiliate software, or have back-office routines that need to be notified whenever Specific Post/Page transactions take place, you\'ll want to read this section. This is marked `Specific Post/Page`, because the URLs that you list below, will be notified each time a payment occurs, for access to a Specific Post/Page sale. This is the only Notification that is sent for Specific Post/Page Access. All of the other API Notifications are designed for Membership Level Access. Please note, this feature is not to be confused with the PayPal® IPN service. PayPal® IPN integration is already built into s2Member, and it remains active at all times. These Payment Notifications are an added layer of functionality, and they are completely optional.</p>' . "\n";
592
  do_action ("ws_plugin__s2member_during_api_ops_page_during_left_sections_during_sp_notifications", get_defined_vars ());
593
  /**/
594
  echo '<table class="form-table">' . "\n";
639
  echo '</tr>' . "\n";
640
  echo '</tbody>' . "\n";
641
  echo '</table>' . "\n";
642
+ /**/
643
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
644
+ /**/
645
+ echo '<table class="form-table" style="margin-top:0;">' . "\n";
646
+ echo '<tbody>' . "\n";
647
+ echo '<tr>' . "\n";
648
+ /**/
649
+ echo '<th style="padding-top:0;">' . "\n";
650
+ echo '<label for="ws-plugin--s2member-sp-notification-recipients">' . "\n";
651
+ echo 'Send An Email Transaction Log Of This Event?' . "\n";
652
+ echo '</label>' . "\n";
653
+ echo '</th>' . "\n";
654
+ /**/
655
+ echo '</tr>' . "\n";
656
+ echo '<tr>' . "\n";
657
+ /**/
658
+ echo '<td>' . "\n";
659
+ echo '<input type="text" name="ws_plugin__s2member_sp_notification_recipients" id="ws-plugin--s2member-sp-notification-recipients" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_notification_recipients"]) . '" /><br />' . "\n";
660
+ echo 'This is a semicolon ( ; ) delimited list of Recipients. Here is an example:<br />' . "\n";
661
+ echo '<code>"John" &lt;john@example.com&gt;; admin@example.com; "Webmaster" &lt;webmaster@example.com&gt;</code>' . "\n";
662
+ echo '</td>' . "\n";
663
+ /**/
664
+ echo '</tr>' . "\n";
665
+ echo '</tbody>' . "\n";
666
+ echo '</table>' . "\n";
667
  echo '</div>' . "\n";
668
  /**/
669
  echo '</div>' . "\n";
includes/menu-pages/code-samples/current-user-access-level-conditional-upgrades.php CHANGED
@@ -12,22 +12,22 @@
12
 
13
  ---- s2member Shortcode Equivalents ----
14
 
15
- [s2All current_user_is="s2member_level4"]
16
  Member is already at the highest Level. No Modification Button displayed here.
17
- [/s2All]
18
 
19
- [s2All current_user_is="s2member_level3"]
20
  Insert Modification Button here. Upgrade Level 3 Members to highest Level 4.
21
- [/s2All]
22
 
23
- [s2All current_user_is="s2member_level2"]
24
  Insert Modification Button here. Upgrade Level 2 Members to Level 3 or higher.
25
- [/s2All]
26
 
27
- [s2All current_user_is="s2member_level1"]
28
  Insert Modification Button here. Upgrade Level 1 Members to Level 2 or higher.
29
- [/s2All]
30
 
31
- [s2All current_user_is="s2member_level0"]
32
  Insert Modification Button here. Let Free Subscribers become a Member.
33
- [/s2All]
12
 
13
  ---- s2member Shortcode Equivalents ----
14
 
15
+ [s2If current_user_is(s2member_level4)]
16
  Member is already at the highest Level. No Modification Button displayed here.
17
+ [/s2If]
18
 
19
+ [s2If current_user_is(s2member_level3)]
20
  Insert Modification Button here. Upgrade Level 3 Members to highest Level 4.
21
+ [/s2If]
22
 
23
+ [s2If current_user_is(s2member_level2)]
24
  Insert Modification Button here. Upgrade Level 2 Members to Level 3 or higher.
25
+ [/s2If]
26
 
27
+ [s2If current_user_is(s2member_level1)]
28
  Insert Modification Button here. Upgrade Level 1 Members to Level 2 or higher.
29
+ [/s2If]
30
 
31
+ [s2If current_user_is(s2member_level0)]
32
  Insert Modification Button here. Let Free Subscribers become a Member.
33
+ [/s2If]
includes/menu-pages/code-samples/current-user-access-level.php CHANGED
@@ -14,26 +14,26 @@
14
 
15
  ---- s2member Shortcode Equivalent ----
16
 
17
- [s2All current_user_is="s2member_level4"]
18
  Some premium content for Level 4 Members.
19
- [/s2All]
20
 
21
- [s2All current_user_is="s2member_level3"]
22
  Some premium content for Level 3 Members.
23
- [/s2All]
24
 
25
- [s2All current_user_is="s2member_level2"]
26
  Some premium content for Level 2 Members.
27
- [/s2All]
28
 
29
- [s2All current_user_is="s2member_level1"]
30
  Some premium content for Level 1 Members.
31
- [/s2All]
32
 
33
- [s2All current_user_is="s2member_level0"]
34
  Some content for Free Subscribers.
35
- [/s2All]
36
 
37
- [s2All is_user_logged_in="no"]
38
  Some public content.
39
- [/s2All]
14
 
15
  ---- s2member Shortcode Equivalent ----
16
 
17
+ [s2If current_user_is(s2member_level4)]
18
  Some premium content for Level 4 Members.
19
+ [/s2If]
20
 
21
+ [s2If current_user_is(s2member_level3)]
22
  Some premium content for Level 3 Members.
23
+ [/s2If]
24
 
25
+ [s2If current_user_is(s2member_level2)]
26
  Some premium content for Level 2 Members.
27
+ [/s2If]
28
 
29
+ [s2If current_user_is(s2member_level1)]
30
  Some premium content for Level 1 Members.
31
+ [/s2If]
32
 
33
+ [s2If current_user_is(s2member_level0)]
34
  Some content for Free Subscribers.
35
+ [/s2If]
36
 
37
+ [s2If !is_user_logged_in()]
38
  Some public content.
39
+ [/s2If]
includes/menu-pages/code-samples/current-user-can-ccaps-1.php CHANGED
@@ -16,20 +16,20 @@
16
 
17
  ---- s2member Shortcode Equivalents ----
18
 
19
- [s2All current_user_can="access_s2member_level1"]
20
 
21
  Some premium content for all Level 1 Members.
22
 
23
- [_s2All current_user_can="access_s2member_ccap_music"]
24
  Display links for music as well.
25
- [/_s2All]
26
 
27
- [_s2All current_user_can="access_s2member_ccap_videos"]
28
  Display videos as well.
29
- [/_s2All]
30
 
31
- [/s2All]
32
 
33
- [s2All current_user_cannot="access_s2member_level1"]
34
  Some public content.
35
- [/s2All]
16
 
17
  ---- s2member Shortcode Equivalents ----
18
 
19
+ [s2If current_user_can(access_s2member_level1)]
20
 
21
  Some premium content for all Level 1 Members.
22
 
23
+ [_s2If current_user_can(access_s2member_ccap_music)]
24
  Display links for music as well.
25
+ [/_s2If]
26
 
27
+ [_s2If current_user_can(access_s2member_ccap_videos)]
28
  Display videos as well.
29
+ [/_s2If]
30
 
31
+ [/s2If]
32
 
33
+ [s2If !current_user_can(access_s2member_level1)]
34
  Some public content.
35
+ [/s2If]
includes/menu-pages/code-samples/current-user-can-ccaps-2.php CHANGED
@@ -29,36 +29,36 @@
29
 
30
  ---- s2member Shortcode Equivalents ----
31
 
32
- [s2All current_user_can="access_s2member_level1"]
33
 
34
  Some premium content for all Level 1 Members.
35
 
36
- [_s2All current_user_can="access_s2member_ccap_ebooks"]
37
  Display links for downloading your eBooks.
38
- [/_s2All]
39
- [_s2All current_user_cannot="access_s2member_ccap_ebooks"]
40
  Insert a PayPal® Modification Button that includes the Custom Capability: ebooks
41
  This might read, "Upgrade Your Membership for access to my eBooks!".
42
- [/_s2All]
43
 
44
- [_s2All current_user_can="access_s2member_ccap_reports"]
45
  Display links for accessing your reports.
46
- [/_s2All]
47
- [_s2All current_user_cannot="access_s2member_ccap_reports"]
48
  Insert a PayPal® Modification Button that includes the Custom Capability: reports
49
  This might read, "Upgrade Your Membership for access to my reports!".
50
- [/_s2All]
51
 
52
- [_s2All current_user_can="access_s2member_ccap_tips"]
53
  Display tips.
54
- [/_s2All]
55
- [_s2All current_user_cannot="access_s2member_ccap_tips"]
56
  Insert a PayPal® Modification Button that includes the Custom Capability: tips
57
  This might read, "Upgrade Your Membership for access to my tips!".
58
- [/_s2All]
59
 
60
- [/s2All]
61
 
62
- [s2All current_user_cannot="access_s2member_level1"]
63
  Some public content.
64
- [/s2All]
29
 
30
  ---- s2member Shortcode Equivalents ----
31
 
32
+ [s2If current_user_can(access_s2member_level1)]
33
 
34
  Some premium content for all Level 1 Members.
35
 
36
+ [_s2If current_user_can(access_s2member_ccap_ebooks)]
37
  Display links for downloading your eBooks.
38
+ [/_s2If]
39
+ [_s2If !current_user_can(access_s2member_ccap_ebooks)]
40
  Insert a PayPal® Modification Button that includes the Custom Capability: ebooks
41
  This might read, "Upgrade Your Membership for access to my eBooks!".
42
+ [/_s2If]
43
 
44
+ [_s2If current_user_can(access_s2member_ccap_reports)]
45
  Display links for accessing your reports.
46
+ [/_s2If]
47
+ [_s2If !current_user_can(access_s2member_ccap_reports)]
48
  Insert a PayPal® Modification Button that includes the Custom Capability: reports
49
  This might read, "Upgrade Your Membership for access to my reports!".
50
+ [/_s2If]
51
 
52
+ [_s2If current_user_can(access_s2member_ccap_tips)]
53
  Display tips.
54
+ [/_s2If]
55
+ [_s2If !current_user_can(access_s2member_ccap_tips)]
56
  Insert a PayPal® Modification Button that includes the Custom Capability: tips
57
  This might read, "Upgrade Your Membership for access to my tips!".
58
+ [/_s2If]
59
 
60
+ [/s2If]
61
 
62
+ [s2If !current_user_can(access_s2member_level1)]
63
  Some public content.
64
+ [/s2If]
includes/menu-pages/code-samples/current-user-fields.php CHANGED
@@ -8,12 +8,12 @@ Custom Fields are also included in the JSON decoded array.
8
 
9
  ---- s2member Shortcode Equivalents ----
10
 
11
- [s2Get custom_field="first_name" /]
12
- [s2Get custom_field="last_name" /]
13
- [s2Get custom_field="Website URL" /]
14
- [s2Get custom_field="My Custom Field Name" /]
15
- [s2Get custom_field="my_custom_field_name" /]
16
- [s2Get custom_field="any other WP_User property" /]
17
 
18
  You can also pull details from the meta table.
19
  [s2Get user_option="s2member_custom" /]
8
 
9
  ---- s2member Shortcode Equivalents ----
10
 
11
+ [s2Get user_field="first_name" /]
12
+ [s2Get user_field="last_name" /]
13
+ [s2Get user_field="Website URL" /]
14
+ [s2Get user_field="My Custom Field Name" /]
15
+ [s2Get user_field="my_custom_field_name" /]
16
+ [s2Get user_field="any other WP_User property" /]
17
 
18
  You can also pull details from the meta table.
19
  [s2Get user_option="s2member_custom" /]
includes/menu-pages/code-samples/current-user-is-logged-in-as-member.php CHANGED
@@ -4,6 +4,6 @@
4
 
5
  ---- s2member Shortcode Equivalent ----
6
 
7
- [s2All is_user_logged_in="yes" current_user_can="access_s2member_level1"]
8
  content goes here
9
- [/s2All]
4
 
5
  ---- s2member Shortcode Equivalent ----
6
 
7
+ [s2If is_user_logged_in() AND current_user_can(access_s2member_level1)]
8
  content goes here
9
+ [/s2If]
includes/menu-pages/code-samples/current-user-is-logged-in.php CHANGED
@@ -4,6 +4,6 @@
4
 
5
  ---- s2member Shortcode Equivalent ----
6
 
7
- [s2All is_user_logged_in="yes"]
8
  content goes here
9
- [/s2All]
4
 
5
  ---- s2member Shortcode Equivalent ----
6
 
7
+ [s2If is_user_logged_in()]
8
  content goes here
9
+ [/s2If]
includes/menu-pages/code-samples/sc-current-user-can-full-access.php CHANGED
@@ -1,7 +1,7 @@
1
- [s2All current_user_can="access_s2member_level1"]
2
  Some content for Members who are logged in with an s2Member Level >= 1.
3
- [/s2All]
4
 
5
- [s2All current_user_cannot="access_s2member_level1"]
6
  Some public content.
7
- [/s2All]
1
+ [s2If current_user_can(access_s2member_level1)]
2
  Some content for Members who are logged in with an s2Member Level >= 1.
3
+ [/s2If]
4
 
5
+ [s2If !current_user_can(access_s2member_level1)]
6
  Some public content.
7
+ [/s2If]
includes/menu-pages/code-samples/sc-current-user-is-specific-content.php CHANGED
@@ -1,23 +1,23 @@
1
- [s2All current_user_is="s2member_level4"]
2
  Some premium content for Level 4 Members.
3
- [/s2All]
4
 
5
- [s2All current_user_is="s2member_level3"]
6
  Some premium content for Level 3 Members.
7
- [/s2All]
8
 
9
- [s2All current_user_is="s2member_level2"]
10
  Some premium content for Level 2 Members.
11
- [/s2All]
12
 
13
- [s2All current_user_is="s2member_level1"]
14
  Some premium content for Level 1 Members.
15
- [/s2All]
16
 
17
- [s2All current_user_is="s2member_level0"]
18
  Some content for Free Subscribers.
19
- [/s2All]
20
 
21
- [s2All current_user_cannot="access_s2member_level0"]
22
  Some public content.
23
- [/s2All]
1
+ [s2If current_user_is(s2member_level4)]
2
  Some premium content for Level 4 Members.
3
+ [/s2If]
4
 
5
+ [s2If current_user_is(s2member_level3)]
6
  Some premium content for Level 3 Members.
7
+ [/s2If]
8
 
9
+ [s2If current_user_is(s2member_level2)]
10
  Some premium content for Level 2 Members.
11
+ [/s2If]
12
 
13
+ [s2If current_user_is(s2member_level1)]
14
  Some premium content for Level 1 Members.
15
+ [/s2If]
16
 
17
+ [s2If current_user_is(s2member_level0)]
18
  Some content for Free Subscribers.
19
+ [/s2If]
20
 
21
+ [s2If !current_user_can(access_s2member_level0)]
22
  Some public content.
23
+ [/s2If]
includes/menu-pages/code-samples/sc-is-user-logged-in.php CHANGED
@@ -1,7 +1,8 @@
1
- [s2All is_user_logged_in="yes"]
2
  Content for anyone that is logged in, regardless of their Membership Level.
3
- [/s2All]
4
 
5
- [s2All is_user_logged_in="no"]
6
  Some public content. They're NOT logged in.
7
- [/s2All]
 
1
+ [s2If is_user_logged_in()]
2
  Content for anyone that is logged in, regardless of their Membership Level.
3
+ [/s2If]
4
 
5
+ [s2If !is_user_logged_in()]
6
  Some public content. They're NOT logged in.
7
+ A leading !exclamation means false.
8
+ [/s2If]
includes/menu-pages/code-samples/sc-s2-conditional-nesting.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ [s2If is_user_logged_in() AND current_user_is(s2member_level1)]
2
+ [_s2If is_page(1) OR is_page(2)]
3
+ content appears here
4
+ [/_s2If]
5
+ [/s2If]
includes/menu-pages/code-samples/sc-s2-conditional-supplements-1.php CHANGED
@@ -1,19 +1,19 @@
1
- [s2All current_user_is="s2member_level1"]
2
  Content for Members at exactly Level# 1, on this Blog.
3
- [/s2All]
4
 
5
- [s2Any current_user_is="s2member_level2" current_user_is_for_blog="24,s2member_level2"]
6
 
7
  They are either a Level #2 Member on this Blog,
8
  OR ... they're at Level# 2 on Blog ID# 24 ( i.e. Multisite Networking )
9
 
10
- * Note the use of `s2Any` here. True if ANY/either condition is met.
11
 
12
- [/s2Any]
13
 
14
- [s2Any current_user_is="s2member_level3" current_user_is="s2member_level4"]
15
 
16
- Content for Level #3 - and/or - Level #4 Members. Either/or.
17
 
18
  Hi there [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /].
19
  You have a [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /] Membership.
@@ -25,4 +25,4 @@
25
  `Hi there John.
26
  You have a Gold Membership.`
27
 
28
- [/s2Any]
1
+ [s2If current_user_is(s2member_level1)]
2
  Content for Members at exactly Level# 1, on this Blog.
3
+ [/s2If]
4
 
5
+ [s2If current_user_is(s2member_level2) OR current_user_is_for_blog(24,s2member_level2)]
6
 
7
  They are either a Level #2 Member on this Blog,
8
  OR ... they're at Level# 2 on Blog ID# 24 ( i.e. Multisite Networking )
9
 
10
+ * Note the use of `OR` here. True if either condition is met.
11
 
12
+ [/s2If]
13
 
14
+ [s2If current_user_is(s2member_level3) OR current_user_is(s2member_level4)]
15
 
16
+ Content for Level #3 - OR - Level #4 Members. Either/or.
17
 
18
  Hi there [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /].
19
  You have a [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /] Membership.
25
  `Hi there John.
26
  You have a Gold Membership.`
27
 
28
+ [/s2If]
includes/menu-pages/code-samples/sc-s2-conditional-supplements-2.php CHANGED
@@ -1,8 +1,8 @@
1
- [s2All current_user_can="access_s2member_ccap_free_gift"]
2
  Display free gift here. This Member has access to a Custom Capability that supplies a free gift.
3
- [/s2All]
4
 
5
- [s2All current_user_cannot="access_s2member_level4"]
6
 
7
  Content for someone who does NOT have Level #4 access.
8
  Possibly an Upgrade Button here.
@@ -10,25 +10,25 @@
10
  Nested PayPal Form/Button Shortcodes ARE fine.
11
  [s2Member-PayPal-Button level="4" ra="49.95" /]
12
 
13
- [/s2All]
14
 
15
- [s2All current_user_is="administrator"]
16
  Content specifically for a WordPress® Administrator.
17
- [/s2All]
18
 
19
- [s2All current_user_is="editor"]
20
  Content specifically for a WordPress® Editor.
21
- [/s2All]
22
 
23
- [s2All current_user_is="author"]
24
  Content specifically for a WordPress® Author.
25
- [/s2All]
26
 
27
- [s2All current_user_is="contributor"]
28
  Content specifically for a WordPress® Contributor.
29
- [/s2All]
30
 
31
- [s2All current_user_is="subscriber"]
32
  Content specifically for a WordPress® Subscriber.
33
  ( aka: s2member_level0 )
34
- [/s2All]
1
+ [s2If current_user_can(access_s2member_ccap_free_gift)]
2
  Display free gift here. This Member has access to a Custom Capability that supplies a free gift.
3
+ [/s2If]
4
 
5
+ [s2If !current_user_can(access_s2member_level4)]
6
 
7
  Content for someone who does NOT have Level #4 access.
8
  Possibly an Upgrade Button here.
10
  Nested PayPal Form/Button Shortcodes ARE fine.
11
  [s2Member-PayPal-Button level="4" ra="49.95" /]
12
 
13
+ [/s2If]
14
 
15
+ [s2If current_user_is(administrator)]
16
  Content specifically for a WordPress® Administrator.
17
+ [/s2If]
18
 
19
+ [s2If current_user_is(editor)]
20
  Content specifically for a WordPress® Editor.
21
+ [/s2If]
22
 
23
+ [s2If current_user_is(author)]
24
  Content specifically for a WordPress® Author.
25
+ [/s2If]
26
 
27
+ [s2If current_user_is(contributor)]
28
  Content specifically for a WordPress® Contributor.
29
+ [/s2If]
30
 
31
+ [s2If current_user_is(subscriber)]
32
  Content specifically for a WordPress® Subscriber.
33
  ( aka: s2member_level0 )
34
+ [/s2If]
includes/menu-pages/code-samples/sc-s2-conditional-supplements-3.php CHANGED
@@ -1,31 +1,37 @@
1
- [s2All current_user_cannot="access_s2member_level4" current_user_can="access_s2member_level2"]
2
 
3
  This Member CANNOT access Level #4,
4
- but... they CAN access Level #2.
5
 
6
- [_s2All current_user_can="access_s2member_ccap_free_gift"]
7
 
8
  Display free gift here. This is a Custom Capability check, using a nested Conditional.
9
- Notice that NESTED Conditionals require a preceding underscore ( i.e. _s2All ).
10
- You can go up to three levels deep ( ___s2All ).
11
 
12
  Nested PayPal Form/Button Shortcodes ARE fine too.
13
  However, you do NOT need a preceding underscore on Form/Button codes. Or any other Shortcode for that matter.
14
- You ONLY need the preceding underscore on _s2All _s2Any Conditionals that are being nested into each other.
15
 
16
  ( Hi [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /], upgrade now to Level #4! )
17
  [s2Member-PayPal-Button level="4" ra="49.95" ... /]
18
  ~ see, this will work just fine.
19
 
20
- [/_s2All]
21
 
22
- [/s2All]
23
 
24
- [s2All current_user_cannot="access_s2member_level4" current_user_cannot="access_s2member_level3" current_user_cannot="access_s2member_level2" current_user_can="access_s2member_level1"]
25
  Content for Members who can ONLY access Level #1 on this Blog.
26
- [/s2All]
 
27
 
28
- [s2All current_user_is="s2member_level1"]
 
 
 
 
 
29
  Content for Members who can ONLY access Level #1 on this Blog.
30
  ~ Same thing, only this is MUCH simpler, less typing.
31
- [/s2All]
1
+ [s2If current_user_cannot(access_s2member_level4) AND current_user_can(access_s2member_level2)]
2
 
3
  This Member CANNOT access Level #4,
4
+ but, they CAN access Level #2.
5
 
6
+ [_s2If current_user_can(access_s2member_ccap_free_gift)]
7
 
8
  Display free gift here. This is a Custom Capability check, using a nested Conditional.
9
+ Notice that NESTED Conditionals require a preceding underscore ( i.e. _s2If, __s2If, ___s2If ).
10
+ You can go up to three levels deep ( ___s2If ).
11
 
12
  Nested PayPal Form/Button Shortcodes ARE fine too.
13
  However, you do NOT need a preceding underscore on Form/Button codes. Or any other Shortcode for that matter.
14
+ You ONLY need the preceding underscore on _s2If Conditionals that are being nested into each other.
15
 
16
  ( Hi [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /], upgrade now to Level #4! )
17
  [s2Member-PayPal-Button level="4" ra="49.95" ... /]
18
  ~ see, this will work just fine.
19
 
20
+ [/_s2If]
21
 
22
+ [/s2If]
23
 
24
+ [s2If !current_user_can(access_s2member_level4) AND !current_user_can(access_s2member_level3) AND !current_user_can(access_s2member_level2) AND current_user_can(access_s2member_level1)]
25
  Content for Members who can ONLY access Level #1 on this Blog.
26
+ ~ The following 2 examples below, say the same thing.
27
+ [/s2If]
28
 
29
+ [s2If current_user_cannot(access_s2member_level4) AND current_user_cannot(access_s2member_level3) AND current_user_cannot(access_s2member_level2) AND current_user_can(access_s2member_level1)]
30
+ Content for Members who can ONLY access Level #1 on this Blog.
31
+ ~ Same thing, only this uses explicit false tests.
32
+ [/s2If]
33
+
34
+ [s2If current_user_is(s2member_level1)]
35
  Content for Members who can ONLY access Level #1 on this Blog.
36
  ~ Same thing, only this is MUCH simpler, less typing.
37
+ [/s2If]
includes/menu-pages/mms-options.inc.php CHANGED
@@ -51,11 +51,11 @@ if (is_multisite () && is_main_site ()) /* These panels will ONLY be available o
51
  echo '<h3>Rather Do It Yourself? ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-mms-patches-details\').toggle(); return false;" class="ws-dotted-link">manual instructions</a> )</h3>' . "\n";
52
  echo '<div id="ws-plugin--s2member-mms-patches-details" style="display:none;">' . "\n";
53
  echo '<p><strong>Patch #1</strong> ( /wp-login.php )</p>' . "\n";
54
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-wp-login.php"), true) . '</p>' . "\n";
55
  echo '<p><strong>Patch #2</strong> ( /wp-includes/load.php )</p>' . "\n";
56
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-load.php"), true) . '</p>' . "\n";
57
  echo '<p><strong>Patch #3</strong> ( /wp-admin/user-new.php )</p>' . "\n";
58
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-user-new.php"), true) . '</p>' . "\n";
59
  echo '</div>' . "\n";
60
  echo '</div>' . "\n";
61
  /**/
51
  echo '<h3>Rather Do It Yourself? ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-mms-patches-details\').toggle(); return false;" class="ws-dotted-link">manual instructions</a> )</h3>' . "\n";
52
  echo '<div id="ws-plugin--s2member-mms-patches-details" style="display:none;">' . "\n";
53
  echo '<p><strong>Patch #1</strong> ( /wp-login.php )</p>' . "\n";
54
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-wp-login.php")) . '</p>' . "\n";
55
  echo '<p><strong>Patch #2</strong> ( /wp-includes/load.php )</p>' . "\n";
56
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-load.php")) . '</p>' . "\n";
57
  echo '<p><strong>Patch #3</strong> ( /wp-admin/user-new.php )</p>' . "\n";
58
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/mms-patch-user-new.php")) . '</p>' . "\n";
59
  echo '</div>' . "\n";
60
  echo '</div>' . "\n";
61
  /**/
includes/menu-pages/options.inc.php CHANGED
@@ -1372,13 +1372,13 @@ if (apply_filters ("ws_plugin__s2member_during_options_page_during_left_sections
1372
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
1373
  /**/
1374
  echo '<p><strong>Code Sample #1</strong> ( standard link tag ):</p>' . "\n";
1375
- echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php")), true) . '</p>' . "\n";
1376
  /**/
1377
  echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
1378
- echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.php")), true) . '</p>' . "\n";
1379
  /**/
1380
  echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
1381
- echo '<p>' . highlight_string (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.php")), true) . '</p>' . "\n";
1382
  echo '<table class="form-table">' . "\n";
1383
  echo '<tbody>' . "\n";
1384
  echo '<tr>' . "\n";
1372
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
1373
  /**/
1374
  echo '<p><strong>Code Sample #1</strong> ( standard link tag ):</p>' . "\n";
1375
+ echo '<p>' . ws_plugin__s2member_highlight_php (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php"))) . '</p>' . "\n";
1376
  /**/
1377
  echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
1378
+ echo '<p>' . ws_plugin__s2member_highlight_php (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.php"))) . '</p>' . "\n";
1379
  /**/
1380
  echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
1381
+ echo '<p>' . ws_plugin__s2member_highlight_php (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", ws_plugin__s2member_esc_ds (get_bloginfo ("wpurl") . "/?s2member_profile=1"), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.php"))) . '</p>' . "\n";
1382
  echo '<table class="form-table">' . "\n";
1383
  echo '<tbody>' . "\n";
1384
  echo '<tr>' . "\n";
includes/menu-pages/scripting.inc.php CHANGED
@@ -12,7 +12,7 @@ If not, see: <http://www.gnu.org/licenses/>.
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
- exit("Do not access this file directly.");
16
  /*
17
  API Scripting page.
18
  */
@@ -54,40 +54,40 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
54
  echo '<div class="ws-menu-page-group" title="Using Simple Conditionals">' . "\n";
55
  /**/
56
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
57
- echo '<h3>The Simple Way ( no scripting required, just Shortcodes )</h3>' . "\n";
58
- echo '<p>In an effort to give you even more control over access restrictions, s2Member makes Simple Conditionals available to you from within WordPress®, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress®. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in="yes|no"</code></strong>, <strong><code>is_user_not_logged_in="yes|no"</code></strong>, <strong><code>current_user_is="role"</code></strong>, <strong><code>current_user_is_not="role"</code></strong>, <strong><code>current_user_can="capability"</code></strong>, <strong><code>current_user_cannot="capability"</code></strong>, <strong><code>current_user_is_for_blog="blog_id,role"</code></strong>, <strong><code>current_user_is_not_for_blog="blog_id,role"</code></strong>, <strong><code>current_user_can_for_blog="blog_id,capability"</code></strong>, &amp; <strong><code>current_user_cannot_for_blog="blog_id,capability"</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Members\'s Level, or even based on Custom Capabilities. s2Member\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
59
- echo '<p><em>There are <strong>three different Shortcodes</strong> that work with Simple Conditionals.<br /><strong>1. <code>s2All</code></strong> ( true, if all conditions are met ).<br /><strong>2. <code>s2Any</code></strong> ( true, if any condition is met ).<br /><strong>3. <code>s2Get</code></strong> ( to get an API Constant value ).</em></p>' . "\n";
60
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars ());
61
  /**/
62
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
63
  /**/
64
  echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
65
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sc-is-user-logged-in.php"), true) . '</p>' . "\n";
66
  /**/
67
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
68
  /**/
69
  echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
70
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sc-current-user-can-full-access.php"), true) . '</p>' . "\n";
71
  /**/
72
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
73
  /**/
74
  echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
75
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sc-current-user-is-specific-content.php"), true) . '</p>' . "\n";
76
  /**/
77
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
78
  /**/
79
  echo '<p><strong>Example #4:</strong> Using s2Member API Conditionals, supplementing WordPress® core functions.</strong></p>' . "\n";
80
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sc-s2-conditional-supplements-1.php"), true) . '</p>' . "\n";
81
  /**/
82
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
83
  /**/
84
  echo '<p><strong>Example #5:</strong> Using multiple Conditionals together, and even nesting other Shortcodes.</strong></p>' . "\n";
85
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sc-s2-conditional-supplements-2.php"), true) . '</p>' . "\n";
86
  /**/
87
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
88
  /**/
89
  echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
90
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sc-s2-conditional-supplements-3.php"), true) . '</p>' . "\n";
91
  /**/
92
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
93
  /**/
@@ -97,8 +97,16 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
97
  /**/
98
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
99
  /**/
100
- echo '<p><em>s2Member supports ALL <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank" rel="external">Conditional Tags</a> in WordPress®. Including, but not limited to: <strong><code>is_multisite="yes|no"</code></strong>, <strong><code>is_main_site="yes|no"</code></strong>, <strong><code>is_super_admin="yes|no"</code></strong>, <strong><code>is_admin="yes|no"</code></strong>, <strong><code>is_404="yes|no"</code></strong>, <strong><code>is_home="yes|no"</code></strong>, <strong><code>is_front_page="yes|no"</code></strong>, <strong><code>is_comments_popup="yes|no"</code></strong>, <strong><code>is_singular="yes|no|ID|slug|array(slug,ID)"</code></strong>, <strong><code>is_single="yes|no|ID|slug|array(slug,ID)"</code></strong>, <strong><code>is_page="yes|no|ID|slug|array(slug,ID)"</code></strong>, <strong><code>is_page_template="yes|no|file.php"</code></strong>, <strong><code>is_attachment="yes|no"</code></strong>, <strong><code>is_feed="yes|no"</code></strong>, <strong><code>is_trackback="yes|no"</code></strong>, <strong><code>is_archive="yes|no"</code></strong>, <strong><code>is_search="yes|no"</code></strong>, <strong><code>is_category="yes|no|ID|slug|array(slug,ID)"</code></strong>, <strong><code>is_tax="taxonomy,term"</code></strong>, <strong><code>is_tag="yes|no|slug|array(slug,slug)"</code></strong>, <strong><code>has_tag="yes|no|slug|array(slug,slug)"</code></strong>, <strong><code>is_author="yes|no|ID|slug|array(slug,ID)"</code></strong>, <strong><code>is_date="yes|no"</code></strong>, <strong><code>is_day="yes|no"</code></strong>, <strong><code>is_month="yes|no"</code></strong>, <strong><code>is_time="yes|no"</code></strong>, <strong><code>is_year="yes|no"</code></strong>, <strong><code>is_sticky="yes|no|ID"</code></strong>, <strong><code>is_paged="yes|no"</code></strong>, <strong><code>is_preview="yes|no"</code></strong>, <strong><code>comments_open="yes|no"</code></strong>, <strong><code>pings_open="yes|no"</code></strong>, <strong><code>has_excerpt="yes|no|ID"</code></strong>, <strong><code>in_the_loop="yes|no"</code></strong>, <strong><code>is_active_sidebar="ID|number"</code></strong>.</em></p>' . "\n";
101
- echo '<p><em>Passing arguments into a Shortcode attribute:<br /><br />1. yes|no ( ex: <code>is_page="yes"</code> )<br />1. ID ( ex: <code>is_page="24"</code> )<br />3. slug ( ex: <code>is_page="my-cool-page"</code><br />4. array ( ex: <code>is_page="array(my-cool-page,24,about,contact-form)"</code><br /><br />*Tip: do NOT use spaces in attribute values.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_page="My Membership Options Page"</code><br />- use slugs or IDs instead, no spaces.</em></p>' . "\n";
 
 
 
 
 
 
 
 
102
  echo '</div>' . "\n";
103
  /**/
104
  echo '</div>' . "\n";
@@ -120,42 +128,42 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
120
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
121
  /**/
122
  echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
123
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/is-user-logged-in.php"), true) . '</p>' . "\n";
124
  /**/
125
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
126
  /**/
127
  echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
128
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-full-access.php"), true) . '</p>' . "\n";
129
  /**/
130
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
131
  /**/
132
  echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
133
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-is-specific-content.php"), true) . '</p>' . "\n";
134
  /**/
135
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
136
  /**/
137
  echo '<p><strong>Example #4:</strong> Using s2Member API Conditionals, supplementing WordPress® core functions.</strong></p>' . "\n";
138
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/s2-conditional-supplements-1.php"), true) . '</p>' . "\n";
139
  /**/
140
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
141
  /**/
142
  echo '<p><strong>Example #5:</strong> Using s2Member API Conditionals, supplementing WordPress® core functions.</strong></p>' . "\n";
143
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/s2-conditional-supplements-2.php"), true) . '</p>' . "\n";
144
  /**/
145
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
146
  /**/
147
  echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
148
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/s2-conditional-supplements-3.php"), true) . '</p>' . "\n";
149
  /**/
150
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
151
  /**/
152
  echo '<p><strong>Example #7:</strong> Using s2Member API Constants, instead of conditional functions.</strong></p>' . "\n";
153
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-constants-1.php"), true) . '</p>' . "\n";
154
  /**/
155
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
156
  /**/
157
  echo '<p><strong>Example #8:</strong> Using s2Member API Constants, instead of conditional functions.</strong></p>' . "\n";
158
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-constants-2.php"), true) . '</p>' . "\n";
159
  /**/
160
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
161
  /**/
@@ -187,10 +195,10 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
187
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
188
  /**/
189
  echo '<p><strong>Custom Capabilities:</strong> ( music,videos ):</p>' . "\n";
190
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-1.php"), true) . '</p>' . "\n";
191
  /**/
192
  echo '<p><strong>Custom Capabilities:</strong> ( ebooks,reports,tips ):</p>' . "\n";
193
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-2.php"), true) . '</p>' . "\n";
194
  echo '</div>' . "\n";
195
  /**/
196
  echo '</div>' . "\n";
@@ -216,7 +224,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
216
  echo '<p>Sub-Directory: <code>/s2member-files/access-s2member-ccap-music</code><br />Sub-Directory: <code>/s2member-files/access-s2member-ccap-videos</code></p>' . "\n";
217
  echo '<p>Protected File: <code>/s2member-files/access-s2member-ccap-music/file.mp3</code><br />Protected File: <code>/s2member-files/access-s2member-ccap-videos/file.avi</code></p>' . "\n";
218
  echo '<p>Now, here are some link examples, using Custom Capability Sub-directories:</p>' . "\n";
219
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/ccap-file-downloads.php"), true) . '</p>' . "\n";
220
  echo '<p><em>These links will ONLY work for Members who are logged-in, with the proper Capabilities.</em></p>' . "\n";
221
  /**/
222
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
@@ -225,7 +233,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
225
  echo '<p>Sub-Directory: <code>/s2member-files/access-s2member-level0</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level1</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level2</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level3</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level4</code></p>' . "\n";
226
  echo '<p>Protected File: <code>/s2member-files/access-s2member-level0/tiger.doc</code><br />Protected File: <code>/s2member-files/access-s2member-level1/zebra.pdf</code><br />Protected File: <code>/s2member-files/access-s2member-level2/elephant.doc</code><br />Protected File: <code>/s2member-files/access-s2member-level3/rhino.pdf</code><br />Protected File: <code>/s2member-files/access-s2member-level4/lion.doc</code></p>' . "\n";
227
  echo '<p>Now, here are some link examples, using Member Level Sub-directories:</p>' . "\n";
228
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level-file-downloads.php"), true) . '</p>' . "\n";
229
  echo '<p><em>These links will ONLY work for Members who are logged-in, with an adequate Membership Level.</em></p>' . "\n";
230
  echo '</div>' . "\n";
231
  /**/
@@ -245,7 +253,7 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
245
  echo '<p>Content Dripping is the gradual, pre-scheduled release of premium website content to paying Members. This has become increasingly popular, because it allows older Members; those who have paid you more, due to recurring charges; to acquire access to more content progressively; based on their original registration date. It also gives you ( as the site owner ), the ability to launch multiple membership site portals, operating on autopilot, without any direct day-to-day involvement in a content release process. This requires some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a> ).</p>' . "\n";
246
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_dripping", get_defined_vars ());
247
  echo '<p><strong>To drip content, use <code>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</code>:</strong></p>' . "\n";
248
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-registration-days-dripping.php"), true) . '</p>' . "\n";
249
  echo '</div>' . "\n";
250
  /**/
251
  echo '</div>' . "\n";
@@ -273,13 +281,13 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
273
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
274
  /**/
275
  echo '<p><strong>Code Sample #1</strong> ( standard link tag ):</p>' . "\n";
276
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php"), true) . '</p>' . "\n";
277
  /**/
278
  echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
279
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.php"), true) . '</p>' . "\n";
280
  /**/
281
  echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
282
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.php"), true) . '</p>' . "\n";
283
  echo '</div>' . "\n";
284
  /**/
285
  echo '</div>' . "\n";
@@ -307,24 +315,24 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
307
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
308
  /**/
309
  echo '<p><strong>S2MEMBER_VERSION</strong><br />This will always be a (string) with the current s2Member version. Available since s2Member 3.0.</p>' . "\n";
310
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/version.php"), true) . '</p>' . "\n";
311
  /**/
312
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
313
  /**/
314
  echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN</strong><br />This will always be (bool) true or false. True if a User/Member is currently logged in with an Access Level >= 0.</p>' . "\n";
315
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-is-logged-in.php"), true) . '</p>' . "\n";
316
  echo '<p><em>See <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
317
  /**/
318
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
319
  /**/
320
  echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER</strong><br />This will always be (bool) true or false. True if a Member is currently logged in with an Access Level >= 1.</p>' . "\n";
321
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-is-logged-in-as-member.php"), true) . '</p>' . "\n";
322
  echo '<p><em>See <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
323
  /**/
324
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
325
  /**/
326
  echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) -1 thru 4. -1 if not logged in. 0 if logged in as a Free Subscriber.</p>' . "\n";
327
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-level.php"), true) . '</p>' . "\n";
328
  echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
329
  echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.</p>' . "\n";
330
  echo '<p><em>* WordPress® Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress® Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
@@ -332,248 +340,248 @@ if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sectio
332
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
333
  /**/
334
  echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LABEL</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
335
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-label.php"), true) . '</p>' . "\n";
336
  /**/
337
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
338
  /**/
339
  echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_ID</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
340
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-subscr-id.php"), true) . '</p>' . "\n";
341
  /**/
342
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
343
  /**/
344
  echo '<p><strong>S2MEMBER_CURRENT_USER_CUSTOM</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
345
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-custom.php"), true) . '</p>' . "\n";
346
  /**/
347
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
348
  /**/
349
  echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. 0 if not logged in. This holds the recorded time at which the Member originally registered their Username for access to your site. This is useful if you want to drip content over an extended period of time, based on how long someone has been a Member.</p>' . "\n";
350
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-registration-time.php"), true) . '</p>' . "\n";
351
  /**/
352
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
353
  /**/
354
  echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</strong><br />This will always be an (int). 0 if not logged in. This is the number of days that have passed since the Member originally registered their Username for access to your site. This is useful if you want to drip content over an extended period of time, based on how long someone has been a Member.</p>' . "\n";
355
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-registration-days.php"), true) . '</p>' . "\n";
356
  /**/
357
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
358
  /**/
359
  echo '<p><strong>S2MEMBER_CURRENT_USER_DISPLAY_NAME</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
360
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-display-name.php"), true) . '</p>' . "\n";
361
  /**/
362
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
363
  /**/
364
  echo '<p><strong>S2MEMBER_CURRENT_USER_FIRST_NAME</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
365
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-first-name.php"), true) . '</p>' . "\n";
366
  /**/
367
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
368
  /**/
369
  echo '<p><strong>S2MEMBER_CURRENT_USER_LAST_NAME</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
370
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-last-name.php"), true) . '</p>' . "\n";
371
  /**/
372
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
373
  /**/
374
  echo '<p><strong>S2MEMBER_CURRENT_USER_LOGIN</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
375
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-login.php"), true) . '</p>' . "\n";
376
  /**/
377
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
378
  /**/
379
  echo '<p><strong>S2MEMBER_CURRENT_USER_EMAIL</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
380
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-email.php"), true) . '</p>' . "\n";
381
  /**/
382
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
383
  /**/
384
  echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string). Empty if browsing anonymously.</p>' . "\n";
385
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-ip.php"), true) . '</p>' . "\n";
386
  /**/
387
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
388
  /**/
389
  echo '<p><strong>S2MEMBER_CURRENT_USER_ID</strong><br />This will always be an (int). However, it will be 0 if not logged in.</p>' . "\n";
390
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-id.php"), true) . '</p>' . "\n";
391
  /**/
392
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
393
  /**/
394
  echo '<p><strong>S2MEMBER_CURRENT_USER_FIELDS</strong><br />This will always be a JSON encoded array, in (string) format. An empty JSON encoded array, in (string) format, if not logged in. This JSON encoded array will contain the following fields: <code>id, ip, email, login, first_name, last_name, display_name, subscr_id, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. For example, if you configured the Custom Field: <code>Street Address</code>, it would be included in this array as: <code>street_address</code>. Custom Field references are converted to lowercase format, and spaces are replaced by underscores. You can do <code>print_r(json_decode(S2MEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
395
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-fields.php"), true) . '</p>' . "\n";
396
  /**/
397
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
398
  /**/
399
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED</strong><br />This will always be an (int) value >= 0 where 0 means no access.</p>' . "\n";
400
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-allowed.php"), true) . '</p>' . "\n";
401
  /**/
402
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
403
  /**/
404
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED</strong><br />This will always be (bool) true or false. A value of true means their allowed downloads are >= 999999999, and false means it is not. This is useful if you are allowing unlimited ( 999999999 ) downloads on some membership levels. You can display `Unlimited` instead of a number.</p>' . "\n";
405
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-allowed-is-unlimited.php"), true) . '</p>' . "\n";
406
  /**/
407
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
408
  /**/
409
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY</strong><br />This will always be an (int) value >= 0 where 0 means none.</p>' . "\n";
410
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-currently.php"), true) . '</p>' . "\n";
411
  /**/
412
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
413
  /**/
414
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS</strong><br />This will always be an (int) value >= 0 where 0 means no access.</p>' . "\n";
415
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-allowed-days.php"), true) . '</p>' . "\n";
416
  /**/
417
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
418
  /**/
419
  echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is where a Member can modify their Profile.</p>' . "\n";
420
  echo '<p><strong>Code Sample #1</strong> ( standard link ):</p>' . "\n";
421
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php"), true) . '</p>' . "\n";
422
  echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
423
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.php"), true) . '</p>' . "\n";
424
  echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
425
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.php"), true) . '</p>' . "\n";
426
  /**/
427
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
428
  /**/
429
  echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL</strong><br />This is the full URL to the Limit Exceeded Page ( informational ).</p>' . "\n";
430
  echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
431
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/file-download-limit-exceeded-page-url.php"), true) . '</p>' . "\n";
432
  /**/
433
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
434
  /**/
435
  echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL</strong><br />This is the full URL to the Membership Options Page ( the signup page ).</p>' . "\n";
436
  echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
437
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/membership-options-page-url.php"), true) . '</p>' . "\n";
438
  /**/
439
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
440
  /**/
441
  echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_URL</strong><br />This is the full URL to the Login Welcome Page ( the User\'s account page ). * This could also be the full URL to a Special Redirection URL ( if you configured one ). See <code>s2Member -> General Options -> Login Welcome Page</code>.</p>' . "\n";
442
  echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL. * In the case of a Special Redirection URL, this ID is not really applicable.</p>' . "\n";
443
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/login-welcome-page-url.php"), true) . '</p>' . "\n";
444
  /**/
445
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
446
  /**/
447
  echo '<p><strong>S2MEMBER_LOGIN_PAGE_URL</strong><br />This is the full URL to the Membership Login Page ( the WordPress® login page ).</p>' . "\n";
448
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/login-page-url.php"), true) . '</p>' . "\n";
449
  /**/
450
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
451
  /**/
452
  echo '<p><strong>S2MEMBER_LOGOUT_PAGE_URL</strong><br />This is the full URL to the Membership Logout Page ( the WordPress® logout page ).</p>' . "\n";
453
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/logout-page-url.php"), true) . '</p>' . "\n";
454
  /**/
455
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
456
  /**/
457
  echo '<p><strong>S2MEMBER_LEVEL0_LABEL</strong><br />This is the (string) Label that you created for Membership Level 0.</p>' . "\n";
458
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level0-label.php"), true) . '</p>' . "\n";
459
  /**/
460
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
461
  /**/
462
  echo '<p><strong>S2MEMBER_LEVEL1_LABEL</strong><br />This is the (string) Label that you created for Membership Level 1.</p>' . "\n";
463
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level1-label.php"), true) . '</p>' . "\n";
464
  /**/
465
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
466
  /**/
467
  echo '<p><strong>S2MEMBER_LEVEL2_LABEL</strong><br />This is the (string) Label that you created for Membership Level 2.</p>' . "\n";
468
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level2-label.php"), true) . '</p>' . "\n";
469
  /**/
470
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
471
  /**/
472
  echo '<p><strong>S2MEMBER_LEVEL3_LABEL</strong><br />This is the (string) Label that you created for Membership Level 3.</p>' . "\n";
473
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level3-label.php"), true) . '</p>' . "\n";
474
  /**/
475
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
476
  /**/
477
  echo '<p><strong>S2MEMBER_LEVEL4_LABEL</strong><br />This is the (string) Label that you created for Membership Level 4.</p>' . "\n";
478
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level4-label.php"), true) . '</p>' . "\n";
479
  /**/
480
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
481
  /**/
482
  echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 0.</p>' . "\n";
483
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level0-file-downloads-allowed.php"), true) . '</p>' . "\n";
484
  /**/
485
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
486
  /**/
487
  echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 1.</p>' . "\n";
488
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level1-file-downloads-allowed.php"), true) . '</p>' . "\n";
489
  /**/
490
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
491
  /**/
492
  echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 2.</p>' . "\n";
493
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level2-file-downloads-allowed.php"), true) . '</p>' . "\n";
494
  /**/
495
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
496
  /**/
497
  echo '<p><strong>S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 3.</p>' . "\n";
498
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level3-file-downloads-allowed.php"), true) . '</p>' . "\n";
499
  /**/
500
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
501
  /**/
502
  echo '<p><strong>S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 4.</p>' . "\n";
503
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level4-file-downloads-allowed.php"), true) . '</p>' . "\n";
504
  /**/
505
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
506
  /**/
507
  echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 0.</p>' . "\n";
508
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level0-file-downloads-allowed-days.php"), true) . '</p>' . "\n";
509
  /**/
510
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
511
  /**/
512
  echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 1.</p>' . "\n";
513
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level1-file-downloads-allowed-days.php"), true) . '</p>' . "\n";
514
  /**/
515
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
516
  /**/
517
  echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 2.</p>' . "\n";
518
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level2-file-downloads-allowed-days.php"), true) . '</p>' . "\n";
519
  /**/
520
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
521
  /**/
522
  echo '<p><strong>S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 3.</p>' . "\n";
523
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level3-file-downloads-allowed-days.php"), true) . '</p>' . "\n";
524
  /**/
525
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
526
  /**/
527
  echo '<p><strong>S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 4.</p>' . "\n";
528
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/level4-file-downloads-allowed-days.php"), true) . '</p>' . "\n";
529
  /**/
530
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
531
  /**/
532
  echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
533
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/file-download-inline-extensions.php"), true) . '</p>' . "\n";
534
  /**/
535
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
536
  /**/
537
  echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
538
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/reg-email-from-name.php"), true) . '</p>' . "\n";
539
  /**/
540
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
541
  /**/
542
  echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_EMAIL</strong><br />This is the Email Address that outgoing messages are sent by.</p>' . "\n";
543
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/reg-email-from-email.php"), true) . '</p>' . "\n";
544
  /**/
545
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
546
  /**/
547
  echo '<p><strong>S2MEMBER_PAYPAL_NOTIFY_URL</strong><br />This is the URL on your system that receives PayPal® IPN responses.</p>' . "\n";
548
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-notify-url.php"), true) . '</p>' . "\n";
549
  /**/
550
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
551
  /**/
552
  echo '<p><strong>S2MEMBER_PAYPAL_RETURN_URL</strong><br />This is the URL on your system that receives PayPal® return variables.</p>' . "\n";
553
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-return-url.php"), true) . '</p>' . "\n";
554
  /**/
555
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
556
  /**/
557
  echo '<p><strong>S2MEMBER_PAYPAL_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal® server.</p>' . "\n";
558
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-endpoint.php"), true) . '</p>' . "\n";
559
  /**/
560
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
561
  /**/
562
  echo '<p><strong>S2MEMBER_PAYPAL_BUSINESS</strong><br />This is the Email Address that identifies your PayPal® Business.</p>' . "\n";
563
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-business.php"), true) . '</p>' . "\n";
564
  /**/
565
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
566
  /**/
567
  echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong><br />This auto-fills the <code>on0</code> value in PayPal® Button Codes.<br />If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>on0</code> input variable, with the string: <code>"Updating Subscr. ID"</code>. Otherwise, it will be an empty string.</p>' . "\n";
568
  echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong><br />This auto-fills the <code>os0</code> value in PayPal® Button Codes.<br />If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>os0</code> input variable, with the value of <code>S2MEMBER_CURRENT_USER_SUBSCR_ID</code>. Otherwise, it will be an empty string.</p>' . "\n";
569
  echo '<p>These two Constants are special. They are used by the PayPal® Button Generator for s2Member. This is how s2Member identifies an existing Member ( and/or a Free Subscriber ), who is already logged in when they click a PayPal® Modification Button that was generated for you by s2Member. Instead of forcing a Member ( and/or a Free Subscriber ) to re-register for a new account, s2Member can identify their existing account, and update it, according to the modified terms in your Button Code. These three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal® Buttons ( recommended ), you won\'t even see these, because they\'re added internally by the Shortcode processor. Anyway, they\'re just documented here for clarity; you probably won\'t use these directly; the Button Code Generator pops them in.</p>' . "\n";
570
- echo '<p><em>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-value-for-pp-on0-os0.php"), true) . '</em></p>' . "\n";
571
  echo '<p>If you\'d like to give your Members ( and/or your Free Subscribers ) the ability to modify their billing plan, by switching to a more expensive option, or a less expensive option; generate a new PayPal® Modification Button, using the s2Member PayPal® Button Generator. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Button available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade Button into your Login Welcome Page, which would up-sell existing Level #1 Members to a more expensive plan that you offer.</p>' . "\n";
572
  echo '<p><em><strong>*Modification Process*</strong> When you send a Member to PayPal® using a Subscription Modification Button, PayPal® will ask them to login. Once they\'re logged in, instead of being able to signup for a new membership, PayPal® will provide them with the ability to upgrade and/or downgrade their existing membership with you, by allowing them to switch to the Membership Plan that was specified in the Subscription Modification Button. PayPal® handles this nicely, and you\'ll be happy to know that s2Member has been pre-configured to deal with this scenario as well, so that everything remains automated. Their Membership Access Level will either be promoted, or demoted, based on the actions they took at PayPal® during the modification process. Once an existing Member completes their Subscription Modification at PayPal®, they\'ll be brought back to their Login Welcome Page, instead of the registration screen.</em></p>' . "\n";
573
  echo '<p><em><strong>*Also Works For Free Subscribers*</strong> Although a Free Subscriber does not have an existing PayPal® Subscription, s2Member is capable of adapting to this scenario gracefully. Just make sure that your existing Free Subscribers ( the ones who wish to upgrade ) pay for their Membership through a Modification Button generated by s2Member. That will allow them to continue using their existing account with you. In other words, they can keep their existing Username ( and anything already associated with that Username ), rather than being forced to re-register after checkout.</em></p>' . "\n";
574
  echo '<p><em><strong>*Make It More User-Friendly*</strong> You can make the Subscription Modification Process, more user-friendly, by setting up a <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can tell s2Member to use that Page Style whenever you generate your Button Code. See: s2Member® -> PayPal Buttons.\'); return false;">Custom Page Style at PayPal®</a>, specifically for Subscription Modification Buttons. Use a custom header image, with a brief explanation to the Customer. Something like, "Log into PayPal®", "You can Modify your Subscription!".</em></p>' . "\n";
575
  echo '<p><em><strong>*Conditional Upgrades*</strong> You could also use the API Constant <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> to build Conditionals that display a specific Modification Button, based on the Membership Level of the currently logged-in Member. This can help you maximize your marketing efforts. In other words, instead of just throwing a single Modification Button out there to everyone, get specific if you need to!</em></p>' . "\n";
576
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-level-conditional-upgrades.php"), true) . '</p>' . "\n";
577
  /**/
578
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants", get_defined_vars ());
579
  /**/
12
  Direct access denial.
13
  */
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
+ exit ("Do not access this file directly.");
16
  /*
17
  API Scripting page.
18
  */
54
  echo '<div class="ws-menu-page-group" title="Using Simple Conditionals">' . "\n";
55
  /**/
56
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
57
+ echo '<h3>Simple Conditionals ( via WordPress® Shortcodes )</h3>' . "\n";
58
+ echo '<p>In an effort to give you even more control over access restrictions, s2Member makes Simple Conditionals available to you from within WordPress®, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress®. In this section, we\'ll demonstrate several functions that are possible using Shortcodes: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>current_user_is(role)</code></strong>, <strong><code>current_user_is_not(role)</code></strong>, <strong><code>current_user_can(capability)</code></strong>, <strong><code>current_user_cannot(capability)</code></strong>, <strong><code>current_user_is_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_is_not_for_blog(blog_id,role)</code></strong>, <strong><code>current_user_can_for_blog(blog_id,capability)</code></strong>, <strong><code>current_user_cannot_for_blog(blog_id,capability)</code></strong>. To make use of these functions, please follow our code samples below. Using Shortcodes, it\'s easy to build Simple Conditionals within your content; based on a Members\'s Level, or even based on Custom Capabilities. s2Member\'s Shortcodes can be used inside a Post/Page, and also inside Text Widgets.</p>' . "\n";
59
+ echo '<p><em>There are <strong>two different Shortcodes</strong> being demonstrated here:<br /><strong>1. <code>s2If</code></strong> ( for testing simple conditional expressions ).<br /><strong>2. <code>s2Get</code></strong> ( to get an API Constant value, a Custom Field, or meta key ).</em></p>' . "\n";
60
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars ());
61
  /**/
62
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
63
  /**/
64
  echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
65
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-is-user-logged-in.php")) . '</p>' . "\n";
66
  /**/
67
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
68
  /**/
69
  echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
70
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-current-user-can-full-access.php")) . '</p>' . "\n";
71
  /**/
72
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
73
  /**/
74
  echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
75
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-current-user-is-specific-content.php")) . '</p>' . "\n";
76
  /**/
77
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
78
  /**/
79
  echo '<p><strong>Example #4:</strong> Using s2Member API Conditionals, supplementing WordPress® core functions.</strong></p>' . "\n";
80
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-s2-conditional-supplements-1.php")) . '</p>' . "\n";
81
  /**/
82
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
83
  /**/
84
  echo '<p><strong>Example #5:</strong> Using multiple Conditionals together, and even nesting other Shortcodes.</strong></p>' . "\n";
85
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-s2-conditional-supplements-2.php")) . '</p>' . "\n";
86
  /**/
87
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
88
  /**/
89
  echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
90
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-s2-conditional-supplements-3.php")) . '</p>' . "\n";
91
  /**/
92
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
93
  /**/
97
  /**/
98
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
99
  /**/
100
+ echo '<p><em><strong>s2Member supports ALL <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank" rel="external">Conditional Tags</a> in WordPress®.</strong> Including, but not limited to: <strong><code>is_multisite()</code></strong>, <strong><code>is_main_site()</code></strong>, <strong><code>is_super_admin()</code></strong>, <strong><code>is_admin()</code></strong>, <strong><code>is_404()</code></strong>, <strong><code>is_home()</code></strong>, <strong><code>is_front_page()</code></strong>, <strong><code>is_comments_popup()</code></strong>, <strong><code>is_singular(ID|slug|{slug,ID})"</code></strong>, <strong><code>is_single(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page(ID|slug|{slug,ID})</code></strong>, <strong><code>is_page_template(file.php)</code></strong>, <strong><code>is_attachment()</code></strong>, <strong><code>is_feed()</code></strong>, <strong><code>is_trackback()</code></strong>, <strong><code>is_archive()</code></strong>, <strong><code>is_search()</code></strong>, <strong><code>is_category(ID|slug|{slug,ID})</code></strong>, <strong><code>is_tax(taxonomy,term)</code></strong>, <strong><code>is_tag(slug|{slug,slug})"</code></strong>, <strong><code>has_tag(slug|{slug,slug})"</code></strong>, <strong><code>is_author(ID|slug|{slug,ID})</code></strong>, <strong><code>is_date()</code></strong>, <strong><code>is_day()</code></strong>, <strong><code>is_month()</code></strong>, <strong><code>is_time()</code></strong>, <strong><code>is_year()</code></strong>, <strong><code>is_sticky(ID)</code></strong>, <strong><code>is_paged()</code></strong>, <strong><code>is_preview()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>is_active_sidebar(ID|number)</code></strong>.</em></p>' . "\n";
101
+ /**/
102
+ echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
103
+ echo '<p><em>1. True/false -> ex: <code>current_user_can()</code> / <code>!current_user_can()</code><br />2. False explicitly -> ex: <code>current_user_cannot()</code><br />3. Passing an ID -> ex: <code>is_page(24)</code><br />4. Passing a Slug -> ex: <code>is_page(my-cool-page)</code><br />5. Passing an Array -> ex: <code>is_page({my-cool-page,24,about,contact-form})</code></em></p>' . "\n";
104
+ echo '<p><em>*Tip: do NOT use spaces inside Conditionals.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_page(My Membership Options Page)</code><br />- use slugs or IDs instead, no spaces.</em></p>' . "\n";
105
+ /**/
106
+ echo '<p><em><strong>Implementing AND/OR Conditional expressions:</strong></em></p>' . "\n";
107
+ echo '<p><em>*Tip: do NOT mix AND/OR expressions.<br /> <strong class="ws-menu-page-error-hilite">BAD</strong> <code>is_user_logged_in() AND is_page(1) OR is_page(2)</code><br />- use one or the other; do NOT mix AND/OR together.</em></p>' . "\n";
108
+ echo '<p><em><strong class="ws-menu-page-hilite">If you need to have both types of logic, use nesting:</strong></em></p>' . "\n";
109
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-s2-conditional-nesting.php")) . '</p>' . "\n";
110
  echo '</div>' . "\n";
111
  /**/
112
  echo '</div>' . "\n";
128
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
129
  /**/
130
  echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
131
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/is-user-logged-in.php")) . '</p>' . "\n";
132
  /**/
133
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
134
  /**/
135
  echo '<p><strong>Example #2:</strong> Full access for any Member with a Level >= 1.</strong></p>' . "\n";
136
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-full-access.php")) . '</p>' . "\n";
137
  /**/
138
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
139
  /**/
140
  echo '<p><strong>Example #3:</strong> Specific content for each different Member Level.</strong></p>' . "\n";
141
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-is-specific-content.php")) . '</p>' . "\n";
142
  /**/
143
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
144
  /**/
145
  echo '<p><strong>Example #4:</strong> Using s2Member API Conditionals, supplementing WordPress® core functions.</strong></p>' . "\n";
146
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/s2-conditional-supplements-1.php")) . '</p>' . "\n";
147
  /**/
148
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
149
  /**/
150
  echo '<p><strong>Example #5:</strong> Using s2Member API Conditionals, supplementing WordPress® core functions.</strong></p>' . "\n";
151
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/s2-conditional-supplements-2.php")) . '</p>' . "\n";
152
  /**/
153
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
154
  /**/
155
  echo '<p><strong>Example #6:</strong> Using multiple Conditionals together, and even nesting Conditionals.</strong></p>' . "\n";
156
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/s2-conditional-supplements-3.php")) . '</p>' . "\n";
157
  /**/
158
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
159
  /**/
160
  echo '<p><strong>Example #7:</strong> Using s2Member API Constants, instead of conditional functions.</strong></p>' . "\n";
161
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-constants-1.php")) . '</p>' . "\n";
162
  /**/
163
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
164
  /**/
165
  echo '<p><strong>Example #8:</strong> Using s2Member API Constants, instead of conditional functions.</strong></p>' . "\n";
166
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-constants-2.php")) . '</p>' . "\n";
167
  /**/
168
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
169
  /**/
195
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
196
  /**/
197
  echo '<p><strong>Custom Capabilities:</strong> ( music,videos ):</p>' . "\n";
198
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-1.php")) . '</p>' . "\n";
199
  /**/
200
  echo '<p><strong>Custom Capabilities:</strong> ( ebooks,reports,tips ):</p>' . "\n";
201
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-2.php")) . '</p>' . "\n";
202
  echo '</div>' . "\n";
203
  /**/
204
  echo '</div>' . "\n";
224
  echo '<p>Sub-Directory: <code>/s2member-files/access-s2member-ccap-music</code><br />Sub-Directory: <code>/s2member-files/access-s2member-ccap-videos</code></p>' . "\n";
225
  echo '<p>Protected File: <code>/s2member-files/access-s2member-ccap-music/file.mp3</code><br />Protected File: <code>/s2member-files/access-s2member-ccap-videos/file.avi</code></p>' . "\n";
226
  echo '<p>Now, here are some link examples, using Custom Capability Sub-directories:</p>' . "\n";
227
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/ccap-file-downloads.php")) . '</p>' . "\n";
228
  echo '<p><em>These links will ONLY work for Members who are logged-in, with the proper Capabilities.</em></p>' . "\n";
229
  /**/
230
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
233
  echo '<p>Sub-Directory: <code>/s2member-files/access-s2member-level0</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level1</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level2</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level3</code><br />Sub-Directory: <code>/s2member-files/access-s2member-level4</code></p>' . "\n";
234
  echo '<p>Protected File: <code>/s2member-files/access-s2member-level0/tiger.doc</code><br />Protected File: <code>/s2member-files/access-s2member-level1/zebra.pdf</code><br />Protected File: <code>/s2member-files/access-s2member-level2/elephant.doc</code><br />Protected File: <code>/s2member-files/access-s2member-level3/rhino.pdf</code><br />Protected File: <code>/s2member-files/access-s2member-level4/lion.doc</code></p>' . "\n";
235
  echo '<p>Now, here are some link examples, using Member Level Sub-directories:</p>' . "\n";
236
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level-file-downloads.php")) . '</p>' . "\n";
237
  echo '<p><em>These links will ONLY work for Members who are logged-in, with an adequate Membership Level.</em></p>' . "\n";
238
  echo '</div>' . "\n";
239
  /**/
253
  echo '<p>Content Dripping is the gradual, pre-scheduled release of premium website content to paying Members. This has become increasingly popular, because it allows older Members; those who have paid you more, due to recurring charges; to acquire access to more content progressively; based on their original registration date. It also gives you ( as the site owner ), the ability to launch multiple membership site portals, operating on autopilot, without any direct day-to-day involvement in a content release process. This requires some PHP scripting. In order to use PHP scripting inside your Posts/Pages, you\'ll need to install this handy plugin ( <a href="http://wordpress.org/extend/plugins/exec-php/" target="_blank" rel="external">Exec-PHP</a> ).</p>' . "\n";
254
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_dripping", get_defined_vars ());
255
  echo '<p><strong>To drip content, use <code>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</code>:</strong></p>' . "\n";
256
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-registration-days-dripping.php")) . '</p>' . "\n";
257
  echo '</div>' . "\n";
258
  /**/
259
  echo '</div>' . "\n";
281
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
282
  /**/
283
  echo '<p><strong>Code Sample #1</strong> ( standard link tag ):</p>' . "\n";
284
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php")) . '</p>' . "\n";
285
  /**/
286
  echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
287
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.php")) . '</p>' . "\n";
288
  /**/
289
  echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
290
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.php")) . '</p>' . "\n";
291
  echo '</div>' . "\n";
292
  /**/
293
  echo '</div>' . "\n";
315
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
316
  /**/
317
  echo '<p><strong>S2MEMBER_VERSION</strong><br />This will always be a (string) with the current s2Member version. Available since s2Member 3.0.</p>' . "\n";
318
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/version.php")) . '</p>' . "\n";
319
  /**/
320
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
321
  /**/
322
  echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN</strong><br />This will always be (bool) true or false. True if a User/Member is currently logged in with an Access Level >= 0.</p>' . "\n";
323
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-is-logged-in.php")) . '</p>' . "\n";
324
  echo '<p><em>See <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
325
  /**/
326
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
327
  /**/
328
  echo '<p><strong>S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER</strong><br />This will always be (bool) true or false. True if a Member is currently logged in with an Access Level >= 1.</p>' . "\n";
329
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-is-logged-in-as-member.php")) . '</p>' . "\n";
330
  echo '<p><em>See <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
331
  /**/
332
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
333
  /**/
334
  echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) -1 thru 4. -1 if not logged in. 0 if logged in as a Free Subscriber.</p>' . "\n";
335
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-level.php")) . '</p>' . "\n";
336
  echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
337
  echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.</p>' . "\n";
338
  echo '<p><em>* WordPress® Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress® Administrators, Editors, Authors, and Contributors have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
340
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
341
  /**/
342
  echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LABEL</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
343
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-label.php")) . '</p>' . "\n";
344
  /**/
345
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
346
  /**/
347
  echo '<p><strong>S2MEMBER_CURRENT_USER_SUBSCR_ID</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
348
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-subscr-id.php")) . '</p>' . "\n";
349
  /**/
350
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
351
  /**/
352
  echo '<p><strong>S2MEMBER_CURRENT_USER_CUSTOM</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
353
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-custom.php")) . '</p>' . "\n";
354
  /**/
355
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
356
  /**/
357
  echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. 0 if not logged in. This holds the recorded time at which the Member originally registered their Username for access to your site. This is useful if you want to drip content over an extended period of time, based on how long someone has been a Member.</p>' . "\n";
358
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-registration-time.php")) . '</p>' . "\n";
359
  /**/
360
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
361
  /**/
362
  echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</strong><br />This will always be an (int). 0 if not logged in. This is the number of days that have passed since the Member originally registered their Username for access to your site. This is useful if you want to drip content over an extended period of time, based on how long someone has been a Member.</p>' . "\n";
363
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-registration-days.php")) . '</p>' . "\n";
364
  /**/
365
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
366
  /**/
367
  echo '<p><strong>S2MEMBER_CURRENT_USER_DISPLAY_NAME</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
368
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-display-name.php")) . '</p>' . "\n";
369
  /**/
370
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
371
  /**/
372
  echo '<p><strong>S2MEMBER_CURRENT_USER_FIRST_NAME</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
373
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-first-name.php")) . '</p>' . "\n";
374
  /**/
375
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
376
  /**/
377
  echo '<p><strong>S2MEMBER_CURRENT_USER_LAST_NAME</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
378
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-last-name.php")) . '</p>' . "\n";
379
  /**/
380
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
381
  /**/
382
  echo '<p><strong>S2MEMBER_CURRENT_USER_LOGIN</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
383
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-login.php")) . '</p>' . "\n";
384
  /**/
385
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
386
  /**/
387
  echo '<p><strong>S2MEMBER_CURRENT_USER_EMAIL</strong><br />This will always be a (string). Empty if not logged in.</p>' . "\n";
388
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-email.php")) . '</p>' . "\n";
389
  /**/
390
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
391
  /**/
392
  echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string). Empty if browsing anonymously.</p>' . "\n";
393
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-ip.php")) . '</p>' . "\n";
394
  /**/
395
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
396
  /**/
397
  echo '<p><strong>S2MEMBER_CURRENT_USER_ID</strong><br />This will always be an (int). However, it will be 0 if not logged in.</p>' . "\n";
398
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-id.php")) . '</p>' . "\n";
399
  /**/
400
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
401
  /**/
402
  echo '<p><strong>S2MEMBER_CURRENT_USER_FIELDS</strong><br />This will always be a JSON encoded array, in (string) format. An empty JSON encoded array, in (string) format, if not logged in. This JSON encoded array will contain the following fields: <code>id, ip, email, login, first_name, last_name, display_name, subscr_id, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. For example, if you configured the Custom Field: <code>Street Address</code>, it would be included in this array as: <code>street_address</code>. Custom Field references are converted to lowercase format, and spaces are replaced by underscores. You can do <code>print_r(json_decode(S2MEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
403
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-fields.php")) . '</p>' . "\n";
404
  /**/
405
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
406
  /**/
407
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED</strong><br />This will always be an (int) value >= 0 where 0 means no access.</p>' . "\n";
408
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-allowed.php")) . '</p>' . "\n";
409
  /**/
410
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
411
  /**/
412
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED</strong><br />This will always be (bool) true or false. A value of true means their allowed downloads are >= 999999999, and false means it is not. This is useful if you are allowing unlimited ( 999999999 ) downloads on some membership levels. You can display `Unlimited` instead of a number.</p>' . "\n";
413
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-allowed-is-unlimited.php")) . '</p>' . "\n";
414
  /**/
415
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
416
  /**/
417
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY</strong><br />This will always be an (int) value >= 0 where 0 means none.</p>' . "\n";
418
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-currently.php")) . '</p>' . "\n";
419
  /**/
420
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
421
  /**/
422
  echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS</strong><br />This will always be an (int) value >= 0 where 0 means no access.</p>' . "\n";
423
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-downloads-allowed-days.php")) . '</p>' . "\n";
424
  /**/
425
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
426
  /**/
427
  echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is where a Member can modify their Profile.</p>' . "\n";
428
  echo '<p><strong>Code Sample #1</strong> ( standard link ):</p>' . "\n";
429
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php")) . '</p>' . "\n";
430
  echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
431
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2.php")) . '</p>' . "\n";
432
  echo '<p><strong>Code Sample #3</strong> ( embed the form into a Post/Page using an IFRAME tag ):</p>' . "\n";
433
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3.php")) . '</p>' . "\n";
434
  /**/
435
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
436
  /**/
437
  echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL</strong><br />This is the full URL to the Limit Exceeded Page ( informational ).</p>' . "\n";
438
  echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
439
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/file-download-limit-exceeded-page-url.php")) . '</p>' . "\n";
440
  /**/
441
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
442
  /**/
443
  echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL</strong><br />This is the full URL to the Membership Options Page ( the signup page ).</p>' . "\n";
444
  echo '<p><strong>S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL.</p>' . "\n";
445
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/membership-options-page-url.php")) . '</p>' . "\n";
446
  /**/
447
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
448
  /**/
449
  echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_URL</strong><br />This is the full URL to the Login Welcome Page ( the User\'s account page ). * This could also be the full URL to a Special Redirection URL ( if you configured one ). See <code>s2Member -> General Options -> Login Welcome Page</code>.</p>' . "\n";
450
  echo '<p><strong>S2MEMBER_LOGIN_WELCOME_PAGE_ID</strong><br />This is the Page ID that was used to generate the full URL. * In the case of a Special Redirection URL, this ID is not really applicable.</p>' . "\n";
451
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/login-welcome-page-url.php")) . '</p>' . "\n";
452
  /**/
453
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
454
  /**/
455
  echo '<p><strong>S2MEMBER_LOGIN_PAGE_URL</strong><br />This is the full URL to the Membership Login Page ( the WordPress® login page ).</p>' . "\n";
456
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/login-page-url.php")) . '</p>' . "\n";
457
  /**/
458
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
459
  /**/
460
  echo '<p><strong>S2MEMBER_LOGOUT_PAGE_URL</strong><br />This is the full URL to the Membership Logout Page ( the WordPress® logout page ).</p>' . "\n";
461
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/logout-page-url.php")) . '</p>' . "\n";
462
  /**/
463
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
464
  /**/
465
  echo '<p><strong>S2MEMBER_LEVEL0_LABEL</strong><br />This is the (string) Label that you created for Membership Level 0.</p>' . "\n";
466
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level0-label.php")) . '</p>' . "\n";
467
  /**/
468
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
469
  /**/
470
  echo '<p><strong>S2MEMBER_LEVEL1_LABEL</strong><br />This is the (string) Label that you created for Membership Level 1.</p>' . "\n";
471
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level1-label.php")) . '</p>' . "\n";
472
  /**/
473
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
474
  /**/
475
  echo '<p><strong>S2MEMBER_LEVEL2_LABEL</strong><br />This is the (string) Label that you created for Membership Level 2.</p>' . "\n";
476
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level2-label.php")) . '</p>' . "\n";
477
  /**/
478
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
479
  /**/
480
  echo '<p><strong>S2MEMBER_LEVEL3_LABEL</strong><br />This is the (string) Label that you created for Membership Level 3.</p>' . "\n";
481
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level3-label.php")) . '</p>' . "\n";
482
  /**/
483
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
484
  /**/
485
  echo '<p><strong>S2MEMBER_LEVEL4_LABEL</strong><br />This is the (string) Label that you created for Membership Level 4.</p>' . "\n";
486
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level4-label.php")) . '</p>' . "\n";
487
  /**/
488
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
489
  /**/
490
  echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 0.</p>' . "\n";
491
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level0-file-downloads-allowed.php")) . '</p>' . "\n";
492
  /**/
493
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
494
  /**/
495
  echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 1.</p>' . "\n";
496
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level1-file-downloads-allowed.php")) . '</p>' . "\n";
497
  /**/
498
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
499
  /**/
500
  echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 2.</p>' . "\n";
501
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level2-file-downloads-allowed.php")) . '</p>' . "\n";
502
  /**/
503
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
504
  /**/
505
  echo '<p><strong>S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 3.</p>' . "\n";
506
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level3-file-downloads-allowed.php")) . '</p>' . "\n";
507
  /**/
508
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
509
  /**/
510
  echo '<p><strong>S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 4.</p>' . "\n";
511
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level4-file-downloads-allowed.php")) . '</p>' . "\n";
512
  /**/
513
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
514
  /**/
515
  echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 0.</p>' . "\n";
516
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level0-file-downloads-allowed-days.php")) . '</p>' . "\n";
517
  /**/
518
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
519
  /**/
520
  echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 1.</p>' . "\n";
521
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level1-file-downloads-allowed-days.php")) . '</p>' . "\n";
522
  /**/
523
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
524
  /**/
525
  echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 2.</p>' . "\n";
526
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level2-file-downloads-allowed-days.php")) . '</p>' . "\n";
527
  /**/
528
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
529
  /**/
530
  echo '<p><strong>S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 3.</p>' . "\n";
531
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level3-file-downloads-allowed-days.php")) . '</p>' . "\n";
532
  /**/
533
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
534
  /**/
535
  echo '<p><strong>S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 4.</p>' . "\n";
536
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level4-file-downloads-allowed-days.php")) . '</p>' . "\n";
537
  /**/
538
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
539
  /**/
540
  echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
541
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/file-download-inline-extensions.php")) . '</p>' . "\n";
542
  /**/
543
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
544
  /**/
545
  echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
546
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/reg-email-from-name.php")) . '</p>' . "\n";
547
  /**/
548
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
549
  /**/
550
  echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_EMAIL</strong><br />This is the Email Address that outgoing messages are sent by.</p>' . "\n";
551
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/reg-email-from-email.php")) . '</p>' . "\n";
552
  /**/
553
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
554
  /**/
555
  echo '<p><strong>S2MEMBER_PAYPAL_NOTIFY_URL</strong><br />This is the URL on your system that receives PayPal® IPN responses.</p>' . "\n";
556
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-notify-url.php")) . '</p>' . "\n";
557
  /**/
558
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
559
  /**/
560
  echo '<p><strong>S2MEMBER_PAYPAL_RETURN_URL</strong><br />This is the URL on your system that receives PayPal® return variables.</p>' . "\n";
561
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-return-url.php")) . '</p>' . "\n";
562
  /**/
563
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
564
  /**/
565
  echo '<p><strong>S2MEMBER_PAYPAL_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal® server.</p>' . "\n";
566
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-endpoint.php")) . '</p>' . "\n";
567
  /**/
568
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
569
  /**/
570
  echo '<p><strong>S2MEMBER_PAYPAL_BUSINESS</strong><br />This is the Email Address that identifies your PayPal® Business.</p>' . "\n";
571
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-business.php")) . '</p>' . "\n";
572
  /**/
573
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
574
  /**/
575
  echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong><br />This auto-fills the <code>on0</code> value in PayPal® Button Codes.<br />If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>on0</code> input variable, with the string: <code>"Updating Subscr. ID"</code>. Otherwise, it will be an empty string.</p>' . "\n";
576
  echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong><br />This auto-fills the <code>os0</code> value in PayPal® Button Codes.<br />If a Button Code is presented to a logged-in Member, this will auto-fill the value for the <code>os0</code> input variable, with the value of <code>S2MEMBER_CURRENT_USER_SUBSCR_ID</code>. Otherwise, it will be an empty string.</p>' . "\n";
577
  echo '<p>These two Constants are special. They are used by the PayPal® Button Generator for s2Member. This is how s2Member identifies an existing Member ( and/or a Free Subscriber ), who is already logged in when they click a PayPal® Modification Button that was generated for you by s2Member. Instead of forcing a Member ( and/or a Free Subscriber ) to re-register for a new account, s2Member can identify their existing account, and update it, according to the modified terms in your Button Code. These three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal® Buttons ( recommended ), you won\'t even see these, because they\'re added internally by the Shortcode processor. Anyway, they\'re just documented here for clarity; you probably won\'t use these directly; the Button Code Generator pops them in.</p>' . "\n";
578
+ echo '<p><em>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-value-for-pp-on0-os0.php")) . '</em></p>' . "\n";
579
  echo '<p>If you\'d like to give your Members ( and/or your Free Subscribers ) the ability to modify their billing plan, by switching to a more expensive option, or a less expensive option; generate a new PayPal® Modification Button, using the s2Member PayPal® Button Generator. Configure the updated Level, pricing, terms, etc. Then, make that new Modification Button available to Members who are logged into their existing account with you. For example, you might want to insert a "Level #2" Upgrade Button into your Login Welcome Page, which would up-sell existing Level #1 Members to a more expensive plan that you offer.</p>' . "\n";
580
  echo '<p><em><strong>*Modification Process*</strong> When you send a Member to PayPal® using a Subscription Modification Button, PayPal® will ask them to login. Once they\'re logged in, instead of being able to signup for a new membership, PayPal® will provide them with the ability to upgrade and/or downgrade their existing membership with you, by allowing them to switch to the Membership Plan that was specified in the Subscription Modification Button. PayPal® handles this nicely, and you\'ll be happy to know that s2Member has been pre-configured to deal with this scenario as well, so that everything remains automated. Their Membership Access Level will either be promoted, or demoted, based on the actions they took at PayPal® during the modification process. Once an existing Member completes their Subscription Modification at PayPal®, they\'ll be brought back to their Login Welcome Page, instead of the registration screen.</em></p>' . "\n";
581
  echo '<p><em><strong>*Also Works For Free Subscribers*</strong> Although a Free Subscriber does not have an existing PayPal® Subscription, s2Member is capable of adapting to this scenario gracefully. Just make sure that your existing Free Subscribers ( the ones who wish to upgrade ) pay for their Membership through a Modification Button generated by s2Member. That will allow them to continue using their existing account with you. In other words, they can keep their existing Username ( and anything already associated with that Username ), rather than being forced to re-register after checkout.</em></p>' . "\n";
582
  echo '<p><em><strong>*Make It More User-Friendly*</strong> You can make the Subscription Modification Process, more user-friendly, by setting up a <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can tell s2Member to use that Page Style whenever you generate your Button Code. See: s2Member® -> PayPal Buttons.\'); return false;">Custom Page Style at PayPal®</a>, specifically for Subscription Modification Buttons. Use a custom header image, with a brief explanation to the Customer. Something like, "Log into PayPal®", "You can Modify your Subscription!".</em></p>' . "\n";
583
  echo '<p><em><strong>*Conditional Upgrades*</strong> You could also use the API Constant <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> to build Conditionals that display a specific Modification Button, based on the Membership Level of the currently logged-in Member. This can help you maximize your marketing efforts. In other words, instead of just throwing a single Modification Button out there to everyone, get specific if you need to!</em></p>' . "\n";
584
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-level-conditional-upgrades.php")) . '</p>' . "\n";
585
  /**/
586
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants", get_defined_vars ());
587
  /**/
includes/menu-pages/trk-ops.inc.php CHANGED
@@ -178,9 +178,9 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
178
  echo '<p>If you choose to <a href="http://www.idevdirect.com/14200.html" target="_blank" rel="external">install iDevAffiliate®</a>, you will need to configure your <code>iDevAffiliate® -> Shopping Cart Integration</code>. Please choose <code>Generic Tracking Pixel</code>. Then, grab your Hidden Image Tag, and pop the code provided by iDevAffiliate® into the Custom Tracking field at the top of this page. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided two examples below. The first example is for Signup Tracking ( Membership Access ), and the second example is for Specific Post/Page Tracking. The variables are different, depending on which type of transaction you\'re tracking.</p>' . "\n";
179
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_idev", get_defined_vars ());
180
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
181
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/idev-signup-tracking-code.php"), true) . '</p>' . "\n";
182
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
183
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/idev-sp-tracking-code.php"), true) . '</p>' . "\n";
184
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
185
  echo '<p>Your <code>profile</code> ID will be assigned by iDevAffiliate®. Be sure to replace <code>profile=123</code> with your own profile ID.</p>' . "\n";
186
  echo '<p><em><strong>*Tip*</strong> iDevAffiliate® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
@@ -204,9 +204,9 @@ if (apply_filters ("ws_plugin__s2member_during_trk_ops_page_during_left_sections
204
  echo '<p>If you <a href="http://www.shareasale.com/merchantsignup.cfm" target="_blank" rel="external">become a Merchant at ShareASale®</a>, you will need to configure your <code>ShareASale® -> Sale Tracking</code>. Grab your Hidden Image Tag, and pop the code provided by ShareASale® into the Custom Tracking field at the top of this page. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided two examples below. The first example is for Signup Tracking ( Membership Access ), and the second example is for Specific Post/Page Tracking. The variables are different, depending on which type of transaction you\'re tracking.</p>' . "\n";
205
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_shareasale", get_defined_vars ());
206
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
207
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sas-signup-tracking-code.php"), true) . '</p>' . "\n";
208
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
209
- echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/sas-sp-tracking-code.php"), true) . '</p>' . "\n";
210
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
211
  echo '<p>Your <code>merchantID</code> will be assigned by ShareASale®. Be sure to replace <code>merchantID=123</code> with the one they assign you.</p>' . "\n";
212
  echo '<p><em><strong>*Tip*</strong> ShareASale® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
178
  echo '<p>If you choose to <a href="http://www.idevdirect.com/14200.html" target="_blank" rel="external">install iDevAffiliate®</a>, you will need to configure your <code>iDevAffiliate® -> Shopping Cart Integration</code>. Please choose <code>Generic Tracking Pixel</code>. Then, grab your Hidden Image Tag, and pop the code provided by iDevAffiliate® into the Custom Tracking field at the top of this page. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided two examples below. The first example is for Signup Tracking ( Membership Access ), and the second example is for Specific Post/Page Tracking. The variables are different, depending on which type of transaction you\'re tracking.</p>' . "\n";
179
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_idev", get_defined_vars ());
180
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
181
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/idev-signup-tracking-code.php")) . '</p>' . "\n";
182
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
183
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/idev-sp-tracking-code.php")) . '</p>' . "\n";
184
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
185
  echo '<p>Your <code>profile</code> ID will be assigned by iDevAffiliate®. Be sure to replace <code>profile=123</code> with your own profile ID.</p>' . "\n";
186
  echo '<p><em><strong>*Tip*</strong> iDevAffiliate® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
204
  echo '<p>If you <a href="http://www.shareasale.com/merchantsignup.cfm" target="_blank" rel="external">become a Merchant at ShareASale®</a>, you will need to configure your <code>ShareASale® -> Sale Tracking</code>. Grab your Hidden Image Tag, and pop the code provided by ShareASale® into the Custom Tracking field at the top of this page. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided two examples below. The first example is for Signup Tracking ( Membership Access ), and the second example is for Specific Post/Page Tracking. The variables are different, depending on which type of transaction you\'re tracking.</p>' . "\n";
205
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_shareasale", get_defined_vars ());
206
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
207
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sas-signup-tracking-code.php")) . '</p>' . "\n";
208
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
209
+ echo '<p>' . ws_plugin__s2member_highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sas-sp-tracking-code.php")) . '</p>' . "\n";
210
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
211
  echo '<p>Your <code>merchantID</code> will be assigned by ShareASale®. Be sure to replace <code>merchantID=123</code> with the one they assign you.</p>' . "\n";
212
  echo '<p><em><strong>*Tip*</strong> ShareASale® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
includes/syscon.inc.php CHANGED
@@ -16,7 +16,7 @@ WARNING: This is a system configuration file, please DO NOT EDIT this file direc
16
  Direct access denial.
17
  */
18
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
19
- exit("Do not access this file directly.");
20
  /*
21
  Determine the full url to the directory this plugin resides in.
22
  */
@@ -130,12 +130,21 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
130
  "level3_aweber_list_ids" => "", /* A comma-delimited list of AWeber® List IDs. */
131
  "level4_aweber_list_ids" => "", /* A comma-delimited list of AWeber® List IDs. */
132
  /**/
133
- "signup_notification_urls" => "", /* s2Member Signup Notification urls. */
134
- "registration_notification_urls" => "", /* s2Member Reg Notification urls. */
135
- "payment_notification_urls" => "", /* s2Member Payment Notification urls. */
136
- "eot_del_notification_urls" => "", /* s2Member Eot/del Notification urls. */
137
- "ref_rev_notification_urls" => "", /* s2Member Ref/rev Notification urls. */
138
- "sp_notification_urls" => "", /* s2Member Specific Post/Page Notification urls. */
 
 
 
 
 
 
 
 
 
139
  /**/
140
  "level0_label" => "Free", /* This is just an initial generic Level Label. */
141
  "level1_label" => "Bronze", /* This is just an initial generic Level Label. */
@@ -215,7 +224,7 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
215
  $value[$k] = trim (stripslashes ($v));
216
  /**/
217
  if (!isset ($default_options[$key]) && !preg_match ("/^pro_/", $key))
218
- unset($GLOBALS["WS_PLUGIN__"]["s2member"]["o"][$key]);
219
  /**/
220
  else if ($key === "options_version" && (!is_string ($value) || !is_numeric ($value)))
221
  $value = $default_options[$key];
@@ -346,22 +355,10 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
346
  else if (preg_match ("/^level[0-4]_aweber_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/\s+/", "", $value))))
347
  $value = $default_options[$key];
348
  /**/
349
- else if ($key === "signup_notification_urls" && (!is_string ($value) || !strlen ($value)))
350
- $value = $default_options[$key];
351
- /**/
352
- else if ($key === "registration_notification_urls" && (!is_string ($value) || !strlen ($value)))
353
- $value = $default_options[$key];
354
- /**/
355
- else if ($key === "payment_notification_urls" && (!is_string ($value) || !strlen ($value)))
356
- $value = $default_options[$key];
357
- /**/
358
- else if ($key === "eot_del_notification_urls" && (!is_string ($value) || !strlen ($value)))
359
- $value = $default_options[$key];
360
- /**/
361
- else if ($key === "ref_rev_notification_urls" && (!is_string ($value) || !strlen ($value)))
362
  $value = $default_options[$key];
363
  /**/
364
- else if ($key === "sp_notification_urls" && (!is_string ($value) || !strlen ($value)))
365
  $value = $default_options[$key];
366
  /**/
367
  else if (preg_match ("/^level[0-4]_label$/", $key) && (!is_string ($value) || !strlen ($value)))
@@ -418,5 +415,5 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
418
  return apply_filters_ref_array ("ws_plugin__s2member_options", array (&$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]));
419
  }
420
  /**/
421
- call_user_func("ws_plugin__s2member_configure_options_and_their_defaults");
422
  ?>
16
  Direct access denial.
17
  */
18
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
19
+ exit ("Do not access this file directly.");
20
  /*
21
  Determine the full url to the directory this plugin resides in.
22
  */
130
  "level3_aweber_list_ids" => "", /* A comma-delimited list of AWeber® List IDs. */
131
  "level4_aweber_list_ids" => "", /* A comma-delimited list of AWeber® List IDs. */
132
  /**/
133
+ "signup_notification_urls" => "", /* A line-delimited list of Signup Notification URLs. */
134
+ "registration_notification_urls" => "", /* A line-delimited list of Registration Notification URLs. */
135
+ "payment_notification_urls" => "", /* A line-delimited list of Payment Notification URLs. */
136
+ "cancellation_notification_urls" => "", /* A line-delimited list of Cancellation Notification URLs. */
137
+ "eot_del_notification_urls" => "", /* A line-delimited list of EOT/Del Notification URLs. */
138
+ "ref_rev_notification_urls" => "", /* A line-delimited list of Ref/Rev Notification URLs. */
139
+ "sp_notification_urls" => "", /* A line-delimited list of Specific Post/Page Notification URLs. */
140
+ /**/
141
+ "signup_notification_recipients" => "", /* Signup Notification recipients. */
142
+ "registration_notification_recipients" => "", /* Registration Notification recipients. */
143
+ "payment_notification_recipients" => "", /* Payment Notification recipients. */
144
+ "cancellation_notification_recipients" => "", /* Cancellation Notification recipients. */
145
+ "eot_del_notification_recipients" => "", /* EOT/Del Notification recipients. */
146
+ "ref_rev_notification_recipients" => "", /* Ref/Rev Notification recipients. */
147
+ "sp_notification_recipients" => "", /* Specific Post/Page Notification recipients. */
148
  /**/
149
  "level0_label" => "Free", /* This is just an initial generic Level Label. */
150
  "level1_label" => "Bronze", /* This is just an initial generic Level Label. */
224
  $value[$k] = trim (stripslashes ($v));
225
  /**/
226
  if (!isset ($default_options[$key]) && !preg_match ("/^pro_/", $key))
227
+ unset ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"][$key]);
228
  /**/
229
  else if ($key === "options_version" && (!is_string ($value) || !is_numeric ($value)))
230
  $value = $default_options[$key];
355
  else if (preg_match ("/^level[0-4]_aweber_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/\s+/", "", $value))))
356
  $value = $default_options[$key];
357
  /**/
358
+ else if (preg_match ("/^(signup|registration|payment|cancellation|eot_del|ref_rev|sp)_notification_urls$/", $key) && (!is_string ($value) || !strlen ($value)))
 
 
 
 
 
 
 
 
 
 
 
 
359
  $value = $default_options[$key];
360
  /**/
361
+ else if (preg_match ("/^(signup|registration|payment|cancellation|eot_del|ref_rev|sp)_notification_recipients$/", $key) && (!is_string ($value) || !strlen ($value)))
362
  $value = $default_options[$key];
363
  /**/
364
  else if (preg_match ("/^level[0-4]_label$/", $key) && (!is_string ($value) || !strlen ($value)))
415
  return apply_filters_ref_array ("ws_plugin__s2member_options", array (&$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]));
416
  }
417
  /**/
418
+ call_user_func ("ws_plugin__s2member_configure_options_and_their_defaults");
419
  ?>
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === s2Member ( Membership w/ PayPal® Integration ) ~ now Multisite compatible! ===
2
 
3
- Version: 3.2.1
4
- Stable tag: 3.2.1
5
  Framework: WS-P-3.0
6
 
7
  SSL Compatible: yes
@@ -27,7 +27,7 @@ Pro Module / Prices: http://www.s2member.com/prices/
27
  Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
28
  Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
29
  PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304
30
- Professional Installation URI: http://www.primothemes.com/forums/viewtopic.php?f=4&t=107
31
  Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with Multisite Networking, and even with BuddyPress if you like.
32
  Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, includes extensive documentation, highly extensible
33
 
@@ -170,8 +170,15 @@ Not yet. This is coming soon though. It will be included in a future release of
170
 
171
  == Changelog ==
172
 
 
 
 
 
 
 
 
 
173
  = 3.2.1 =
174
- * Simple Conditionals. Staring with s2Member v3.2.1, "Simple Conditionals" are now available to you from within WordPress®, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress®. We've been through all of the documentation for s2Member, and updated ALL code samples to provide you with Shortcode equivalents. You can learn more about these new Shortcodes in your WP Dashboard, under: `s2Member -> API Scripting -> Simple Conditionals`. There are three new Shortcodes all together: `s2All`, `s2Any`, and `s2Get` - which allows you to pull all sorts of information from your WordPress® installation, without a single line of PHP code. All compatible with the Visual Editor. We also suggest a re-review of s2Member's API Constants, under: `s2Member -> API Scripting -> Constants`. This will NOT affect any existing Conditionals that you've written. Simple Conditionals are a NEW feature, and they'll have no affect on Advanced Conditionals; which have always been available for s2Member.
175
  * Feature. s2Member now comes equipped with an advanced behavioral setting; specifically geared toward two special events ( Refunds/Reversals ). With s2Member v3.2.1+, you will find a new option which gives you more control over the way s2Member handles these two events. In your WP Dashboard, see: `s2Member -> PayPal® Options -> EOT Behavior`.
176
  * Bug fix. s2Member's bbPress Bridge integration was using a hard-coded reference to `wp_capabilities`, instead of using an option call to determine the WordPress® table prefix that was needed for some installations. This was affecting installations of WordPress® that were using a non-standard `wp_` prefix. Corrected in s2Member v3.2.1. In addition, another bug was found, causing the error: `missing argument` in preg_replace. This has also been corrected with s2Member v3.2.1+.
177
  * Bug fix. Invalid method `WP_User->hap_cap()`. This should have been `WP_User->has_cap()`. This was negatively affecting the new Custom Capabilities per-Post/Page introduced in the previous release of s2Member v3.2. This bug has been resolved with s2Member v3.2.1+.
1
  === s2Member ( Membership w/ PayPal® Integration ) ~ now Multisite compatible! ===
2
 
3
+ Version: 3.2.2
4
+ Stable tag: 3.2.2
5
  Framework: WS-P-3.0
6
 
7
  SSL Compatible: yes
27
  Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
28
  Plugin URI: http://www.primothemes.com/post/s2member-membership-plugin-with-paypal/
29
  PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304
30
+ Professional Installation URI: http://www.s2member.com/professional-installation/
31
  Description: Empowers WordPress® with membership capabilities. Integrates seamlessly with PayPal®. Also compatible with Multisite Networking, and even with BuddyPress if you like.
32
  Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, includes extensive documentation, highly extensible
33
 
170
 
171
  == Changelog ==
172
 
173
+ = 3.2.2 =
174
+ * Simple Conditionals ( completely re-written ). Simple Conditionals, first introduced in s2Member v3.2.1; have been completely re-written to support a wider range of features. The **new Shortcode** is `s2If`. The older Shortcodes have now been deprecated: `s2All, s2Any` ( do NOT use ). The older Shortcodes will continue to work with backward compatiblity, but they'll be removed in a future release of s2Member. Please update any existing Shortcodes referencing `s2All,s2Any` ( do NOT use ), by switching them all over to `s2If` instead. We apologize for the drastic changes to this new feature; but it was a necessary step forward. The initial release of Simple Conditionals was very buggy, and NOT as extensible as the new `s2If` logic is now. If you've been using Simple Conditionals, you will need to re-review all documentation and code samples. The new `s2If` Shortcode is fully documented, inside your WordPress® Dashboard under: `s2Member -> API Scripting -> Simple Conditionals`.
175
+ * Starting with s2Member v3.2.3, "Simple Conditionals" are now available to you from within WordPress®, using Shortcodes that are fully compatible with both the Visual Editor, and also the HTML Tab in WordPress®. We've been through all of the documentation for s2Member, and updated (again) ALL code samples to provide you with Shortcode equivalents. You can learn more about this new feature in your WP Dashboard, under: `s2Member -> API Scripting -> Simple Conditionals`. Simple Conditionals are a NEW feature, and they'll have no affect on Advanced Conditionals; which have always been available for s2Member.
176
+ * Bug Dodging. A call to `get_defined_constants(true)` inside `css-js-w-globals.inc.php` was causing a segfault on some installations of PHP 5.2. Bug reports at PHP.net indicate this is caused by the `(true)` argument being passed; and under the right conditions ( e.g. with the right combination of PHP extensions installed ) this can result in a segfault. In this release of s2Member ( v3.2.2 ), we've dodged this PHP bug completely, by implementing a different method for tracking the integrity of API Constants, thereby circumventing this odd behavior on some Apache/PHP installations. s2Member no longer makes any calls to the `get_defined_constants()` function.
177
+ * New Feature. s2Member can now send automatic API Notification Emails, which include a full Transaction Log for each API Notification event. In other words, you can now tell s2Member to send emails to different addresses, for each of s2Member's API Notification events. For further details, see: `s2Member -> API Notifications`. Look for "Email Transaction Log" under each sub-section. This new feature will make it easier to integrate s2Member with back-office routines, and in particular, easier to integrate with 3rd-party list servers - other than MailChimp/AWeber, which s2Member already supports natively. This new feature also makes it easier to build confidence in s2Member. As a Site Owner, you may configure email notifications for each event, and monitor s2Member's behavior.
178
+ * New API Notification. s2Member can now process separate API Notifications for "Cancellation" events. For further details, see: `s2Member -> API Notifications -> Cancellations`. Using this feature in conjunction with the new Email Transaction Logs, you can be notified via email; each time a Cancellation occurs.
179
+ * Bug fix. On a Multisite Blog Farm, s2Member was missing an important Hook/Filter ( `signup_hidden_fields` ) during a registration that included both an account, and also a Blog. This bug has been resolved with s2Member v3.2.2+.
180
+
181
  = 3.2.1 =
 
182
  * Feature. s2Member now comes equipped with an advanced behavioral setting; specifically geared toward two special events ( Refunds/Reversals ). With s2Member v3.2.1+, you will find a new option which gives you more control over the way s2Member handles these two events. In your WP Dashboard, see: `s2Member -> PayPal® Options -> EOT Behavior`.
183
  * Bug fix. s2Member's bbPress Bridge integration was using a hard-coded reference to `wp_capabilities`, instead of using an option call to determine the WordPress® table prefix that was needed for some installations. This was affecting installations of WordPress® that were using a non-standard `wp_` prefix. Corrected in s2Member v3.2.1. In addition, another bug was found, causing the error: `missing argument` in preg_replace. This has also been corrected with s2Member v3.2.1+.
184
  * Bug fix. Invalid method `WP_User->hap_cap()`. This should have been `WP_User->has_cap()`. This was negatively affecting the new Custom Capabilities per-Post/Page introduced in the previous release of s2Member v3.2. This bug has been resolved with s2Member v3.2.1+.
s2member.php CHANGED
@@ -9,8 +9,8 @@ along with this software. In the main directory, see: /licensing/
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
- Version: 3.2.1
13
- Stable tag: 3.2.1
14
  Framework: WS-P-3.0
15
 
16
  SSL Compatible: yes
@@ -48,7 +48,7 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
48
  /*
49
  Define versions.
50
  */
51
- define ("WS_PLUGIN__S2MEMBER_VERSION", "3.2.1");
52
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
53
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "3.0");
54
  define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.2.1");
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
+ Version: 3.2.2
13
+ Stable tag: 3.2.2
14
  Framework: WS-P-3.0
15
 
16
  SSL Compatible: yes
48
  /*
49
  Define versions.
50
  */
51
+ define ("WS_PLUGIN__S2MEMBER_VERSION", "3.2.2");
52
  define ("WS_PLUGIN__S2MEMBER_MIN_PHP_VERSION", "5.2");
53
  define ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION", "3.0");
54
  define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "1.2.1");