Version Description
Download this release
Release Info
Developer | PriMoThemes |
Plugin | s2Member Framework (Member Roles, Capabilities, Membership, PayPal Members) |
Version | 110708 |
Comparing to | |
See all releases |
Code changes from version 110620 to 110708
- includes/classes/check-activation.inc.php +7 -3
- includes/classes/constants.inc.php +10 -8
- includes/classes/custom-reg-fields.inc.php +34 -34
- includes/classes/email-configs.inc.php +164 -1
- includes/classes/installation.inc.php +5 -2
- includes/classes/labels.inc.php +3 -3
- includes/classes/login-customizations.inc.php +3 -1
- includes/classes/meta-box-saves.inc.php +16 -34
- includes/classes/meta-box-security.inc.php +40 -38
- includes/classes/option-forces.inc.php +4 -6
- includes/classes/paypal-notify-in.inc.php +79 -79
- includes/classes/paypal-return-in.inc.php +31 -31
- includes/classes/paypal-utilities.inc.php +10 -10
- includes/classes/profile-in.inc.php +4 -1
- includes/classes/register-access.inc.php +19 -0
- includes/classes/register-in.inc.php +35 -21
- includes/classes/registrations.inc.php +49 -22
- includes/classes/roles-caps.inc.php +5 -5
- includes/classes/tracking-codes.inc.php +7 -7
- includes/classes/utils-users.inc.php +4 -4
- includes/functions/class-autoloader.inc.php +1 -3
- includes/hooks.inc.php +4 -1
- includes/menu-pages/api-ops.inc.php +3 -5
- includes/menu-pages/code-samples/api-mop-vars.php +1 -59
- includes/menu-pages/code-samples/current-user-fields.php +16 -13
- includes/menu-pages/code-samples/current-user-profile-modification-page-url-1.php +1 -5
- includes/menu-pages/code-samples/current-user-value-for-pp-on0-os0.php +0 -9
- includes/menu-pages/code-samples/level0-file-downloads-allowed-days.php +0 -7
- includes/menu-pages/code-samples/level0-file-downloads-allowed.php +0 -7
- includes/menu-pages/code-samples/level0-label.php +0 -7
- includes/menu-pages/code-samples/level1-file-downloads-allowed-days.php +0 -7
- includes/menu-pages/code-samples/level1-file-downloads-allowed.php +0 -7
- includes/menu-pages/code-samples/level1-label.php +0 -7
- includes/menu-pages/code-samples/level2-file-downloads-allowed-days.php +0 -7
- includes/menu-pages/code-samples/level2-file-downloads-allowed.php +0 -7
- includes/menu-pages/code-samples/level2-label.php +0 -7
- includes/menu-pages/code-samples/level3-file-downloads-allowed-days.php +0 -7
- includes/menu-pages/code-samples/level3-file-downloads-allowed.php +0 -7
- includes/menu-pages/code-samples/level3-label.php +0 -7
- includes/menu-pages/code-samples/level4-file-downloads-allowed-days.php +0 -7
- includes/menu-pages/code-samples/level4-file-downloads-allowed.php +0 -7
- includes/menu-pages/code-samples/level4-label.php +0 -7
- includes/menu-pages/code-samples/query-conditional-examples.php +0 -33
- includes/menu-pages/code-samples/version.php +5 -1
- includes/menu-pages/down-ops.inc.php +23 -86
- includes/menu-pages/els-ops.inc.php +45 -176
- includes/menu-pages/gen-ops.inc.php +137 -106
- includes/menu-pages/info.inc.php +1 -3
- includes/menu-pages/integrations.inc.php +1 -3
- includes/menu-pages/menu-pages-s-min.js +1 -1
- includes/menu-pages/menu-pages-s.js +12 -7
- includes/menu-pages/menu-pages.css +2 -17
- includes/menu-pages/mms-ops.inc.php +24 -72
- includes/menu-pages/paypal-buttons.inc.php +147 -358
- includes/menu-pages/paypal-ops.inc.php +1 -3
- includes/menu-pages/res-ops.inc.php +104 -419
- includes/menu-pages/scripting.inc.php +154 -197
- includes/menu-pages/start.inc.php +2 -4
- includes/menu-pages/trk-ops.inc.php +1 -3
- includes/syscon.inc.php +199 -197
- includes/templates/options/paypal-membership-modification-levels.html +0 -24
- readme.txt +21 -24
- s2member.php +9 -7
includes/classes/check-activation.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_check_activation"))
|
21 |
{
|
@@ -41,11 +41,15 @@ if (!class_exists ("c_ws_plugin__s2member_check_activation"))
|
|
41 |
{
|
42 |
if (!($v = get_option ("ws_plugin__s2member_activated_version")) || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
|
43 |
{
|
44 |
-
c_ws_plugin__s2member_installation::activate ();
|
45 |
}
|
46 |
else if (is_multisite () && is_main_site () && (!($mms_v = get_option ("ws_plugin__s2member_activated_mms_version")) || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">=")))
|
47 |
{
|
48 |
-
c_ws_plugin__s2member_installation::activate ();
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
/**/
|
51 |
return; /* Return for uniformity. */
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_check_activation"))
|
21 |
{
|
41 |
{
|
42 |
if (!($v = get_option ("ws_plugin__s2member_activated_version")) || !version_compare ($v, WS_PLUGIN__S2MEMBER_VERSION, ">="))
|
43 |
{
|
44 |
+
c_ws_plugin__s2member_installation::activate ("version");
|
45 |
}
|
46 |
else if (is_multisite () && is_main_site () && (!($mms_v = get_option ("ws_plugin__s2member_activated_mms_version")) || !version_compare ($mms_v, WS_PLUGIN__S2MEMBER_VERSION, ">=")))
|
47 |
{
|
48 |
+
c_ws_plugin__s2member_installation::activate ("mms_version");
|
49 |
+
}
|
50 |
+
else if (!($l = (int)get_option ("ws_plugin__s2member_activated_levels")) || $l !== $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"])
|
51 |
+
{
|
52 |
+
c_ws_plugin__s2member_installation::activate ("levels");
|
53 |
}
|
54 |
/**/
|
55 |
return; /* Return for uniformity. */
|
includes/classes/constants.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_constants"))
|
21 |
{
|
@@ -62,7 +62,7 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
|
|
62 |
$custom_fields = ($user) ? get_user_option ("s2member_custom_fields", $user->ID) : array ();
|
63 |
$paid_registration_times = ($user) ? get_user_option ("s2member_paid_registration_times", $user->ID) : array ();
|
64 |
/**/
|
65 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
66 |
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
|
67 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
68 |
/**
|
@@ -923,6 +923,7 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
|
|
923 |
*
|
924 |
* o `id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID}
|
925 |
* o `ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP}
|
|
|
926 |
* o `email` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL}
|
927 |
* o `login` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN}
|
928 |
* o `first_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME}
|
@@ -948,8 +949,9 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
|
|
948 |
* ```
|
949 |
* [s2Get user_field="id" /]
|
950 |
* [s2Get user_field="ip" /]
|
951 |
-
* [s2Get user_field="
|
952 |
-
* [s2Get user_field="
|
|
|
953 |
* [s2Get user_field="first_name" /]
|
954 |
* [s2Get user_field="last_name" /]
|
955 |
* [s2Get user_field="display_name" /]
|
@@ -957,11 +959,11 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
|
|
957 |
* [s2Get user_field="s2member_subscr_wp_id" /]
|
958 |
* [s2Get user_field="s2member_subscr_gateway" /]
|
959 |
* [s2Get user_field="s2member_custom" /]
|
960 |
-
* [s2Get user_field="
|
961 |
*
|
962 |
* <script type="text/javascript">
|
963 |
-
*
|
964 |
-
* document.write(
|
965 |
* </script>
|
966 |
* ```
|
967 |
*
|
@@ -975,7 +977,7 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
|
|
975 |
* @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
|
976 |
*/
|
977 |
if (!defined ("S2MEMBER_CURRENT_USER_FIELDS"))
|
978 |
-
define ("S2MEMBER_CURRENT_USER_FIELDS", ($c[] = (($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, "subscr_or_wp_id" => S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID, "subscr_gateway" => S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ()))));
|
979 |
/**
|
980 |
* Indicates the number of unique Files the current User is allowed to download every X days.
|
981 |
*
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_constants"))
|
21 |
{
|
62 |
$custom_fields = ($user) ? get_user_option ("s2member_custom_fields", $user->ID) : array ();
|
63 |
$paid_registration_times = ($user) ? get_user_option ("s2member_paid_registration_times", $user->ID) : array ();
|
64 |
/**/
|
65 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
66 |
do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
|
67 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
68 |
/**
|
923 |
*
|
924 |
* o `id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID}
|
925 |
* o `ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP}
|
926 |
+
* o `reg_ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP}
|
927 |
* o `email` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL}
|
928 |
* o `login` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN}
|
929 |
* o `first_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME}
|
949 |
* ```
|
950 |
* [s2Get user_field="id" /]
|
951 |
* [s2Get user_field="ip" /]
|
952 |
+
* [s2Get user_field="reg_ip" /]
|
953 |
+
* [s2Get user_field="email" /]
|
954 |
+
* [s2Get user_field="login" /]
|
955 |
* [s2Get user_field="first_name" /]
|
956 |
* [s2Get user_field="last_name" /]
|
957 |
* [s2Get user_field="display_name" /]
|
959 |
* [s2Get user_field="s2member_subscr_wp_id" /]
|
960 |
* [s2Get user_field="s2member_subscr_gateway" /]
|
961 |
* [s2Get user_field="s2member_custom" /]
|
962 |
+
* [s2Get user_field="my_custom_field_id" /]
|
963 |
*
|
964 |
* <script type="text/javascript">
|
965 |
+
* document.write(S2MEMBER_CURRENT_USER_FIELDS.id);
|
966 |
+
* document.write(S2MEMBER_CURRENT_USER_FIELDS.display_name);
|
967 |
* </script>
|
968 |
* ```
|
969 |
*
|
977 |
* @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
|
978 |
*/
|
979 |
if (!defined ("S2MEMBER_CURRENT_USER_FIELDS"))
|
980 |
+
define ("S2MEMBER_CURRENT_USER_FIELDS", ($c[] = (($user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "reg_ip" => S2MEMBER_CURRENT_USER_REGISTRATION_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, "subscr_or_wp_id" => S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID, "subscr_gateway" => S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ()))));
|
981 |
/**
|
982 |
* Indicates the number of unique Files the current User is allowed to download every X days.
|
983 |
*
|
includes/classes/custom-reg-fields.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
21 |
{
|
@@ -48,13 +48,13 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
48 |
*/
|
49 |
public static function custom_field_gen ($_function = FALSE, $_field = FALSE, $_name_prefix = FALSE, $_id_prefix = FALSE, $_classes = FALSE, $_styles = FALSE, $_tabindex = FALSE, $_attrs = FALSE, $_submission = FALSE, $_value = FALSE, $_editable_context = FALSE)
|
50 |
{
|
51 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
52 |
do_action ("ws_plugin__s2member_before_custom_field_gen", get_defined_vars ());
|
53 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
54 |
/**/
|
55 |
if (!($gen = "") && $_function && is_array ($field = $_field) && !empty ($field["type"]) && !empty ($field["id"]) && $_name_prefix && $_id_prefix)
|
56 |
{
|
57 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
58 |
do_action ("ws_plugin__s2member_during_custom_field_gen_before", get_defined_vars ());
|
59 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
60 |
/**/
|
@@ -258,7 +258,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
258 |
}
|
259 |
}
|
260 |
/**/
|
261 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
262 |
do_action ("ws_plugin__s2member_during_custom_field_gen_after", get_defined_vars ());
|
263 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
264 |
}
|
@@ -278,15 +278,15 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
278 |
*/
|
279 |
public static function custom_fields_configured_at_level ($_level = "auto-detection", $_editable_context = FALSE)
|
280 |
{
|
281 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
282 |
do_action ("ws_plugin__s2member_before_custom_fields_configured_at_level", get_defined_vars ());
|
283 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
284 |
/**/
|
285 |
$level = ($_level === "auto-detection") ? c_ws_plugin__s2member_user_access::user_access_level () : $_level;
|
286 |
-
if ($_level === "auto-detection" && $level < 0 &&
|
287 |
-
|
288 |
/**/
|
289 |
-
$level = ($level !== "any" && (!is_numeric ($level) || $level < 0)) ? 0 : $level; /* Default
|
290 |
/**/
|
291 |
if (($level === "any" || (is_numeric ($level) && $level >= 0)) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"])
|
292 |
{
|
@@ -322,7 +322,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
322 |
/**/
|
323 |
echo '<input type="hidden" name="ws_plugin__s2member_registration" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-registration")) . '" />' . "\n";
|
324 |
/**/
|
325 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
326 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before", get_defined_vars ());
|
327 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
328 |
/**/
|
@@ -330,7 +330,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
330 |
{
|
331 |
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
|
332 |
/**/
|
333 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
334 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_first_name", get_defined_vars ());
|
335 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
336 |
/**/
|
@@ -338,11 +338,11 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
338 |
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_first_name" id="ws-plugin--s2member-custom-reg-field-first-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_first_name"]) . '" />' . "\n";
|
339 |
echo '<br />' . "\n";
|
340 |
/**/
|
341 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
342 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_first_name", get_defined_vars ());
|
343 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
344 |
/**/
|
345 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
346 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_last_name", get_defined_vars ());
|
347 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
348 |
/**/
|
@@ -350,7 +350,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
350 |
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_last_name" id="ws-plugin--s2member-custom-reg-field-last-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_last_name"]) . '" />' . "\n";
|
351 |
echo '<br />' . "\n";
|
352 |
/**/
|
353 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
354 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_last_name", get_defined_vars ());
|
355 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
356 |
}
|
@@ -359,7 +359,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
359 |
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
|
360 |
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
|
361 |
{
|
362 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
363 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_custom_fields", get_defined_vars ());
|
364 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
365 |
/**/
|
@@ -368,7 +368,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
368 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
|
369 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
370 |
/**/
|
371 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
372 |
if (apply_filters ("ws_plugin__s2member_during_ms_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
|
373 |
{
|
374 |
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
|
@@ -381,14 +381,14 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
381 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
382 |
}
|
383 |
/**/
|
384 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
385 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_custom_fields", get_defined_vars ());
|
386 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
387 |
}
|
388 |
/**/
|
389 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
|
390 |
{
|
391 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
392 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_opt_in", get_defined_vars ());
|
393 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
394 |
/**/
|
@@ -398,17 +398,17 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
398 |
echo '</label>' . "\n";
|
399 |
echo '<br />' . "\n";
|
400 |
/**/
|
401 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
402 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_opt_in", get_defined_vars ());
|
403 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
404 |
}
|
405 |
/**/
|
406 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
407 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after", get_defined_vars ());
|
408 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
409 |
}
|
410 |
/**/
|
411 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
412 |
do_action ("ws_plugin__s2member_after_ms_custom_registration_fields", get_defined_vars ());
|
413 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
414 |
/**/
|
@@ -436,13 +436,13 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
436 |
/**/
|
437 |
$tabindex = 20; /* Incremented tabindex starting with 20. */
|
438 |
/**/
|
439 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
440 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before", get_defined_vars ());
|
441 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
442 |
/**/
|
443 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
|
444 |
{
|
445 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
446 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_user_pass", get_defined_vars ());
|
447 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
448 |
/**/
|
@@ -461,7 +461,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
461 |
/**/
|
462 |
echo '</p>' . "\n";
|
463 |
/**/
|
464 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
465 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_user_pass", get_defined_vars ());
|
466 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
467 |
}
|
@@ -470,7 +470,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
470 |
{
|
471 |
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
|
472 |
/**/
|
473 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
474 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_first_name", get_defined_vars ());
|
475 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
476 |
/**/
|
@@ -481,11 +481,11 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
481 |
echo '</label>' . "\n";
|
482 |
echo '</p>' . "\n";
|
483 |
/**/
|
484 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
485 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_first_name", get_defined_vars ());
|
486 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
487 |
/**/
|
488 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
489 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_last_name", get_defined_vars ());
|
490 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
491 |
/**/
|
@@ -496,7 +496,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
496 |
echo '</label>' . "\n";
|
497 |
echo '</p>' . "\n";
|
498 |
/**/
|
499 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
500 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_last_name", get_defined_vars ());
|
501 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
502 |
}
|
@@ -505,7 +505,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
505 |
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
|
506 |
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
|
507 |
{
|
508 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
509 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
|
510 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
511 |
/**/
|
@@ -514,7 +514,7 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
514 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
|
515 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
516 |
/**/
|
517 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
518 |
if (apply_filters ("ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
|
519 |
{
|
520 |
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
|
@@ -529,14 +529,14 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
529 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
530 |
}
|
531 |
/**/
|
532 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
533 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_custom_fields", get_defined_vars ());
|
534 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
535 |
}
|
536 |
/**/
|
537 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
|
538 |
{
|
539 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
540 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_opt_in", get_defined_vars ());
|
541 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
542 |
/**/
|
@@ -547,16 +547,16 @@ if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
|
547 |
echo '</label>' . "\n";
|
548 |
echo '</p>' . "\n";
|
549 |
/**/
|
550 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
551 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_opt_in", get_defined_vars ());
|
552 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
553 |
}
|
554 |
/**/
|
555 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
556 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after", get_defined_vars ());
|
557 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
558 |
/**/
|
559 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
560 |
do_action ("ws_plugin__s2member_after_custom_registration_fields", get_defined_vars ());
|
561 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
562 |
/**/
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_custom_reg_fields"))
|
21 |
{
|
48 |
*/
|
49 |
public static function custom_field_gen ($_function = FALSE, $_field = FALSE, $_name_prefix = FALSE, $_id_prefix = FALSE, $_classes = FALSE, $_styles = FALSE, $_tabindex = FALSE, $_attrs = FALSE, $_submission = FALSE, $_value = FALSE, $_editable_context = FALSE)
|
50 |
{
|
51 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
52 |
do_action ("ws_plugin__s2member_before_custom_field_gen", get_defined_vars ());
|
53 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
54 |
/**/
|
55 |
if (!($gen = "") && $_function && is_array ($field = $_field) && !empty ($field["type"]) && !empty ($field["id"]) && $_name_prefix && $_id_prefix)
|
56 |
{
|
57 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
58 |
do_action ("ws_plugin__s2member_during_custom_field_gen_before", get_defined_vars ());
|
59 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
60 |
/**/
|
258 |
}
|
259 |
}
|
260 |
/**/
|
261 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
262 |
do_action ("ws_plugin__s2member_during_custom_field_gen_after", get_defined_vars ());
|
263 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
264 |
}
|
278 |
*/
|
279 |
public static function custom_fields_configured_at_level ($_level = "auto-detection", $_editable_context = FALSE)
|
280 |
{
|
281 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
282 |
do_action ("ws_plugin__s2member_before_custom_fields_configured_at_level", get_defined_vars ());
|
283 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
284 |
/**/
|
285 |
$level = ($_level === "auto-detection") ? c_ws_plugin__s2member_user_access::user_access_level () : $_level;
|
286 |
+
if ($_level === "auto-detection" && $level < 0 && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies) && preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $item_number, $m) && !empty ($m[1]) && is_numeric ($m[1]))
|
287 |
+
$level = $m[1]; /* A numeric Membership Level # . */
|
288 |
/**/
|
289 |
+
$level = ($level !== "any" && (!is_numeric ($level) || $level < 0)) ? 0 : $level; /* Default. */
|
290 |
/**/
|
291 |
if (($level === "any" || (is_numeric ($level) && $level >= 0)) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"])
|
292 |
{
|
322 |
/**/
|
323 |
echo '<input type="hidden" name="ws_plugin__s2member_registration" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-registration")) . '" />' . "\n";
|
324 |
/**/
|
325 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
326 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before", get_defined_vars ());
|
327 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
328 |
/**/
|
330 |
{
|
331 |
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
|
332 |
/**/
|
333 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
334 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_first_name", get_defined_vars ());
|
335 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
336 |
/**/
|
338 |
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_first_name" id="ws-plugin--s2member-custom-reg-field-first-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_first_name"]) . '" />' . "\n";
|
339 |
echo '<br />' . "\n";
|
340 |
/**/
|
341 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
342 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_first_name", get_defined_vars ());
|
343 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
344 |
/**/
|
345 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
346 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_last_name", get_defined_vars ());
|
347 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
348 |
/**/
|
350 |
echo '<input aria-required="true" type="text" maxlength="100" name="ws_plugin__s2member_custom_reg_field_last_name" id="ws-plugin--s2member-custom-reg-field-last-name" class="ws-plugin--s2member-custom-reg-field" value="' . format_to_edit ($_p["ws_plugin__s2member_custom_reg_field_last_name"]) . '" />' . "\n";
|
351 |
echo '<br />' . "\n";
|
352 |
/**/
|
353 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
354 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_last_name", get_defined_vars ());
|
355 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
356 |
}
|
359 |
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
|
360 |
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
|
361 |
{
|
362 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
363 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_custom_fields", get_defined_vars ());
|
364 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
365 |
/**/
|
368 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
|
369 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
370 |
/**/
|
371 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
372 |
if (apply_filters ("ws_plugin__s2member_during_ms_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
|
373 |
{
|
374 |
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
|
381 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
382 |
}
|
383 |
/**/
|
384 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
385 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_custom_fields", get_defined_vars ());
|
386 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
387 |
}
|
388 |
/**/
|
389 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
|
390 |
{
|
391 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
392 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_before_opt_in", get_defined_vars ());
|
393 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
394 |
/**/
|
398 |
echo '</label>' . "\n";
|
399 |
echo '<br />' . "\n";
|
400 |
/**/
|
401 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
402 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after_opt_in", get_defined_vars ());
|
403 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
404 |
}
|
405 |
/**/
|
406 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
407 |
do_action ("ws_plugin__s2member_during_ms_custom_registration_fields_after", get_defined_vars ());
|
408 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
409 |
}
|
410 |
/**/
|
411 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
412 |
do_action ("ws_plugin__s2member_after_ms_custom_registration_fields", get_defined_vars ());
|
413 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
414 |
/**/
|
436 |
/**/
|
437 |
$tabindex = 20; /* Incremented tabindex starting with 20. */
|
438 |
/**/
|
439 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
440 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before", get_defined_vars ());
|
441 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
442 |
/**/
|
443 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
|
444 |
{
|
445 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
446 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_user_pass", get_defined_vars ());
|
447 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
448 |
/**/
|
461 |
/**/
|
462 |
echo '</p>' . "\n";
|
463 |
/**/
|
464 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
465 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_user_pass", get_defined_vars ());
|
466 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
467 |
}
|
470 |
{
|
471 |
echo '<div class="ws-plugin--s2member-custom-reg-field-divider-section"></div>' . "\n";
|
472 |
/**/
|
473 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
474 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_first_name", get_defined_vars ());
|
475 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
476 |
/**/
|
481 |
echo '</label>' . "\n";
|
482 |
echo '</p>' . "\n";
|
483 |
/**/
|
484 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
485 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_first_name", get_defined_vars ());
|
486 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
487 |
/**/
|
488 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
489 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_last_name", get_defined_vars ());
|
490 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
491 |
/**/
|
496 |
echo '</label>' . "\n";
|
497 |
echo '</p>' . "\n";
|
498 |
/**/
|
499 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
500 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_last_name", get_defined_vars ());
|
501 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
502 |
}
|
505 |
if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level ("auto-detection", "registration"))
|
506 |
foreach (json_decode ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field)
|
507 |
{
|
508 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
509 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_custom_fields", get_defined_vars ());
|
510 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
511 |
/**/
|
514 |
$field_var = preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field["id"]));
|
515 |
$field_id_class = preg_replace ("/_/", "-", $field_var);
|
516 |
/**/
|
517 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
518 |
if (apply_filters ("ws_plugin__s2member_during_custom_registration_fields_during_custom_fields_display", true, get_defined_vars ()))
|
519 |
{
|
520 |
if (!empty ($field["section"]) && $field["section"] === "yes") /* Starts a new section? */
|
529 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
530 |
}
|
531 |
/**/
|
532 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
533 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_custom_fields", get_defined_vars ());
|
534 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
535 |
}
|
536 |
/**/
|
537 |
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_opt_in"] && c_ws_plugin__s2member_list_servers::list_servers_integrated ())
|
538 |
{
|
539 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
540 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_before_opt_in", get_defined_vars ());
|
541 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
542 |
/**/
|
547 |
echo '</label>' . "\n";
|
548 |
echo '</p>' . "\n";
|
549 |
/**/
|
550 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
551 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after_opt_in", get_defined_vars ());
|
552 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
553 |
}
|
554 |
/**/
|
555 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
556 |
do_action ("ws_plugin__s2member_during_custom_registration_fields_after", get_defined_vars ());
|
557 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
558 |
/**/
|
559 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
560 |
do_action ("ws_plugin__s2member_after_custom_registration_fields", get_defined_vars ());
|
561 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
562 |
/**/
|
includes/classes/email-configs.inc.php
CHANGED
@@ -28,6 +28,27 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
|
|
28 |
class c_ws_plugin__s2member_email_configs
|
29 |
{
|
30 |
/**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
* Modifies email From: "Name" <address>.
|
32 |
*
|
33 |
* These Filters are only needed during registration.
|
@@ -41,7 +62,7 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
|
|
41 |
{
|
42 |
do_action ("ws_plugin__s2member_before_email_config", get_defined_vars ());
|
43 |
/**/
|
44 |
-
c_ws_plugin__s2member_email_configs::email_config_release (); /* Release all
|
45 |
/**/
|
46 |
add_filter ("wp_mail_from", "c_ws_plugin__s2member_email_configs::_email_config_email");
|
47 |
add_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
|
@@ -151,6 +172,148 @@ if (!class_exists ("c_ws_plugin__s2member_email_configs"))
|
|
151 |
/**/
|
152 |
return apply_filters ("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
|
153 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
}
|
155 |
}
|
156 |
?>
|
28 |
class c_ws_plugin__s2member_email_configs
|
29 |
{
|
30 |
/**
|
31 |
+
* Filters email addresses passed to ``wp_mail()``.
|
32 |
+
*
|
33 |
+
* @package s2Member\Email_Configs
|
34 |
+
* @since 3.5
|
35 |
+
*
|
36 |
+
* @attaches-to ``add_filter("wp_mail");``
|
37 |
+
*
|
38 |
+
* @param array $array Expects an array passed through by the Filter.
|
39 |
+
* @return array Returns the array passed through by the Filter.
|
40 |
+
*/
|
41 |
+
public static function email_filter ($array = FALSE)
|
42 |
+
{
|
43 |
+
if (!empty ($array["to"]) && is_string ($array["to"]))
|
44 |
+
$array["to"] = str_replace (array ('\"', '"'), "", $array["to"]);
|
45 |
+
/**/
|
46 |
+
if (!empty ($array["to"]) && is_string ($array["to"]) && strpos ($array["to"], ";") !== false)
|
47 |
+
$array["to"] = c_ws_plugin__s2member_utils_strings::trim_deep (preg_split ("/;+/", $array["to"]));
|
48 |
+
/**/
|
49 |
+
return apply_filters ("ws_plugin__s2member_after_email_filter", $array, get_defined_vars ());
|
50 |
+
}
|
51 |
+
/**
|
52 |
* Modifies email From: "Name" <address>.
|
53 |
*
|
54 |
* These Filters are only needed during registration.
|
62 |
{
|
63 |
do_action ("ws_plugin__s2member_before_email_config", get_defined_vars ());
|
64 |
/**/
|
65 |
+
c_ws_plugin__s2member_email_configs::email_config_release (); /* Release all. */
|
66 |
/**/
|
67 |
add_filter ("wp_mail_from", "c_ws_plugin__s2member_email_configs::_email_config_email");
|
68 |
add_filter ("wp_mail_from_name", "c_ws_plugin__s2member_email_configs::_email_config_name");
|
172 |
/**/
|
173 |
return apply_filters ("ws_plugin__s2member_ms_nice_email_roles", $message, get_defined_vars ());
|
174 |
}
|
175 |
+
/**
|
176 |
+
* Handles new User notifications.
|
177 |
+
*
|
178 |
+
* @package s2Member\Email_Configs
|
179 |
+
* @since 110707
|
180 |
+
*
|
181 |
+
* @param str|int $user_id A numeric WordPress® User ID.
|
182 |
+
* @param str $user_pass Optional. A plain text version of the User's password.
|
183 |
+
* If omitted, only the administrative notification will be sent.
|
184 |
+
* @param array $notify An array of directives. Must be non-empty, with at least one of these values `user,admin`.
|
185 |
+
* @return bool True if all required parameters are supplied, else false.
|
186 |
+
*/
|
187 |
+
function new_user_notification ($user_id = FALSE, $user_pass = FALSE, $notify = array ("user", "admin"))
|
188 |
+
{
|
189 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
190 |
+
do_action ("ws_plugin__s2member_before_new_user_notification", get_defined_vars ());
|
191 |
+
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
192 |
+
/**/
|
193 |
+
if ($user_id && ($user = new WP_User ($user_id)) && ($user_id = $user->ID) && is_array ($notify) && !empty ($notify))
|
194 |
+
{
|
195 |
+
if (in_array ("user", $notify) && !empty ($user_pass)) /* Send User a notification? */
|
196 |
+
{
|
197 |
+
$fields = get_user_option ("s2member_custom_fields", $user_id);
|
198 |
+
$cv = preg_split ("/\|/", get_user_option ("s2member_custom", $user_id));
|
199 |
+
$user_full_name = trim ($user->first_name . " " . $user->last_name);
|
200 |
+
$user_ip = $_SERVER["REMOTE_ADDR"];
|
201 |
+
/**/
|
202 |
+
if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]))
|
203 |
+
if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)))
|
204 |
+
if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $sbj)))
|
205 |
+
if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $sbj)))
|
206 |
+
if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $sbj)))
|
207 |
+
if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $sbj)))
|
208 |
+
if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $sbj)))
|
209 |
+
if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $sbj)))
|
210 |
+
if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $sbj)))
|
211 |
+
if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $sbj)))
|
212 |
+
if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $sbj)))
|
213 |
+
{
|
214 |
+
if (is_array ($fields) && !empty ($fields))
|
215 |
+
foreach ($fields as $var => $val) /* Custom Registration Fields. */
|
216 |
+
if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $sbj)))
|
217 |
+
break;
|
218 |
+
/**/
|
219 |
+
if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]))
|
220 |
+
if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)))
|
221 |
+
if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $msg)))
|
222 |
+
if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $msg)))
|
223 |
+
if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $msg)))
|
224 |
+
if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $msg)))
|
225 |
+
if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $msg)))
|
226 |
+
if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $msg)))
|
227 |
+
if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $msg)))
|
228 |
+
if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $msg)))
|
229 |
+
if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $msg)))
|
230 |
+
{
|
231 |
+
if (is_array ($fields) && !empty ($fields))
|
232 |
+
foreach ($fields as $var => $val) /* Custom Registration Fields. */
|
233 |
+
if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $msg)))
|
234 |
+
break;
|
235 |
+
/**/
|
236 |
+
if (($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
|
237 |
+
{
|
238 |
+
wp_mail ('"' . c_ws_plugin__s2member_utils_strings::esc_dq ($user_full_name) . '" <' . $user->user_email . '>', $sbj, $msg, "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");
|
239 |
+
}
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
243 |
+
/**/
|
244 |
+
if (in_array ("admin", $notify) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"])
|
245 |
+
{
|
246 |
+
$fields = get_user_option ("s2member_custom_fields", $user_id);
|
247 |
+
$cv = preg_split ("/\|/", get_user_option ("s2member_custom", $user_id));
|
248 |
+
$user_full_name = trim ($user->first_name . " " . $user->last_name);
|
249 |
+
$user_ip = $_SERVER["REMOTE_ADDR"];
|
250 |
+
/**/
|
251 |
+
if (($rec = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_recipients"]))
|
252 |
+
if (($rec = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $rec)))
|
253 |
+
if (($rec = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $rec)))
|
254 |
+
if (($rec = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name)), $rec)))
|
255 |
+
if (($rec = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name)), $rec)))
|
256 |
+
if (($rec = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_dq (c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name)), $rec)))
|
257 |
+
if (($rec = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $rec)))
|
258 |
+
if (($rec = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $rec)))
|
259 |
+
if (($rec = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $rec)))
|
260 |
+
if (($rec = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $rec)))
|
261 |
+
if (($rec = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $rec)))
|
262 |
+
{
|
263 |
+
if (is_array ($fields) && !empty ($fields))
|
264 |
+
foreach ($fields as $var => $val) /* Custom Registration Fields. */
|
265 |
+
if (!($rec = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $rec)))
|
266 |
+
break;
|
267 |
+
/**/
|
268 |
+
if (($sbj = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_subject"]))
|
269 |
+
if (($sbj = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $sbj)))
|
270 |
+
if (($sbj = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $sbj)))
|
271 |
+
if (($sbj = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $sbj)))
|
272 |
+
if (($sbj = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $sbj)))
|
273 |
+
if (($sbj = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $sbj)))
|
274 |
+
if (($sbj = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $sbj)))
|
275 |
+
if (($sbj = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $sbj)))
|
276 |
+
if (($sbj = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $sbj)))
|
277 |
+
if (($sbj = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $sbj)))
|
278 |
+
if (($sbj = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $sbj)))
|
279 |
+
{
|
280 |
+
if (is_array ($fields) && !empty ($fields))
|
281 |
+
foreach ($fields as $var => $val) /* Custom Registration Fields. */
|
282 |
+
if (!($sbj = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $sbj)))
|
283 |
+
break;
|
284 |
+
/**/
|
285 |
+
if (($msg = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_admin_email_message"]))
|
286 |
+
if (($msg = preg_replace ("/%%cv([0-9]+)%%/ei", 'trim($cv[$1])', $msg)))
|
287 |
+
if (($msg = preg_replace ("/%%wp_login_url%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (wp_login_url ()), $msg)))
|
288 |
+
if (($msg = preg_replace ("/%%user_first_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->first_name), $msg)))
|
289 |
+
if (($msg = preg_replace ("/%%user_last_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->last_name), $msg)))
|
290 |
+
if (($msg = preg_replace ("/%%user_full_name%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_full_name), $msg)))
|
291 |
+
if (($msg = preg_replace ("/%%user_email%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_email), $msg)))
|
292 |
+
if (($msg = preg_replace ("/%%user_login%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user->user_login), $msg)))
|
293 |
+
if (($msg = preg_replace ("/%%user_pass%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_pass), $msg)))
|
294 |
+
if (($msg = preg_replace ("/%%user_ip%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_ip), $msg)))
|
295 |
+
if (($msg = preg_replace ("/%%user_id%%/i", c_ws_plugin__s2member_utils_strings::esc_ds ($user_id), $msg)))
|
296 |
+
{
|
297 |
+
if (is_array ($fields) && !empty ($fields))
|
298 |
+
foreach ($fields as $var => $val) /* Custom Registration Fields. */
|
299 |
+
if (!($msg = preg_replace ("/%%" . preg_quote ($var, "/") . "%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (maybe_serialize ($val)), $msg)))
|
300 |
+
break;
|
301 |
+
/**/
|
302 |
+
if (($recipients = preg_split ("/;+/", preg_replace ("/%%(.+?)%%/i", "", $rec))) && ($sbj = trim (preg_replace ("/%%(.+?)%%/i", "", $sbj))) && ($msg = trim (preg_replace ("/%%(.+?)%%/i", "", $msg))))
|
303 |
+
{
|
304 |
+
foreach (c_ws_plugin__s2member_utils_strings::trim_deep ($recipients) as $recipient)
|
305 |
+
($recipient) ? wp_mail ($recipient, $sbj, $msg, "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;
|
306 |
+
}
|
307 |
+
}
|
308 |
+
}
|
309 |
+
}
|
310 |
+
}
|
311 |
+
/**/
|
312 |
+
return apply_filters ("ws_plugin__s2member_new_user_notification", true, get_defined_vars ());
|
313 |
+
}
|
314 |
+
else
|
315 |
+
return apply_filters ("ws_plugin__s2member_new_user_notification", false, get_defined_vars ());
|
316 |
+
}
|
317 |
}
|
318 |
}
|
319 |
?>
|
includes/classes/installation.inc.php
CHANGED
@@ -35,7 +35,7 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
|
|
35 |
*
|
36 |
* @return null
|
37 |
*/
|
38 |
-
public static function activate ()
|
39 |
{
|
40 |
global $wpdb; /* Global database object reference. */
|
41 |
global $current_site, $current_blog; /* Multisite. */
|
@@ -44,6 +44,8 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
|
|
44 |
/**/
|
45 |
c_ws_plugin__s2member_roles_caps::config_roles (); /* Config Roles/Caps. */
|
46 |
/**/
|
|
|
|
|
47 |
if (!is_dir ($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]))
|
48 |
if (is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir))))
|
49 |
mkdir ($files_dir, 0777, true);
|
@@ -95,7 +97,7 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
|
|
95 |
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "blog:users.php", false, false, true);
|
96 |
}
|
97 |
/**/
|
98 |
-
$notice = '<strong>s2Member</strong> has been <strong>
|
99 |
$notice .= 'You now have version ' . esc_html (WS_PLUGIN__S2MEMBER_VERSION) . '. Your existing configuration remains.';
|
100 |
/**/
|
101 |
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) /* No Changelog on a Multisite Farm. */
|
@@ -189,6 +191,7 @@ if (!class_exists ("c_ws_plugin__s2member_installation"))
|
|
189 |
delete_option("ws_plugin__s2member_notices");
|
190 |
delete_option("ws_plugin__s2member_options");
|
191 |
delete_option("ws_plugin__s2member_configured");
|
|
|
192 |
delete_option("ws_plugin__s2member_activated_version");
|
193 |
delete_option("ws_plugin__s2member_activated_mms_version");
|
194 |
/**/
|
35 |
*
|
36 |
* @return null
|
37 |
*/
|
38 |
+
public static function activate ($reactivation_reason = FALSE)
|
39 |
{
|
40 |
global $wpdb; /* Global database object reference. */
|
41 |
global $current_site, $current_blog; /* Multisite. */
|
44 |
/**/
|
45 |
c_ws_plugin__s2member_roles_caps::config_roles (); /* Config Roles/Caps. */
|
46 |
/**/
|
47 |
+
update_option ("ws_plugin__s2member_activated_levels", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]);
|
48 |
+
/**/
|
49 |
if (!is_dir ($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]))
|
50 |
if (is_writable (dirname (c_ws_plugin__s2member_utils_dirs::strip_dir_app_data ($files_dir))))
|
51 |
mkdir ($files_dir, 0777, true);
|
97 |
c_ws_plugin__s2member_admin_notices::enqueue_admin_notice ($notice, "blog:users.php", false, false, true);
|
98 |
}
|
99 |
/**/
|
100 |
+
$notice = '<strong>s2Member</strong> has been <strong>reactivated</strong>, with ' . (($reactivation_reason === "levels") ? '<code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) . '</code> Membership Levels' : 'the latest version') . '.<br />';
|
101 |
$notice .= 'You now have version ' . esc_html (WS_PLUGIN__S2MEMBER_VERSION) . '. Your existing configuration remains.';
|
102 |
/**/
|
103 |
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) /* No Changelog on a Multisite Farm. */
|
191 |
delete_option("ws_plugin__s2member_notices");
|
192 |
delete_option("ws_plugin__s2member_options");
|
193 |
delete_option("ws_plugin__s2member_configured");
|
194 |
+
delete_option("ws_plugin__s2member_activated_levels");
|
195 |
delete_option("ws_plugin__s2member_activated_version");
|
196 |
delete_option("ws_plugin__s2member_activated_mms_version");
|
197 |
/**/
|
includes/classes/labels.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_labels"))
|
21 |
{
|
@@ -65,10 +65,10 @@ if (!class_exists ("c_ws_plugin__s2member_labels"))
|
|
65 |
{
|
66 |
if ($text && $context && stripos ($context, "User role") === 0 && ($role = $text))
|
67 |
{
|
68 |
-
if (preg_match ("/^(Free )?Subscriber$/i", $role) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"])
|
69 |
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"];
|
70 |
/**/
|
71 |
-
else if (preg_match ("/^s2Member Level ([0-9]+)$/i", $role, $m) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"])
|
72 |
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"];
|
73 |
/**/
|
74 |
$translation = apply_filters ("_ws_plugin__s2member_label_translations", $translation, get_defined_vars ());
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_labels"))
|
21 |
{
|
65 |
{
|
66 |
if ($text && $context && stripos ($context, "User role") === 0 && ($role = $text))
|
67 |
{
|
68 |
+
if (preg_match ("/^(Free )?Subscriber$/i", $role) && !empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]))
|
69 |
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"];
|
70 |
/**/
|
71 |
+
else if (preg_match ("/^s2Member Level ([0-9]+)$/i", $role, $m) && !empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"]))
|
72 |
$translation = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $m[1] . "_label"];
|
73 |
/**/
|
74 |
$translation = apply_filters ("_ws_plugin__s2member_label_translations", $translation, get_defined_vars ());
|
includes/classes/login-customizations.inc.php
CHANGED
@@ -96,7 +96,8 @@ if (!class_exists ("c_ws_plugin__s2member_login_customizations"))
|
|
96 |
$a[] = 'body, body * { font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_size"] . $i . '; }';
|
97 |
$a[] = 'body, body * { font-family:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_family"] . $i . '; }';
|
98 |
/**/
|
99 |
-
|
|
|
100 |
/**/
|
101 |
$a[] = 'div#login { width:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"] . 'px' . $i . '; }';
|
102 |
$a[] = 'div#login h1 a { background:url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"] . ') no-repeat top center' . $i . '; }';
|
@@ -105,6 +106,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_customizations"))
|
|
105 |
$a[] = 'div#login form { -moz-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; -webkit-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; }';
|
106 |
/**/
|
107 |
$a[] = 'div#login p#nav, div#login p#nav a, div#login p#nav a:hover, div#login p#nav a:active, div#login p#nav a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; }';
|
|
|
108 |
/**/
|
109 |
$a[] = 'div#login form p { margin:2px 0 16px 0' . $i . '; }'; /* Handles paragraph margins inside the form. */
|
110 |
$a[] = 'div#login form input[type="text"], div#login form input[type="password"], div#login form textarea, div#login form select { font-weight:normal' . $i . '; color:#333333' . $i . '; background:none repeat scroll 0 0 #FBFBFB' . $i . '; border:1px solid #E5E5E5' . $i . '; font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_field_size"] . $i . '; margin:0' . $i . '; padding:3px' . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; width:100%' . $i . '; width:98%' . $i . ' !ie<8; margin-right:2%' . $i . ' !ie<8; box-sizing:border-box' . $i . '; -ms-box-sizing:border-box' . $i . '; -moz-box-sizing:border-box' . $i . '; -webkit-box-sizing:border-box' . $i . '; }';
|
96 |
$a[] = 'body, body * { font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_size"] . $i . '; }';
|
97 |
$a[] = 'body, body * { font-family:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_family"] . $i . '; }';
|
98 |
/**/
|
99 |
+
if (!version_compare (get_bloginfo ("version"), "3.2-RC4", ">=")) /* Backward compatibility. */
|
100 |
+
$a[] = 'p#backtoblog a, p#backtoblog a:hover, p#backtoblog a:active, p#backtoblog a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; top:15px' . $i . '; left:15px' . $i . '; padding:10px' . $i . '; border:1px solid #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; background-color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_color"] . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; }';
|
101 |
/**/
|
102 |
$a[] = 'div#login { width:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src_width"] . 'px' . $i . '; }';
|
103 |
$a[] = 'div#login h1 a { background:url(' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_logo_src"] . ') no-repeat top center' . $i . '; }';
|
106 |
$a[] = 'div#login form { -moz-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; -webkit-box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; box-shadow:1px 1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . ', -1px -1px 5px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_box_shadow_color"] . $i . '; }';
|
107 |
/**/
|
108 |
$a[] = 'div#login p#nav, div#login p#nav a, div#login p#nav a:hover, div#login p#nav a:active, div#login p#nav a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; }';
|
109 |
+
$a[] = 'div#login p#backtoblog, div#login p#backtoblog a, div#login p#backtoblog a:hover, div#login p#backtoblog a:active, div#login p#backtoblog a:focus { color:#' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_color"] . $i . '; text-shadow:1px 1px 3px #' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_background_text_shadow_color"] . $i . '; }';
|
110 |
/**/
|
111 |
$a[] = 'div#login form p { margin:2px 0 16px 0' . $i . '; }'; /* Handles paragraph margins inside the form. */
|
112 |
$a[] = 'div#login form input[type="text"], div#login form input[type="password"], div#login form textarea, div#login form select { font-weight:normal' . $i . '; color:#333333' . $i . '; background:none repeat scroll 0 0 #FBFBFB' . $i . '; border:1px solid #E5E5E5' . $i . '; font-size:' . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_reg_font_field_size"] . $i . '; margin:0' . $i . '; padding:3px' . $i . '; -moz-border-radius:3px' . $i . '; -webkit-border-radius:3px' . $i . '; border-radius:3px' . $i . '; width:100%' . $i . '; width:98%' . $i . ' !ie<8; margin-right:2%' . $i . ' !ie<8; box-sizing:border-box' . $i . '; -ms-box-sizing:border-box' . $i . '; -moz-box-sizing:border-box' . $i . '; -webkit-box-sizing:border-box' . $i . '; }';
|
includes/classes/meta-box-saves.inc.php
CHANGED
@@ -56,28 +56,19 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
|
|
56 |
{
|
57 |
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
|
58 |
{
|
59 |
-
$
|
60 |
-
|
61 |
-
$pages["2"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"]));
|
62 |
-
$pages["3"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"]));
|
63 |
-
$pages["4"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"]));
|
64 |
/**/
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
unset ($pages["1"][$i]);
|
69 |
-
else if (($i = array_search ($page_id, $pages["2"])) !== false)
|
70 |
-
unset ($pages["2"][$i]);
|
71 |
-
else if (($i = array_search ($page_id, $pages["3"])) !== false)
|
72 |
-
unset ($pages["3"][$i]);
|
73 |
-
else if (($i = array_search ($page_id, $pages["4"])) !== false)
|
74 |
-
unset ($pages["4"][$i]);
|
75 |
/**/
|
76 |
-
if (
|
77 |
if ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
|
78 |
array_push ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]], $page_id);
|
79 |
/**/
|
80 |
-
$
|
|
|
81 |
/**/
|
82 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
83 |
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
|
@@ -91,28 +82,19 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
|
|
91 |
{
|
92 |
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
|
93 |
{
|
94 |
-
$
|
95 |
-
|
96 |
-
$posts["2"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"]));
|
97 |
-
$posts["3"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"]));
|
98 |
-
$posts["4"] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"]));
|
99 |
/**/
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
unset ($posts["1"][$i]);
|
104 |
-
else if (($i = array_search ($post_id, $posts["2"])) !== false)
|
105 |
-
unset ($posts["2"][$i]);
|
106 |
-
else if (($i = array_search ($post_id, $posts["3"])) !== false)
|
107 |
-
unset ($posts["3"][$i]);
|
108 |
-
else if (($i = array_search ($post_id, $posts["4"])) !== false)
|
109 |
-
unset ($posts["4"][$i]);
|
110 |
/**/
|
111 |
-
if (
|
112 |
if ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
|
113 |
array_push ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]], $post_id);
|
114 |
/**/
|
115 |
-
$
|
|
|
116 |
/**/
|
117 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
118 |
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
|
56 |
{
|
57 |
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
|
58 |
{
|
59 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
60 |
+
$pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
|
|
|
|
|
|
|
61 |
/**/
|
62 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
63 |
+
if (($i = array_search ($page_id, $pages[$n])) !== false)
|
64 |
+
unset ($pages[$n][$i]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
/**/
|
66 |
+
if (isset ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]))
|
67 |
if ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
|
68 |
array_push ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]], $page_id);
|
69 |
/**/
|
70 |
+
for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
71 |
+
$new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_pages" => trim (implode (",", $pages[$n]))));
|
72 |
/**/
|
73 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
74 |
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
|
82 |
{
|
83 |
if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
|
84 |
{
|
85 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
86 |
+
$posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
|
|
|
|
|
|
|
87 |
/**/
|
88 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
89 |
+
if (($i = array_search ($post_id, $posts[$n])) !== false)
|
90 |
+
unset ($posts[$n][$i]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
/**/
|
92 |
+
if (isset ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
|
93 |
if ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
|
94 |
array_push ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]], $post_id);
|
95 |
/**/
|
96 |
+
for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
97 |
+
$new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_posts" => trim (implode (",", $posts[$n]))));
|
98 |
/**/
|
99 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
100 |
do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
|
includes/classes/meta-box-security.inc.php
CHANGED
@@ -46,26 +46,22 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
|
|
46 |
{
|
47 |
if ($post->post_type === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
|
48 |
{
|
49 |
-
if (!in_array ($page_id, array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])))
|
50 |
{
|
51 |
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
|
52 |
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($page_id) . '" />' . "\n";
|
53 |
/**/
|
54 |
-
$
|
55 |
-
|
56 |
-
$pages["2"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"]);
|
57 |
-
$pages["3"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"]);
|
58 |
-
$pages["4"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"]);
|
59 |
/**/
|
60 |
echo '<p style="margin-left:2px;"><strong>Page Level Restriction?</strong></p>' . "\n";
|
61 |
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
|
62 |
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
|
63 |
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
echo ($pages["4"] !== array ("all")) ? '<option value="4"' . ((in_array ($page_id, $pages["4"])) ? ' selected="selected"' : '') . '>Require Level# 4 ( highest level )</option>' . "\n" : '<option value="" disabled="disabled">Level #4 ( already protects "all" Pages )</option>';
|
69 |
echo '</select><br /><small>* see: <code>General Options -> Page Level Access</code></small>' . "\n";
|
70 |
/**/
|
71 |
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
|
@@ -73,10 +69,11 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
|
|
73 |
{
|
74 |
echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
|
75 |
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
|
76 |
-
echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (implode (",", (array)get_post_meta ($page_id, "s2member_ccaps_req", true))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
|
77 |
echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
|
78 |
}
|
79 |
}
|
|
|
80 |
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
|
81 |
echo 'This Page is your:<br /><strong>Membership Options Page</strong><br />( always publicly available )';
|
82 |
/**/
|
@@ -85,37 +82,42 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
|
|
85 |
/**/
|
86 |
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
|
87 |
echo 'This Page is your:<br /><strong>Download Limit Exceeded Page</strong><br />( automatically guarded by s2Member )';
|
|
|
|
|
|
|
88 |
}
|
89 |
else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
|
90 |
{
|
91 |
-
|
92 |
-
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($post_id) . '" />' . "\n";
|
93 |
-
/**/
|
94 |
-
$posts["0"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"]);
|
95 |
-
$posts["1"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"]);
|
96 |
-
$posts["2"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"]);
|
97 |
-
$posts["3"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"]);
|
98 |
-
$posts["4"] = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"]);
|
99 |
-
/**/
|
100 |
-
echo '<p style="margin-left:2px;"><strong>Post Level Restriction?</strong></p>' . "\n"; /* This allows a site owner to automatically add a Page/Post into their s2Member options. */
|
101 |
-
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
|
102 |
-
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
|
103 |
-
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
|
104 |
-
echo ($posts["0"] !== array ("all")) ? '<option value="0"' . ((in_array ($post_id, $posts["0"])) ? ' selected="selected"' : '') . '>Require Level# 0 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #0 ( already protects "all" Posts )</option>';
|
105 |
-
echo ($posts["1"] !== array ("all")) ? '<option value="1"' . ((in_array ($post_id, $posts["1"])) ? ' selected="selected"' : '') . '>Require Level# 1 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #1 ( already protects "all" Posts )</option>';
|
106 |
-
echo ($posts["2"] !== array ("all")) ? '<option value="2"' . ((in_array ($post_id, $posts["2"])) ? ' selected="selected"' : '') . '>Require Level# 2 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #2 ( already protects "all" Posts )</option>';
|
107 |
-
echo ($posts["3"] !== array ("all")) ? '<option value="3"' . ((in_array ($post_id, $posts["3"])) ? ' selected="selected"' : '') . '>Require Level# 3 ( or higher )</option>' . "\n" : '<option value="" disabled="disabled">Level #3 ( already protects "all" Posts )</option>';
|
108 |
-
echo ($posts["4"] !== array ("all")) ? '<option value="4"' . ((in_array ($post_id, $posts["4"])) ? ' selected="selected"' : '') . '>Require Level# 4 ( highest level )</option>' . "\n" : '<option value="" disabled="disabled">Level #4 ( already protects "all" Posts )</option>';
|
109 |
-
echo '</select><br /><small>* see: <code>General Options -> Post Level Access</code></small>' . "\n";
|
110 |
-
/**/
|
111 |
-
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
|
112 |
-
/* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
|
113 |
{
|
114 |
-
echo '<
|
115 |
-
echo '<
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
|
|
|
|
|
|
119 |
}
|
120 |
}
|
121 |
/**/
|
46 |
{
|
47 |
if ($post->post_type === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
|
48 |
{
|
49 |
+
if (!in_array ($page_id, array_merge (array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]), preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]))))
|
50 |
{
|
51 |
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
|
52 |
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($page_id) . '" />' . "\n";
|
53 |
/**/
|
54 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
55 |
+
$pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
|
|
|
|
|
|
|
56 |
/**/
|
57 |
echo '<p style="margin-left:2px;"><strong>Page Level Restriction?</strong></p>' . "\n";
|
58 |
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
|
59 |
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
|
60 |
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
|
61 |
+
/**/
|
62 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
63 |
+
echo ($pages[$n] !== array ("all")) ? '<option value="' . $n . '"' . ((in_array ($page_id, $pages[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n" : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Pages )</option>' . "\n";
|
64 |
+
/**/
|
|
|
65 |
echo '</select><br /><small>* see: <code>General Options -> Page Level Access</code></small>' . "\n";
|
66 |
/**/
|
67 |
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
|
69 |
{
|
70 |
echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
|
71 |
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
|
72 |
+
echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (trim (implode (",", (array)get_post_meta ($page_id, "s2member_ccaps_req", true)))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
|
73 |
echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
|
74 |
}
|
75 |
}
|
76 |
+
/**/
|
77 |
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
|
78 |
echo 'This Page is your:<br /><strong>Membership Options Page</strong><br />( always publicly available )';
|
79 |
/**/
|
82 |
/**/
|
83 |
else if ($page_id == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
|
84 |
echo 'This Page is your:<br /><strong>Download Limit Exceeded Page</strong><br />( automatically guarded by s2Member )';
|
85 |
+
/**/
|
86 |
+
else if (in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
|
87 |
+
echo 'This Page is a:<br /><strong>Specific Post/Page for sale</strong><br />( already guarded by s2Member )';
|
88 |
}
|
89 |
else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
|
90 |
{
|
91 |
+
if (!in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
{
|
93 |
+
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save" id="ws-plugin--s2member-security-meta-box-save" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-security-meta-box-save")) . '" />' . "\n";
|
94 |
+
echo '<input type="hidden" name="ws_plugin__s2member_security_meta_box_save_id" id="ws-plugin--s2member-security-meta-box-save-id" value="' . esc_attr ($post_id) . '" />' . "\n";
|
95 |
+
/**/
|
96 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
97 |
+
$posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
|
98 |
+
/**/
|
99 |
+
echo '<p style="margin-left:2px;"><strong>Post Level Restriction?</strong></p>' . "\n";
|
100 |
+
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
|
101 |
+
echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
|
102 |
+
echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
|
103 |
+
/**/
|
104 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
105 |
+
echo ($posts[$n] !== array ("all")) ? '<option value="' . $n . '"' . ((in_array ($post_id, $posts[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n" : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Posts )</option>' . "\n";
|
106 |
+
/**/
|
107 |
+
echo '</select><br /><small>* see: <code>General Options -> Post Level Access</code></small>' . "\n";
|
108 |
+
/**/
|
109 |
+
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ())
|
110 |
+
/* ^ Will change once Custom Capabilities are compatible with a Blog Farm. */
|
111 |
+
{
|
112 |
+
echo '<p style="margin-top:15px; margin-left:2px;"><strong>Require Custom Capabilities?</strong></p>' . "\n";
|
113 |
+
echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-ccaps">Custom Capabilities?</label>' . "\n";
|
114 |
+
echo '<input type="text" name="ws_plugin__s2member_security_meta_box_ccaps" id="ws-plugin--s2member-security-meta-box-ccaps" value="' . format_to_edit (trim (implode (",", (array)get_post_meta ($post_id, "s2member_ccaps_req", true)))) . '" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" style="width:99%;" />' . "\n";
|
115 |
+
echo '<br /><small>* see: <code>API Scripting -> Custom Capabilities</code></small>' . "\n";
|
116 |
+
}
|
117 |
}
|
118 |
+
/**/
|
119 |
+
else if (in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
|
120 |
+
echo 'This Post is a:<br /><strong>Specific Post/Page for sale</strong><br />( already guarded by s2Member )';
|
121 |
}
|
122 |
}
|
123 |
/**/
|
includes/classes/option-forces.inc.php
CHANGED
@@ -143,7 +143,7 @@ if (!class_exists ("c_ws_plugin__s2member_option_forces"))
|
|
143 |
else if (!is_admin () && !$users_can_register) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */
|
144 |
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || !is_main_site () || is_super_admin () || current_user_can ("create_users"))
|
145 |
{
|
146 |
-
if ((is_multisite () && is_super_admin ()) || current_user_can ("create_users") ||
|
147 |
{
|
148 |
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
|
149 |
}
|
@@ -181,17 +181,15 @@ if (!class_exists ("c_ws_plugin__s2member_option_forces"))
|
|
181 |
/**/
|
182 |
else if (!is_admin () && $users_can_register !== "all") /* Do NOT run these checks on option pages; it's confusing to a site owner. */
|
183 |
{
|
184 |
-
if (is_super_admin () || current_user_can ("create_users") || (($
|
185 |
{
|
186 |
if (is_super_admin () || current_user_can ("create_users")) /* Either a Super Administrator, or an Administrator that can create. */
|
187 |
{
|
188 |
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
|
189 |
}
|
190 |
-
else if ($
|
191 |
{
|
192 |
-
|
193 |
-
/**/
|
194 |
-
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $level]) /* Blog(s) allowed? */
|
195 |
{
|
196 |
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
|
197 |
}
|
143 |
else if (!is_admin () && !$users_can_register) /* Do NOT run these security checks on option pages; it's confusing to a site owner. */
|
144 |
if (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || !is_main_site () || is_super_admin () || current_user_can ("create_users"))
|
145 |
{
|
146 |
+
if ((is_multisite () && is_super_admin ()) || current_user_can ("create_users") || c_ws_plugin__s2member_register_access::reg_cookies_ok ())
|
147 |
{
|
148 |
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
|
149 |
}
|
181 |
/**/
|
182 |
else if (!is_admin () && $users_can_register !== "all") /* Do NOT run these checks on option pages; it's confusing to a site owner. */
|
183 |
{
|
184 |
+
if (is_super_admin () || current_user_can ("create_users") || (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies)))
|
185 |
{
|
186 |
if (is_super_admin () || current_user_can ("create_users")) /* Either a Super Administrator, or an Administrator that can create. */
|
187 |
{
|
188 |
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
|
189 |
}
|
190 |
+
else if (!empty ($reg_cookies) && preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $item_number, $m) && !empty ($m[1]) && is_numeric ($level = $m[1]))
|
191 |
{
|
192 |
+
if (!empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $level])) /* Blog(s)? */
|
|
|
|
|
193 |
{
|
194 |
return apply_filters ("ws_plugin__s2member_check_mms_register_access", ($users_can_register = "all"), get_defined_vars ());
|
195 |
}
|
includes/classes/paypal-notify-in.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
21 |
{
|
@@ -58,7 +58,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
58 |
/**/
|
59 |
if (!empty ($_GET["s2member_paypal_notify"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || $_GET["s2member_paypal_proxy"]))
|
60 |
{
|
61 |
-
@ignore_user_abort
|
62 |
/**/
|
63 |
include_once ABSPATH . "wp-admin/includes/admin.php"; /* Get administrative functions. Needed for `wp_delete_user()`. */
|
64 |
/**/
|
@@ -85,7 +85,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
85 |
/*
|
86 |
Custom conditionals can be applied by Filters.
|
87 |
*/
|
88 |
-
eval
|
89 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
|
90 |
{
|
91 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -99,7 +99,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
99 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
100 |
&& ($paypal["txn_id"])/**/)
|
101 |
{
|
102 |
-
eval
|
103 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_virtual_terminal", get_defined_vars ());
|
104 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
105 |
/**/
|
@@ -109,11 +109,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
109 |
/**/
|
110 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
111 |
/**/
|
112 |
-
eval
|
113 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_virtual_terminal", get_defined_vars ());
|
114 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
115 |
/**/
|
116 |
-
eval
|
117 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_virtual_terminal", get_defined_vars ());
|
118 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
119 |
}
|
@@ -127,7 +127,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
127 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
128 |
&& ($paypal["txn_id"])/**/)
|
129 |
{
|
130 |
-
eval
|
131 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
|
132 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
133 |
/**/
|
@@ -138,11 +138,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
138 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
139 |
$paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
|
140 |
/**/
|
141 |
-
eval
|
142 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
|
143 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
144 |
/**/
|
145 |
-
eval
|
146 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
|
147 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
148 |
}
|
@@ -156,7 +156,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
156 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
157 |
&& ($paypal["txn_id"])/**/)
|
158 |
{
|
159 |
-
eval
|
160 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
|
161 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
162 |
/**/
|
@@ -167,11 +167,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
167 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
168 |
$paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
|
169 |
/**/
|
170 |
-
eval
|
171 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
|
172 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
173 |
/**/
|
174 |
-
eval
|
175 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
|
176 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
177 |
}
|
@@ -185,7 +185,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
185 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
186 |
&& ($paypal["txn_id"])/**/)
|
187 |
{
|
188 |
-
eval
|
189 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_send_money", get_defined_vars ());
|
190 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
191 |
/**/
|
@@ -195,11 +195,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
195 |
/**/
|
196 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
197 |
/**/
|
198 |
-
eval
|
199 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_send_money", get_defined_vars ());
|
200 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
201 |
/**/
|
202 |
-
eval
|
203 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_send_money", get_defined_vars ());
|
204 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
205 |
}
|
@@ -207,11 +207,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
207 |
Specific Post/Page Access ~ Sales.
|
208 |
*/
|
209 |
else if (/**/(preg_match ("/^web_accept$/i", $paypal["txn_type"]))/**/
|
210 |
-
&& (preg_match ("
|
211 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
212 |
&& ($paypal["payer_email"] && $paypal["txn_id"])/**/)
|
213 |
{
|
214 |
-
eval
|
215 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
|
216 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
217 |
/**/
|
@@ -375,14 +375,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
375 |
}
|
376 |
}
|
377 |
/**/
|
378 |
-
eval
|
379 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
|
380 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
381 |
}
|
382 |
else
|
383 |
$paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
|
384 |
/**/
|
385 |
-
eval
|
386 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
|
387 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
388 |
}
|
@@ -392,12 +392,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
392 |
( option_name1, option_selection1 ); which allow account modifications.
|
393 |
*/
|
394 |
else if (/**/(preg_match ("/^(web_accept|subscr_signup)$/i", $paypal["txn_type"]))/**/
|
395 |
-
&& (preg_match ("
|
396 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
397 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
398 |
&& ($paypal["payer_email"])/**/)
|
399 |
{
|
400 |
-
eval
|
401 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
|
402 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
403 |
/**/
|
@@ -423,7 +423,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
423 |
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
|
424 |
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
|
425 |
/**/
|
426 |
-
eval
|
427 |
/*
|
428 |
New Subscription with advanced update vars ( option_name1, option_selection1 )? These variables are used in Subscr. Modifications.
|
429 |
*/
|
@@ -431,7 +431,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
431 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified.
|
432 |
PayPal® will not allow the `modify=1|2` parameter to be used in those scenarios, because technically there is no billing to update; only the account. */
|
433 |
{
|
434 |
-
eval
|
435 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
|
436 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
437 |
/**/
|
@@ -444,7 +444,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
444 |
{
|
445 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
446 |
/**/
|
447 |
-
eval
|
448 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_signup_w_update_vars", get_defined_vars ());
|
449 |
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
|
450 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -455,7 +455,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
455 |
/**/
|
456 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
457 |
{
|
458 |
-
add_existing_user_to_blog
|
459 |
$user = new WP_User ($user_id);
|
460 |
}
|
461 |
/**/
|
@@ -607,7 +607,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
607 |
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
|
608 |
}
|
609 |
/**/
|
610 |
-
eval
|
611 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
|
612 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
613 |
}
|
@@ -617,7 +617,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
617 |
else
|
618 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the on0 and os0 variables in your Button Code.";
|
619 |
/**/
|
620 |
-
eval
|
621 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
|
622 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
623 |
}
|
@@ -626,7 +626,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
626 |
*/
|
627 |
else /* Else this is a normal Subscription signup, we are not updating anything. */
|
628 |
{
|
629 |
-
eval
|
630 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
631 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
632 |
/**/
|
@@ -764,14 +764,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
764 |
}
|
765 |
}
|
766 |
/**/
|
767 |
-
eval
|
768 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
769 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
770 |
}
|
771 |
else
|
772 |
$paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
|
773 |
/**/
|
774 |
-
eval
|
775 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
776 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
777 |
}
|
@@ -960,7 +960,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
960 |
set_transient ("s2m_" . md5 ("s2member_transient_ipn_signup_vars_" . $paypal["subscr_id"]), $ipn_signup_vars, 43200);
|
961 |
}
|
962 |
/**/
|
963 |
-
eval
|
964 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
|
965 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
966 |
}
|
@@ -972,12 +972,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
972 |
*/
|
973 |
else if (/**/(preg_match ("/^recurring_payment_profile_created$/i", $paypal["txn_type"]))/**/
|
974 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
|
975 |
-
&& (preg_match ("
|
976 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
|
977 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
|
978 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
979 |
{
|
980 |
-
eval
|
981 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
|
982 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
983 |
/**/
|
@@ -988,11 +988,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
988 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
989 |
$paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
|
990 |
/**/
|
991 |
-
eval
|
992 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
|
993 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
994 |
/**/
|
995 |
-
eval
|
996 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
|
997 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
998 |
}
|
@@ -1000,10 +1000,10 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1000 |
Subscription modifications.
|
1001 |
*/
|
1002 |
else if (/**/(preg_match ("/^subscr_modify$/i", $paypal["txn_type"]))/**/
|
1003 |
-
&& (preg_match ("
|
1004 |
&& ($paypal["subscr_id"] && $paypal["payer_email"])/**/)
|
1005 |
{
|
1006 |
-
eval
|
1007 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
|
1008 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1009 |
/**/
|
@@ -1023,7 +1023,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1023 |
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
|
1024 |
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
|
1025 |
/**/
|
1026 |
-
eval
|
1027 |
/**/
|
1028 |
if (($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
1029 |
{
|
@@ -1031,7 +1031,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1031 |
{
|
1032 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
1033 |
/**/
|
1034 |
-
eval
|
1035 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_modify", get_defined_vars ());
|
1036 |
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
|
1037 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -1042,7 +1042,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1042 |
/**/
|
1043 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
1044 |
{
|
1045 |
-
add_existing_user_to_blog
|
1046 |
$user = new WP_User ($user_id);
|
1047 |
}
|
1048 |
/**/
|
@@ -1187,7 +1187,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1187 |
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
|
1188 |
}
|
1189 |
/**/
|
1190 |
-
eval
|
1191 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
|
1192 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1193 |
}
|
@@ -1197,7 +1197,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1197 |
else
|
1198 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
|
1199 |
/**/
|
1200 |
-
eval
|
1201 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
|
1202 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1203 |
}
|
@@ -1207,20 +1207,20 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1207 |
*/
|
1208 |
else if (/**/(preg_match ("/^(subscr_payment|recurring_payment)$/i", $paypal["txn_type"]))/**/
|
1209 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
|
1210 |
-
&& (preg_match ("
|
1211 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
|
1212 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"])) /* Status OK? This goes thru a list of known status issues. */
|
1213 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
|
1214 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/
|
1215 |
&& ($paypal["txn_id"] && $paypal["mc_gross"])/**/)
|
1216 |
{
|
1217 |
-
eval
|
1218 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
|
1219 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1220 |
/**/
|
1221 |
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "subscr_payment|recurring_payment") . ".";
|
1222 |
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
|
1223 |
-
sleep
|
1224 |
/* It is NOT a big deal if they do. However, s2Member goes to sleep here, just to help keep the log files in a logical order. */
|
1225 |
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
|
1226 |
/**/
|
@@ -1346,7 +1346,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1346 |
$paypal["s2member_log"][] = "Payment Notification Emails have been processed.";
|
1347 |
}
|
1348 |
/**/
|
1349 |
-
eval
|
1350 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
|
1351 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1352 |
}
|
@@ -1365,7 +1365,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1365 |
set_transient ("s2m_" . md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $ipn, 43200);
|
1366 |
}
|
1367 |
/**/
|
1368 |
-
eval
|
1369 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
|
1370 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1371 |
}
|
@@ -1377,12 +1377,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1377 |
*/
|
1378 |
else if (/**/(preg_match ("/^(subscr_failed|recurring_payment_failed|recurring_payment_skipped)$/i", $paypal["txn_type"]))/**/
|
1379 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
|
1380 |
-
&& (preg_match ("
|
1381 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
|
1382 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
|
1383 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
1384 |
{
|
1385 |
-
eval
|
1386 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
|
1387 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1388 |
/**/
|
@@ -1394,11 +1394,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1394 |
$paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
|
1395 |
$paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
|
1396 |
/**/
|
1397 |
-
eval
|
1398 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
|
1399 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1400 |
/**/
|
1401 |
-
eval
|
1402 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
|
1403 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1404 |
}
|
@@ -1412,14 +1412,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1412 |
&& !(preg_match ("/^recurring_payment_profile_cancel$/i", $paypal["txn_type"]) && preg_match ("/^failed$/i", $paypal["initial_payment_status"]))
|
1413 |
/* ^^ Bypass this case ( for now ) "recurring_payment_profile_cancel" with an initial failed payment warrants an EOT instead of a cancellation. */
|
1414 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* item_number? */
|
1415 |
-
&& (preg_match ("
|
1416 |
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || ($paypal["period1"] = "0 D"))/**/
|
1417 |
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal))) /* Must have a period3 value. */
|
1418 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal))) /* Must have this. */
|
1419 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal))) /* Must have this. */
|
1420 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
1421 |
{
|
1422 |
-
eval
|
1423 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
|
1424 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1425 |
/**/
|
@@ -1448,7 +1448,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1448 |
/**/
|
1449 |
$paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
1450 |
/**/
|
1451 |
-
eval
|
1452 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
|
1453 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1454 |
}
|
@@ -1539,7 +1539,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1539 |
else
|
1540 |
$paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
|
1541 |
/**/
|
1542 |
-
eval
|
1543 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
|
1544 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1545 |
}
|
@@ -1569,13 +1569,13 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1569 |
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || !$recurring || ($paypal["period1"] = "0 D"))/**/
|
1570 |
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal)) || !$recurring) /* Was it even recurring? */
|
1571 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Do we have a valid item_number? */
|
1572 |
-
&& (preg_match ("
|
1573 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/
|
1574 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
|
1575 |
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
|
1576 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
1577 |
{
|
1578 |
-
eval
|
1579 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
|
1580 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1581 |
/**/
|
@@ -1591,7 +1591,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1591 |
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "(subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment) - or - recurring_payment_profile_cancel w/ initial_payment_status (failed)") . ".";
|
1592 |
/**/
|
1593 |
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
|
1594 |
-
sleep
|
1595 |
/* It is NOT a big deal if they do. However, s2Member goes to sleep here, just to help keep the log files in a logical order. */
|
1596 |
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
|
1597 |
/**/
|
@@ -1624,7 +1624,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1624 |
$demotion_role = c_ws_plugin__s2member_option_forces::force_demotion_role ("subscriber");
|
1625 |
$existing_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
1626 |
/**/
|
1627 |
-
eval
|
1628 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_demote", get_defined_vars ());
|
1629 |
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), $eot_del_type, "modification", $demotion_role);
|
1630 |
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "modification");
|
@@ -1733,7 +1733,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1733 |
$paypal["s2member_log"][] = "EOT/Deletion Notification Emails have been processed.";
|
1734 |
}
|
1735 |
/**/
|
1736 |
-
eval
|
1737 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
|
1738 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1739 |
}
|
@@ -1745,7 +1745,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1745 |
$eot_del_type = $GLOBALS["ws_plugin__s2member_eot_del_type"] = /* Configure EOT/Del type. */
|
1746 |
($is_refund_or_reversal) ? "ipn-refund-reversal-deletion" : "ipn-cancellation-expiration-deletion";
|
1747 |
/**/
|
1748 |
-
eval
|
1749 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_delete", get_defined_vars ());
|
1750 |
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "removal-deletion");
|
1751 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -1759,18 +1759,18 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1759 |
/**/
|
1760 |
else /* Otherwise, we can actually delete them. */
|
1761 |
/* This will automatically trigger `eot_del_notification_urls` as well. */
|
1762 |
-
wp_delete_user
|
1763 |
/**/
|
1764 |
$paypal["s2member_log"][] = "This Member's account has been " . ((is_multisite ()) ? "removed" : "deleted") . ".";
|
1765 |
/**/
|
1766 |
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
|
1767 |
/**/
|
1768 |
-
eval
|
1769 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
|
1770 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1771 |
}
|
1772 |
/**/
|
1773 |
-
eval
|
1774 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
|
1775 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1776 |
}
|
@@ -1784,7 +1784,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1784 |
$paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
|
1785 |
$paypal["s2member_log"][] = "Recording the Auto-EOT Time for this Member's account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
1786 |
/**/
|
1787 |
-
eval
|
1788 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
|
1789 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1790 |
}
|
@@ -1806,7 +1806,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1806 |
/**/
|
1807 |
$paypal["s2member_log"][] = "Auto-EOT Time for this account ( delayed ), set to: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
1808 |
/**/
|
1809 |
-
eval
|
1810 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delayed", get_defined_vars ());
|
1811 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1812 |
}
|
@@ -1932,12 +1932,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1932 |
$paypal["s2member_log"][] = "Refund/Reversal Notification Emails have been processed.";
|
1933 |
}
|
1934 |
/**/
|
1935 |
-
eval
|
1936 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
|
1937 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1938 |
}
|
1939 |
/**/
|
1940 |
-
eval
|
1941 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
|
1942 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1943 |
}
|
@@ -1955,14 +1955,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
1955 |
practice, it never seems to happen. It's best to check the negative mc_gross amount instead.
|
1956 |
*/
|
1957 |
else if (/**/(/**/(preg_match ("/^new_case$/i", $paypal["txn_type"]) && preg_match ("/^chargeback$/i", $paypal["case_type"])) /* Future compatibility. */
|
1958 |
-
|| (preg_match ("/^(refunded|reversed|reversal)$/i", $paypal["payment_status"])) /* The "txn_type" is irrelevant in all
|
1959 |
-
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Item number
|
1960 |
-
&& (preg_match ("
|
1961 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
|
1962 |
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
|
1963 |
&& ($paypal["payer_email"]) && ($paypal["parent_txn_id"])/**/)
|
1964 |
{
|
1965 |
-
eval
|
1966 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_refund_reversal", get_defined_vars ());
|
1967 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1968 |
/**/
|
@@ -2038,11 +2038,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
2038 |
$paypal["s2member_log"][] = "Specific Post/Page ~ Refund/Reversal Notification Emails have been processed.";
|
2039 |
}
|
2040 |
/**/
|
2041 |
-
eval
|
2042 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_refund_reversal", get_defined_vars ());
|
2043 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2044 |
/**/
|
2045 |
-
eval
|
2046 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_refund_reversal", get_defined_vars ());
|
2047 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2048 |
}
|
@@ -2106,16 +2106,16 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
|
2106 |
if (is_writable ($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files ())
|
2107 |
file_put_contents ($logs_dir . "/" . $log2, $logv . "\n" . $log4 . "\n" . var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
2108 |
/**/
|
2109 |
-
eval
|
2110 |
do_action ("ws_plugin__s2member_during_paypal_notify", get_defined_vars ());
|
2111 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2112 |
/**/
|
2113 |
-
header
|
2114 |
-
header
|
2115 |
-
exit
|
2116 |
}
|
2117 |
/**/
|
2118 |
-
eval
|
2119 |
do_action ("ws_plugin__s2member_after_paypal_notify", get_defined_vars ());
|
2120 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2121 |
}
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_paypal_notify_in"))
|
21 |
{
|
58 |
/**/
|
59 |
if (!empty ($_GET["s2member_paypal_notify"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || $_GET["s2member_paypal_proxy"]))
|
60 |
{
|
61 |
+
@ignore_user_abort(true); /* Important. Continue processing even if/when the connection is broken by the sending party. */
|
62 |
/**/
|
63 |
include_once ABSPATH . "wp-admin/includes/admin.php"; /* Get administrative functions. Needed for `wp_delete_user()`. */
|
64 |
/**/
|
85 |
/*
|
86 |
Custom conditionals can be applied by Filters.
|
87 |
*/
|
88 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
89 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_notify_conditionals", false, get_defined_vars ()))
|
90 |
{
|
91 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
99 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
100 |
&& ($paypal["txn_id"])/**/)
|
101 |
{
|
102 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
103 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_virtual_terminal", get_defined_vars ());
|
104 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
105 |
/**/
|
109 |
/**/
|
110 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
111 |
/**/
|
112 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
113 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_virtual_terminal", get_defined_vars ());
|
114 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
115 |
/**/
|
116 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
117 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_virtual_terminal", get_defined_vars ());
|
118 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
119 |
}
|
127 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
128 |
&& ($paypal["txn_id"])/**/)
|
129 |
{
|
130 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
131 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_express_checkout", get_defined_vars ());
|
132 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
133 |
/**/
|
138 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
139 |
$paypal["s2member_log"][] = "s2Member Pro handles Express Checkout events on-site, with an IPN proxy.";
|
140 |
/**/
|
141 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
142 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_express_checkout", get_defined_vars ());
|
143 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
144 |
/**/
|
145 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
146 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_express_checkout", get_defined_vars ());
|
147 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
148 |
}
|
156 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
157 |
&& ($paypal["txn_id"])/**/)
|
158 |
{
|
159 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
160 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_cart", get_defined_vars ());
|
161 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
162 |
/**/
|
167 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
168 |
$paypal["s2member_log"][] = "s2Member Pro handles Cart events on-site, with an IPN proxy.";
|
169 |
/**/
|
170 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
171 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_cart", get_defined_vars ());
|
172 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
173 |
/**/
|
174 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
175 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_cart", get_defined_vars ());
|
176 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
177 |
}
|
185 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
186 |
&& ($paypal["txn_id"])/**/)
|
187 |
{
|
188 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
189 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_send_money", get_defined_vars ());
|
190 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
191 |
/**/
|
195 |
/**/
|
196 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
197 |
/**/
|
198 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
199 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_send_money", get_defined_vars ());
|
200 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
201 |
/**/
|
202 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
203 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_send_money", get_defined_vars ());
|
204 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
205 |
}
|
207 |
Specific Post/Page Access ~ Sales.
|
208 |
*/
|
209 |
else if (/**/(preg_match ("/^web_accept$/i", $paypal["txn_type"]))/**/
|
210 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"], $paypal["item_number"]))/**/
|
211 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
212 |
&& ($paypal["payer_email"] && $paypal["txn_id"])/**/)
|
213 |
{
|
214 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
215 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_access", get_defined_vars ());
|
216 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
217 |
/**/
|
375 |
}
|
376 |
}
|
377 |
/**/
|
378 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
379 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_access", get_defined_vars ());
|
380 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
381 |
}
|
382 |
else
|
383 |
$paypal["s2member_log"][] = "Unable to generate Access Link for Specific Post/Page Access. Does your Leading Post/Page still exist?";
|
384 |
/**/
|
385 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
386 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_access", get_defined_vars ());
|
387 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
388 |
}
|
392 |
( option_name1, option_selection1 ); which allow account modifications.
|
393 |
*/
|
394 |
else if (/**/(preg_match ("/^(web_accept|subscr_signup)$/i", $paypal["txn_type"]))/**/
|
395 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"]))/**/
|
396 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
397 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
398 |
&& ($paypal["payer_email"])/**/)
|
399 |
{
|
400 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
401 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup", get_defined_vars ());
|
402 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
403 |
/**/
|
423 |
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
|
424 |
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
|
425 |
/**/
|
426 |
+
eval('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["s2member_log"]);'); /* Create array of IPN signup vars w/o s2member_log. */
|
427 |
/*
|
428 |
New Subscription with advanced update vars ( option_name1, option_selection1 )? These variables are used in Subscr. Modifications.
|
429 |
*/
|
431 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified.
|
432 |
PayPal® will not allow the `modify=1|2` parameter to be used in those scenarios, because technically there is no billing to update; only the account. */
|
433 |
{
|
434 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
435 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_w_update_vars", get_defined_vars ());
|
436 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
437 |
/**/
|
444 |
{
|
445 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
446 |
/**/
|
447 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
448 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_signup_w_update_vars", get_defined_vars ());
|
449 |
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
|
450 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
455 |
/**/
|
456 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
457 |
{
|
458 |
+
add_existing_user_to_blog(array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
|
459 |
$user = new WP_User ($user_id);
|
460 |
}
|
461 |
/**/
|
607 |
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
|
608 |
}
|
609 |
/**/
|
610 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
611 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars", get_defined_vars ());
|
612 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
613 |
}
|
617 |
else
|
618 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB. Please check the on0 and os0 variables in your Button Code.";
|
619 |
/**/
|
620 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
621 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_w_update_vars", get_defined_vars ());
|
622 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
623 |
}
|
626 |
*/
|
627 |
else /* Else this is a normal Subscription signup, we are not updating anything. */
|
628 |
{
|
629 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
630 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
631 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
632 |
/**/
|
764 |
}
|
765 |
}
|
766 |
/**/
|
767 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
768 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
769 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
770 |
}
|
771 |
else
|
772 |
$paypal["s2member_log"][] = "Unable to generate Registration URL for Membership Access. Possible data corruption within the IPN response.";
|
773 |
/**/
|
774 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
775 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
776 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
777 |
}
|
960 |
set_transient ("s2m_" . md5 ("s2member_transient_ipn_signup_vars_" . $paypal["subscr_id"]), $ipn_signup_vars, 43200);
|
961 |
}
|
962 |
/**/
|
963 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
964 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_signup", get_defined_vars ());
|
965 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
966 |
}
|
972 |
*/
|
973 |
else if (/**/(preg_match ("/^recurring_payment_profile_created$/i", $paypal["txn_type"]))/**/
|
974 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
|
975 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Membership. */
|
976 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
|
977 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
|
978 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
979 |
{
|
980 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
981 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_recurring_payment_profile_created", get_defined_vars ());
|
982 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
983 |
/**/
|
988 |
$paypal["s2member_log"][] = "The txn_type does not require any action on the part of s2Member.";
|
989 |
$paypal["s2member_log"][] = "s2Member Pro handles this event on-site, with an IPN proxy.";
|
990 |
/**/
|
991 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
992 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_recurring_payment_profile_created", get_defined_vars ());
|
993 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
994 |
/**/
|
995 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
996 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_recurring_payment_profile_created", get_defined_vars ());
|
997 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
998 |
}
|
1000 |
Subscription modifications.
|
1001 |
*/
|
1002 |
else if (/**/(preg_match ("/^subscr_modify$/i", $paypal["txn_type"]))/**/
|
1003 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"]))/**/
|
1004 |
&& ($paypal["subscr_id"] && $paypal["payer_email"])/**/)
|
1005 |
{
|
1006 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1007 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_modify", get_defined_vars ());
|
1008 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1009 |
/**/
|
1023 |
$paypal["regular_term"] = $paypal["period3"]; /* This is just set to keep a standard; this way both initial_term & regular_term are available. */
|
1024 |
$paypal["recurring"] = ($paypal["recurring"]) ? $paypal["mc_amount3"] : "0"; /* If non-recurring, this should be zero, otherwise Regular. */
|
1025 |
/**/
|
1026 |
+
eval('$ipn_signup_vars = $paypal; unset($ipn_signup_vars["s2member_log"]);'); /* Create array of IPN signup vars w/o s2member_log. */
|
1027 |
/**/
|
1028 |
if (($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with ($paypal["subscr_id"])) && is_object ($user = new WP_User ($user_id)) && $user->ID)
|
1029 |
{
|
1031 |
{
|
1032 |
$processing = $modifying = $during = true; /* Yes, we ARE processing this. */
|
1033 |
/**/
|
1034 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1035 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_before_subscr_modify", get_defined_vars ());
|
1036 |
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), "ipn-upgrade-downgrade", "modification", "s2member_level" . $paypal["level"]);
|
1037 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1042 |
/**/
|
1043 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
1044 |
{
|
1045 |
+
add_existing_user_to_blog(array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
|
1046 |
$user = new WP_User ($user_id);
|
1047 |
}
|
1048 |
/**/
|
1187 |
$paypal["s2member_log"][] = "Modification Notification Emails have been processed.";
|
1188 |
}
|
1189 |
/**/
|
1190 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1191 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_modify", get_defined_vars ());
|
1192 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1193 |
}
|
1197 |
else
|
1198 |
$paypal["s2member_log"][] = "Unable to modify Subscription. Could not get the existing User ID from the DB.";
|
1199 |
/**/
|
1200 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1201 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_modify", get_defined_vars ());
|
1202 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1203 |
}
|
1207 |
*/
|
1208 |
else if (/**/(preg_match ("/^(subscr_payment|recurring_payment)$/i", $paypal["txn_type"]))/**/
|
1209 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
|
1210 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Membership. */
|
1211 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
|
1212 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"])) /* Status OK? This goes thru a list of known status issues. */
|
1213 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
|
1214 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/
|
1215 |
&& ($paypal["txn_id"] && $paypal["mc_gross"])/**/)
|
1216 |
{
|
1217 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1218 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_payment", get_defined_vars ());
|
1219 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1220 |
/**/
|
1221 |
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "subscr_payment|recurring_payment") . ".";
|
1222 |
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
|
1223 |
+
sleep(5); /* Sleep here for a moment. PayPal® sometimes sends a subscr_payment before the subscr_signup, subscr_modify. */
|
1224 |
/* It is NOT a big deal if they do. However, s2Member goes to sleep here, just to help keep the log files in a logical order. */
|
1225 |
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
|
1226 |
/**/
|
1346 |
$paypal["s2member_log"][] = "Payment Notification Emails have been processed.";
|
1347 |
}
|
1348 |
/**/
|
1349 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1350 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_payment", get_defined_vars ());
|
1351 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1352 |
}
|
1365 |
set_transient ("s2m_" . md5 ("s2member_transient_ipn_subscr_payment_" . $paypal["subscr_id"]), $ipn, 43200);
|
1366 |
}
|
1367 |
/**/
|
1368 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1369 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_payment", get_defined_vars ());
|
1370 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1371 |
}
|
1377 |
*/
|
1378 |
else if (/**/(preg_match ("/^(subscr_failed|recurring_payment_failed|recurring_payment_skipped)$/i", $paypal["txn_type"]))/**/
|
1379 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal)))/**/
|
1380 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Membership. */
|
1381 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)))/**/
|
1382 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)))/**/
|
1383 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
1384 |
{
|
1385 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1386 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_failed", get_defined_vars ());
|
1387 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1388 |
/**/
|
1394 |
$paypal["s2member_log"][] = "s2Member does NOT respond to individual failed payments, only multiple consecutive failed payments.";
|
1395 |
$paypal["s2member_log"][] = "When multiple consecutive payments fail, a special IPN response will be triggered.";
|
1396 |
/**/
|
1397 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1398 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_failed", get_defined_vars ());
|
1399 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1400 |
/**/
|
1401 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1402 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_failed", get_defined_vars ());
|
1403 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1404 |
}
|
1412 |
&& !(preg_match ("/^recurring_payment_profile_cancel$/i", $paypal["txn_type"]) && preg_match ("/^failed$/i", $paypal["initial_payment_status"]))
|
1413 |
/* ^^ Bypass this case ( for now ) "recurring_payment_profile_cancel" with an initial failed payment warrants an EOT instead of a cancellation. */
|
1414 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* item_number? */
|
1415 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Must match Membership Access. */
|
1416 |
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || ($paypal["period1"] = "0 D"))/**/
|
1417 |
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal))) /* Must have a period3 value. */
|
1418 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal))) /* Must have this. */
|
1419 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal))) /* Must have this. */
|
1420 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
1421 |
{
|
1422 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1423 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_cancel", get_defined_vars ());
|
1424 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1425 |
/**/
|
1448 |
/**/
|
1449 |
$paypal["s2member_log"][] = "Auto-EOT Time for this account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
1450 |
/**/
|
1451 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1452 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_cancel", get_defined_vars ());
|
1453 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1454 |
}
|
1539 |
else
|
1540 |
$paypal["s2member_log"][] = "Unable to handle Cancellation. Could not get the existing User ID from the DB.";
|
1541 |
/**/
|
1542 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1543 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_cancel", get_defined_vars ());
|
1544 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1545 |
}
|
1569 |
&& ($paypal["period1"] || ($paypal["period1"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period1 ($paypal)) || !$recurring || ($paypal["period1"] = "0 D"))/**/
|
1570 |
&& ($paypal["period3"] || ($paypal["period3"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_period3 ($paypal)) || !$recurring) /* Was it even recurring? */
|
1571 |
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Do we have a valid item_number? */
|
1572 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"])) /* Only for "Membership", NOT for Specific Posts/Pages. */
|
1573 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_subscr_id ($paypal)) || ($paypal["subscr_id"] = $paypal["parent_txn_id"]))/**/
|
1574 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
|
1575 |
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
|
1576 |
&& ($paypal["payer_email"] || ($paypal["payer_email"] = c_ws_plugin__s2member_utils_users::get_user_email_with ($paypal["subscr_id"])))/**/)
|
1577 |
{
|
1578 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1579 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_subscr_eot", get_defined_vars ());
|
1580 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1581 |
/**/
|
1591 |
$paypal["s2member_log"][] = "s2Member txn_type identified as " . ($identified_as = "(subscr_eot|recurring_payment_expired|recurring_payment_suspended_due_to_max_failed_payment) - or - recurring_payment_profile_cancel w/ initial_payment_status (failed)") . ".";
|
1592 |
/**/
|
1593 |
$paypal["s2member_log"][] = "Sleeping for 5 seconds. Waiting for a possible subscr_signup|subscr_modify|recurring_payment_profile_created.";
|
1594 |
+
sleep(5); /* Sleep here for a moment. PayPal® sometimes sends a subscr_eot before the subscr_signup, subscr_modify. */
|
1595 |
/* It is NOT a big deal if they do. However, s2Member goes to sleep here, just to help keep the log files in a logical order. */
|
1596 |
$paypal["s2member_log"][] = "Awake. It's " . date ("D M j, Y g:i:s a T") . ". s2Member txn_type identified as " . $identified_as . ".";
|
1597 |
/**/
|
1624 |
$demotion_role = c_ws_plugin__s2member_option_forces::force_demotion_role ("subscriber");
|
1625 |
$existing_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
1626 |
/**/
|
1627 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1628 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_demote", get_defined_vars ());
|
1629 |
do_action ("ws_plugin__s2member_during_collective_mods", $user_id, get_defined_vars (), $eot_del_type, "modification", $demotion_role);
|
1630 |
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "modification");
|
1733 |
$paypal["s2member_log"][] = "EOT/Deletion Notification Emails have been processed.";
|
1734 |
}
|
1735 |
/**/
|
1736 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1737 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_demote", get_defined_vars ());
|
1738 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1739 |
}
|
1745 |
$eot_del_type = $GLOBALS["ws_plugin__s2member_eot_del_type"] = /* Configure EOT/Del type. */
|
1746 |
($is_refund_or_reversal) ? "ipn-refund-reversal-deletion" : "ipn-cancellation-expiration-deletion";
|
1747 |
/**/
|
1748 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1749 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_before_delete", get_defined_vars ());
|
1750 |
do_action ("ws_plugin__s2member_during_collective_eots", $user_id, get_defined_vars (), $eot_del_type, "removal-deletion");
|
1751 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1759 |
/**/
|
1760 |
else /* Otherwise, we can actually delete them. */
|
1761 |
/* This will automatically trigger `eot_del_notification_urls` as well. */
|
1762 |
+
wp_delete_user($user_id); /* `c_ws_plugin__s2member_user_deletions::handle_user_deletions()` */
|
1763 |
/**/
|
1764 |
$paypal["s2member_log"][] = "This Member's account has been " . ((is_multisite ()) ? "removed" : "deleted") . ".";
|
1765 |
/**/
|
1766 |
$paypal["s2member_log"][] = "EOT/Deletion Notification URLs have been processed.";
|
1767 |
/**/
|
1768 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1769 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delete", get_defined_vars ());
|
1770 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1771 |
}
|
1772 |
/**/
|
1773 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1774 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot", get_defined_vars ());
|
1775 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1776 |
}
|
1784 |
$paypal["s2member_log"][] = "Auto-EOT is currently disabled. Skipping immediate EOT (demote|delete), for now.";
|
1785 |
$paypal["s2member_log"][] = "Recording the Auto-EOT Time for this Member's account: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
1786 |
/**/
|
1787 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1788 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_disabled", get_defined_vars ());
|
1789 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1790 |
}
|
1806 |
/**/
|
1807 |
$paypal["s2member_log"][] = "Auto-EOT Time for this account ( delayed ), set to: " . date ("D M j, Y g:i a T", $auto_eot_time);
|
1808 |
/**/
|
1809 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1810 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_delayed", get_defined_vars ());
|
1811 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1812 |
}
|
1932 |
$paypal["s2member_log"][] = "Refund/Reversal Notification Emails have been processed.";
|
1933 |
}
|
1934 |
/**/
|
1935 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1936 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_subscr_eot_refund_reversal", get_defined_vars ());
|
1937 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1938 |
}
|
1939 |
/**/
|
1940 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1941 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_subscr_eot", get_defined_vars ());
|
1942 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1943 |
}
|
1955 |
practice, it never seems to happen. It's best to check the negative mc_gross amount instead.
|
1956 |
*/
|
1957 |
else if (/**/(/**/(preg_match ("/^new_case$/i", $paypal["txn_type"]) && preg_match ("/^chargeback$/i", $paypal["case_type"])) /* Future compatibility. */
|
1958 |
+
|| (preg_match ("/^(refunded|reversed|reversal)$/i", $paypal["payment_status"])) /* The "txn_type" is irrelevant in all these special situations. */)/**/
|
1959 |
+
&& ($paypal["item_number"] || ($paypal["item_number"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_number ($paypal))) /* Item number. */
|
1960 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"], $paypal["item_number"])) /* "Specific Post/Page Access". */
|
1961 |
&& ($paypal["item_name"] || ($paypal["item_name"] = c_ws_plugin__s2member_paypal_utilities::paypal_pro_item_name ($paypal)) || ($paypal["item_name"] = $_SERVER["HTTP_HOST"]))/**/
|
1962 |
/* The item_name can default to HTTP_HOST because we've seen payment_status=reversed come through WITHOUT a product_name or item_name given. */
|
1963 |
&& ($paypal["payer_email"]) && ($paypal["parent_txn_id"])/**/)
|
1964 |
{
|
1965 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
1966 |
do_action ("ws_plugin__s2member_during_paypal_notify_before_sp_refund_reversal", get_defined_vars ());
|
1967 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
1968 |
/**/
|
2038 |
$paypal["s2member_log"][] = "Specific Post/Page ~ Refund/Reversal Notification Emails have been processed.";
|
2039 |
}
|
2040 |
/**/
|
2041 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
2042 |
do_action ("ws_plugin__s2member_during_paypal_notify_during_sp_refund_reversal", get_defined_vars ());
|
2043 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2044 |
/**/
|
2045 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
2046 |
do_action ("ws_plugin__s2member_during_paypal_notify_after_sp_refund_reversal", get_defined_vars ());
|
2047 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2048 |
}
|
2106 |
if (is_writable ($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files ())
|
2107 |
file_put_contents ($logs_dir . "/" . $log2, $logv . "\n" . $log4 . "\n" . var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
2108 |
/**/
|
2109 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
2110 |
do_action ("ws_plugin__s2member_during_paypal_notify", get_defined_vars ());
|
2111 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2112 |
/**/
|
2113 |
+
header("HTTP/1.0 200 OK"); /* Send a 200 OK status header. */
|
2114 |
+
header("Content-Type: text/plain; charset=utf-8"); /* With text/plain. */
|
2115 |
+
exit($paypal["s2member_paypal_proxy_return_url"]); /* Possible return value. */
|
2116 |
}
|
2117 |
/**/
|
2118 |
+
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
2119 |
do_action ("ws_plugin__s2member_after_paypal_notify", get_defined_vars ());
|
2120 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
2121 |
}
|
includes/classes/paypal-return-in.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
21 |
{
|
@@ -66,7 +66,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
66 |
/*
|
67 |
Custom conditionals can be applied by Filters.
|
68 |
*/
|
69 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
70 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_return_conditionals", false, get_defined_vars ()))
|
71 |
{
|
72 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
@@ -74,11 +74,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
74 |
Specific Post/Page Access ~ Sales.
|
75 |
*/
|
76 |
if (/**/(preg_match ("/^web_accept$/i", $paypal["txn_type"]))/**/
|
77 |
-
&& (preg_match ("
|
78 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
79 |
&& ($paypal["txn_id"])/**/)
|
80 |
{
|
81 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
82 |
do_action ("ws_plugin__s2member_during_paypal_return_before_sp_access", get_defined_vars ());
|
83 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
84 |
/**/
|
@@ -114,13 +114,13 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
114 |
}
|
115 |
}
|
116 |
/**/
|
117 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
118 |
do_action ("ws_plugin__s2member_during_paypal_return_during_sp_access", get_defined_vars ());
|
119 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
120 |
/**/
|
121 |
$paypal["s2member_log"][] = "Redirecting Customer to the Specific Post/Page.";
|
122 |
/**/
|
123 |
-
wp_redirect($sp_access_url); /* Redirect Customer to the Specific Post/Page. */
|
124 |
}
|
125 |
else /* Otherwise, the ID must have been invalid. Or the Post/Page was deleted. */
|
126 |
{
|
@@ -134,7 +134,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
134 |
echo '</script>' . "\n";
|
135 |
}
|
136 |
/**/
|
137 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
138 |
do_action ("ws_plugin__s2member_during_paypal_return_after_sp_access", get_defined_vars ());
|
139 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
140 |
}
|
@@ -147,11 +147,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
147 |
So we need to look for (web_accept|subscr_signup|subscr_payment), and treat the same.
|
148 |
*/
|
149 |
else if (/**/(preg_match ("/^(web_accept|subscr_signup|subscr_payment)$/i", $paypal["txn_type"]))/**/
|
150 |
-
&& (preg_match ("
|
151 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
152 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/)
|
153 |
{
|
154 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
155 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup", get_defined_vars ());
|
156 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
157 |
/**/
|
@@ -169,7 +169,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
169 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified.
|
170 |
PayPal® will not allow the `modify=1|2` parameter to be used in those scenarios, because technically there is no billing to update; only the account. */
|
171 |
{
|
172 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
173 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_w_update_vars", get_defined_vars ());
|
174 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
175 |
/**/
|
@@ -184,7 +184,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
184 |
/**/
|
185 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
186 |
{
|
187 |
-
add_existing_user_to_blog(array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
|
188 |
$user = new WP_User ($user_id);
|
189 |
}
|
190 |
/**/
|
@@ -231,7 +231,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
231 |
/**/
|
232 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated w/ advanced update routines.";
|
233 |
/**/
|
234 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
235 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_w_update_vars", get_defined_vars ());
|
236 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
237 |
/**/
|
@@ -278,7 +278,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
278 |
echo '</script>' . "\n";
|
279 |
}
|
280 |
/**/
|
281 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
282 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_w_update_vars", get_defined_vars ());
|
283 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
284 |
}
|
@@ -287,7 +287,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
287 |
*/
|
288 |
else /* Else this is a normal Subscription signup, we are not updating an existing Subscription. */
|
289 |
{
|
290 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
291 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
292 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
293 |
/**/
|
@@ -298,11 +298,11 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
298 |
setcookie ("s2member_subscr_gateway", c_ws_plugin__s2member_utils_encryption::encrypt ($paypal["subscr_gateway"]), time () + 31556926, "/");
|
299 |
setcookie ("s2member_subscr_id", c_ws_plugin__s2member_utils_encryption::encrypt ($paypal["subscr_id"]), time () + 31556926, "/");
|
300 |
setcookie ("s2member_custom", c_ws_plugin__s2member_utils_encryption::encrypt ($paypal["custom"]), time () + 31556926, "/");
|
301 |
-
setcookie ("
|
302 |
/**/
|
303 |
$paypal["s2member_log"][] = "Registration Cookies set on (web_accept|subscr_signup|subscr_payment) w/o update vars.";
|
304 |
/**/
|
305 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
306 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
307 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
308 |
/**/
|
@@ -349,12 +349,12 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
349 |
}
|
350 |
}
|
351 |
/**/
|
352 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
353 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
354 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
355 |
}
|
356 |
/**/
|
357 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
358 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup", get_defined_vars ());
|
359 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
360 |
}
|
@@ -362,10 +362,10 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
362 |
Subscription modifications.
|
363 |
*/
|
364 |
else if (/**/(preg_match ("/^subscr_modify$/i", $paypal["txn_type"]))/**/
|
365 |
-
&& (preg_match ("
|
366 |
&& ($paypal["subscr_id"])/**/)
|
367 |
{
|
368 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
369 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_modify", get_defined_vars ());
|
370 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
371 |
/**/
|
@@ -385,7 +385,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
385 |
/**/
|
386 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
387 |
{
|
388 |
-
add_existing_user_to_blog(array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
|
389 |
$user = new WP_User ($user_id); /* Now update the $user object we're using. */
|
390 |
}
|
391 |
/**/
|
@@ -424,7 +424,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
424 |
/**/
|
425 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated on Subscription modification.";
|
426 |
/**/
|
427 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
428 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_modify", get_defined_vars ());
|
429 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
430 |
/**/
|
@@ -471,7 +471,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
471 |
echo '</script>' . "\n";
|
472 |
}
|
473 |
/**/
|
474 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
475 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_modify", get_defined_vars ());
|
476 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
477 |
}
|
@@ -504,13 +504,13 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
504 |
}
|
505 |
else /* In this case ... a Proxy has explicitly requested ty-email processing. */
|
506 |
{
|
507 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
508 |
do_action ("ws_plugin__s2member_during_paypal_return_before_explicit_ty_email", get_defined_vars ());
|
509 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
510 |
/**/
|
511 |
$paypal["s2member_log"][] = "Customer must wait for Email Confirmation ( proxy_use: ty-email ).";
|
512 |
/**/
|
513 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
514 |
do_action ("ws_plugin__s2member_during_paypal_return_during_explicit_ty_email", get_defined_vars ());
|
515 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
516 |
/**/
|
@@ -522,20 +522,20 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
522 |
echo "window.location = '" . esc_js (home_url ("/")) . "';";
|
523 |
echo '</script>' . "\n";
|
524 |
/**/
|
525 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
526 |
do_action ("ws_plugin__s2member_during_paypal_return_after_explicit_ty_email", get_defined_vars ());
|
527 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
528 |
}
|
529 |
}
|
530 |
else if (!isset ($_GET["tx"])) /* No Return-Data from PayPal® at all? */
|
531 |
{
|
532 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
533 |
do_action ("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars ());
|
534 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
535 |
/**/
|
536 |
$paypal["s2member_log"][] = "No Return-Data from PayPal®. Customer must wait for Email Confirmation.";
|
537 |
/**/
|
538 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
539 |
do_action ("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars ());
|
540 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
541 |
/**/
|
@@ -547,7 +547,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
547 |
echo "window.location = '" . esc_js (home_url ("/")) . "';";
|
548 |
echo '</script>' . "\n";
|
549 |
/**/
|
550 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
551 |
do_action ("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars ());
|
552 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
553 |
}
|
@@ -594,14 +594,14 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
|
594 |
if (is_writable ($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files ())
|
595 |
file_put_contents ($logs_dir . "/" . $log2, $logv . "\n" . $log4 . "\n" . var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
596 |
/**/
|
597 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
598 |
do_action ("ws_plugin__s2member_during_paypal_return", get_defined_vars ());
|
599 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
600 |
/**/
|
601 |
exit (); /* Clean exit. */
|
602 |
}
|
603 |
/**/
|
604 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
605 |
do_action ("ws_plugin__s2member_after_paypal_return", get_defined_vars ());
|
606 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
607 |
}
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_paypal_return_in"))
|
21 |
{
|
66 |
/*
|
67 |
Custom conditionals can be applied by Filters.
|
68 |
*/
|
69 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
70 |
if (!apply_filters ("ws_plugin__s2member_during_paypal_return_conditionals", false, get_defined_vars ()))
|
71 |
{
|
72 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
74 |
Specific Post/Page Access ~ Sales.
|
75 |
*/
|
76 |
if (/**/(preg_match ("/^web_accept$/i", $paypal["txn_type"]))/**/
|
77 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"], $paypal["item_number"]))/**/
|
78 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/
|
79 |
&& ($paypal["txn_id"])/**/)
|
80 |
{
|
81 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
82 |
do_action ("ws_plugin__s2member_during_paypal_return_before_sp_access", get_defined_vars ());
|
83 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
84 |
/**/
|
114 |
}
|
115 |
}
|
116 |
/**/
|
117 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
118 |
do_action ("ws_plugin__s2member_during_paypal_return_during_sp_access", get_defined_vars ());
|
119 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
120 |
/**/
|
121 |
$paypal["s2member_log"][] = "Redirecting Customer to the Specific Post/Page.";
|
122 |
/**/
|
123 |
+
wp_redirect ($sp_access_url); /* Redirect Customer to the Specific Post/Page. */
|
124 |
}
|
125 |
else /* Otherwise, the ID must have been invalid. Or the Post/Page was deleted. */
|
126 |
{
|
134 |
echo '</script>' . "\n";
|
135 |
}
|
136 |
/**/
|
137 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
138 |
do_action ("ws_plugin__s2member_during_paypal_return_after_sp_access", get_defined_vars ());
|
139 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
140 |
}
|
147 |
So we need to look for (web_accept|subscr_signup|subscr_payment), and treat the same.
|
148 |
*/
|
149 |
else if (/**/(preg_match ("/^(web_accept|subscr_signup|subscr_payment)$/i", $paypal["txn_type"]))/**/
|
150 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"]))/**/
|
151 |
&& ($paypal["subscr_id"] || ($paypal["subscr_id"] = $paypal["txn_id"]))/**/
|
152 |
&& (!preg_match ($payment_status_issues, $paypal["payment_status"]))/**/)
|
153 |
{
|
154 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
155 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup", get_defined_vars ());
|
156 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
157 |
/**/
|
169 |
/* This advanced method is required whenever a Subscription that is already completed, or was never setup to recur in the first place needs to be modified.
|
170 |
PayPal® will not allow the `modify=1|2` parameter to be used in those scenarios, because technically there is no billing to update; only the account. */
|
171 |
{
|
172 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
173 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_w_update_vars", get_defined_vars ());
|
174 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
175 |
/**/
|
184 |
/**/
|
185 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
186 |
{
|
187 |
+
add_existing_user_to_blog (array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
|
188 |
$user = new WP_User ($user_id);
|
189 |
}
|
190 |
/**/
|
231 |
/**/
|
232 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated w/ advanced update routines.";
|
233 |
/**/
|
234 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
235 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_w_update_vars", get_defined_vars ());
|
236 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
237 |
/**/
|
278 |
echo '</script>' . "\n";
|
279 |
}
|
280 |
/**/
|
281 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
282 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_w_update_vars", get_defined_vars ());
|
283 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
284 |
}
|
287 |
*/
|
288 |
else /* Else this is a normal Subscription signup, we are not updating an existing Subscription. */
|
289 |
{
|
290 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
291 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_signup_wo_update_vars", get_defined_vars ());
|
292 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
293 |
/**/
|
298 |
setcookie ("s2member_subscr_gateway", c_ws_plugin__s2member_utils_encryption::encrypt ($paypal["subscr_gateway"]), time () + 31556926, "/");
|
299 |
setcookie ("s2member_subscr_id", c_ws_plugin__s2member_utils_encryption::encrypt ($paypal["subscr_id"]), time () + 31556926, "/");
|
300 |
setcookie ("s2member_custom", c_ws_plugin__s2member_utils_encryption::encrypt ($paypal["custom"]), time () + 31556926, "/");
|
301 |
+
setcookie ("s2member_item_number", c_ws_plugin__s2member_utils_encryption::encrypt ($paypal["item_number"]), time () + 31556926, "/");
|
302 |
/**/
|
303 |
$paypal["s2member_log"][] = "Registration Cookies set on (web_accept|subscr_signup|subscr_payment) w/o update vars.";
|
304 |
/**/
|
305 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
306 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars", get_defined_vars ());
|
307 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
308 |
/**/
|
349 |
}
|
350 |
}
|
351 |
/**/
|
352 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
353 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup_wo_update_vars", get_defined_vars ());
|
354 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
355 |
}
|
356 |
/**/
|
357 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
358 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_signup", get_defined_vars ());
|
359 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
360 |
}
|
362 |
Subscription modifications.
|
363 |
*/
|
364 |
else if (/**/(preg_match ("/^subscr_modify$/i", $paypal["txn_type"]))/**/
|
365 |
+
&& (preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $paypal["item_number"]))/**/
|
366 |
&& ($paypal["subscr_id"])/**/)
|
367 |
{
|
368 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
369 |
do_action ("ws_plugin__s2member_during_paypal_return_before_subscr_modify", get_defined_vars ());
|
370 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
371 |
/**/
|
385 |
/**/
|
386 |
if (is_multisite () && !is_user_member_of_blog ($user_id))
|
387 |
{
|
388 |
+
add_existing_user_to_blog (array ("user_id" => $user_id, "role" => "s2member_level" . $paypal["level"]));
|
389 |
$user = new WP_User ($user_id); /* Now update the $user object we're using. */
|
390 |
}
|
391 |
/**/
|
424 |
/**/
|
425 |
$paypal["s2member_log"][] = "s2Member Level/Capabilities updated on Subscription modification.";
|
426 |
/**/
|
427 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
428 |
do_action ("ws_plugin__s2member_during_paypal_return_during_subscr_modify", get_defined_vars ());
|
429 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
430 |
/**/
|
471 |
echo '</script>' . "\n";
|
472 |
}
|
473 |
/**/
|
474 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
475 |
do_action ("ws_plugin__s2member_during_paypal_return_after_subscr_modify", get_defined_vars ());
|
476 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
477 |
}
|
504 |
}
|
505 |
else /* In this case ... a Proxy has explicitly requested ty-email processing. */
|
506 |
{
|
507 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
508 |
do_action ("ws_plugin__s2member_during_paypal_return_before_explicit_ty_email", get_defined_vars ());
|
509 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
510 |
/**/
|
511 |
$paypal["s2member_log"][] = "Customer must wait for Email Confirmation ( proxy_use: ty-email ).";
|
512 |
/**/
|
513 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
514 |
do_action ("ws_plugin__s2member_during_paypal_return_during_explicit_ty_email", get_defined_vars ());
|
515 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
516 |
/**/
|
522 |
echo "window.location = '" . esc_js (home_url ("/")) . "';";
|
523 |
echo '</script>' . "\n";
|
524 |
/**/
|
525 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
526 |
do_action ("ws_plugin__s2member_during_paypal_return_after_explicit_ty_email", get_defined_vars ());
|
527 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
528 |
}
|
529 |
}
|
530 |
else if (!isset ($_GET["tx"])) /* No Return-Data from PayPal® at all? */
|
531 |
{
|
532 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
533 |
do_action ("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars ());
|
534 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
535 |
/**/
|
536 |
$paypal["s2member_log"][] = "No Return-Data from PayPal®. Customer must wait for Email Confirmation.";
|
537 |
/**/
|
538 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
539 |
do_action ("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars ());
|
540 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
541 |
/**/
|
547 |
echo "window.location = '" . esc_js (home_url ("/")) . "';";
|
548 |
echo '</script>' . "\n";
|
549 |
/**/
|
550 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
551 |
do_action ("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars ());
|
552 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
553 |
}
|
594 |
if (is_writable ($logs_dir) && c_ws_plugin__s2member_utils_logs::archive_oversize_log_files ())
|
595 |
file_put_contents ($logs_dir . "/" . $log2, $logv . "\n" . $log4 . "\n" . var_export ($paypal, true) . "\n\n", FILE_APPEND);
|
596 |
/**/
|
597 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
598 |
do_action ("ws_plugin__s2member_during_paypal_return", get_defined_vars ());
|
599 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
600 |
/**/
|
601 |
exit (); /* Clean exit. */
|
602 |
}
|
603 |
/**/
|
604 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
605 |
do_action ("ws_plugin__s2member_after_paypal_return", get_defined_vars ());
|
606 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
607 |
}
|
includes/classes/paypal-utilities.inc.php
CHANGED
@@ -44,7 +44,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
44 |
Custom conditionals can be applied by filters.
|
45 |
*/
|
46 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
47 |
-
if (!($postvars = apply_filters ("ws_plugin__s2member_during_paypal_postvars_conditionals", array (), get_defined_vars ())))
|
48 |
{
|
49 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
50 |
/**/
|
@@ -145,7 +145,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
145 |
do_action ("ws_plugin__s2member_before_paypal_api_response", get_defined_vars ());
|
146 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
147 |
/**/
|
148 |
-
$url = "https://" . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "api-3t.sandbox.paypal.com" : "api-3t.paypal.com") . "/nvp";
|
149 |
/**/
|
150 |
$post_vars = apply_filters ("ws_plugin__s2member_paypal_api_post_vars", $post_vars, get_defined_vars ());
|
151 |
$post_vars = (is_array ($post_vars)) ? $post_vars : array (); /* Must be an array. */
|
@@ -290,7 +290,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
290 |
else if (is_string ($string = $array_or_string) && !empty ($string))
|
291 |
$subscr_id = trim ($string);
|
292 |
/**/
|
293 |
-
return apply_filters ("ws_plugin__s2member_paypal_pro_subscr_id", ((!empty ($subscr_id)) ? $subscr_id : false), get_defined_vars ());
|
294 |
}
|
295 |
/**
|
296 |
* Get `item_number` from either an array with `PROFILEREFERENCE|rp_invoice_id|item_number1|item_number`, or use an existing string.
|
@@ -309,7 +309,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
309 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
310 |
/**/
|
311 |
if (is_array ($array = $array_or_string) && (!empty ($array["PROFILEREFERENCE"]) || !empty ($array["rp_invoice_id"])))
|
312 |
-
list ($_reference, $_domain, $_item_number) = array_map ("trim", preg_split ("/~/", ((!empty ($array["PROFILEREFERENCE"])) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"]), 3));
|
313 |
/**/
|
314 |
else if (is_array ($array = $array_or_string) && !empty ($array["item_number1"]))
|
315 |
$_item_number = trim ($array["item_number1"]);
|
@@ -320,13 +320,13 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
320 |
else if (is_string ($string = $array_or_string) && !empty ($string))
|
321 |
$_item_number = trim ($string);
|
322 |
/**/
|
323 |
-
if (!empty ($_item_number) && preg_match ("
|
324 |
$item_number = $_item_number;
|
325 |
/**/
|
326 |
-
else if (!empty ($_item_number) && preg_match ("
|
327 |
$item_number = $_item_number;
|
328 |
/**/
|
329 |
-
return apply_filters ("ws_plugin__s2member_paypal_pro_item_number", ((!empty ($item_number)) ? $item_number : false), get_defined_vars ());
|
330 |
}
|
331 |
/**
|
332 |
* Get `item_name` from either an array with `product_name|item_name1|item_name`, or use an existing string.
|
@@ -355,7 +355,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
355 |
else if (is_string ($string = $array_or_string) && !empty ($string))
|
356 |
$item_name = trim ($string);
|
357 |
/**/
|
358 |
-
return apply_filters ("ws_plugin__s2member_paypal_pro_item_name", ((!empty ($item_name)) ? $item_name : false), get_defined_vars ());
|
359 |
}
|
360 |
/**
|
361 |
* Get `period1` from either an array with `PROFILEREFERENCE|rp_invoice_id|period1`, or use an existing string.
|
@@ -378,7 +378,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
378 |
/**/
|
379 |
if (is_array ($array = $array_or_string) && (!empty ($array["PROFILEREFERENCE"]) || !empty ($array["rp_invoice_id"])))
|
380 |
{
|
381 |
-
list ($_reference, $_domain, $_item_number) = array_map ("trim", preg_split ("/~/", ((!empty ($array["PROFILEREFERENCE"])) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"]), 3));
|
382 |
list ($_start_time, $_period1, $_period3) = array_map ("trim", preg_split ("/\:/", $_reference, 3));
|
383 |
}
|
384 |
else if (is_array ($array = $array_or_string) && !empty ($array["period1"]))
|
@@ -430,7 +430,7 @@ if (!class_exists ("c_ws_plugin__s2member_paypal_utilities"))
|
|
430 |
/**/
|
431 |
if (is_array ($array = $array_or_string) && (!empty ($array["PROFILEREFERENCE"]) || !empty ($array["rp_invoice_id"])))
|
432 |
{
|
433 |
-
list ($_reference, $_domain, $_item_number) = array_map ("trim", preg_split ("/~/", ((!empty ($array["PROFILEREFERENCE"])) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"]), 3));
|
434 |
list ($_start_time, $_period1, $_period3) = array_map ("trim", preg_split ("/\:/", $_reference, 3));
|
435 |
}
|
436 |
else if (is_array ($array = $array_or_string) && !empty ($array["period3"]))
|
44 |
Custom conditionals can be applied by filters.
|
45 |
*/
|
46 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
47 |
+
if (! ($postvars = apply_filters ("ws_plugin__s2member_during_paypal_postvars_conditionals", array (), get_defined_vars ())))
|
48 |
{
|
49 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
50 |
/**/
|
145 |
do_action ("ws_plugin__s2member_before_paypal_api_response", get_defined_vars ());
|
146 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
147 |
/**/
|
148 |
+
$url = "https://" . ( ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "api-3t.sandbox.paypal.com" : "api-3t.paypal.com") . "/nvp";
|
149 |
/**/
|
150 |
$post_vars = apply_filters ("ws_plugin__s2member_paypal_api_post_vars", $post_vars, get_defined_vars ());
|
151 |
$post_vars = (is_array ($post_vars)) ? $post_vars : array (); /* Must be an array. */
|
290 |
else if (is_string ($string = $array_or_string) && !empty ($string))
|
291 |
$subscr_id = trim ($string);
|
292 |
/**/
|
293 |
+
return apply_filters ("ws_plugin__s2member_paypal_pro_subscr_id", ( (!empty ($subscr_id)) ? $subscr_id : false), get_defined_vars ());
|
294 |
}
|
295 |
/**
|
296 |
* Get `item_number` from either an array with `PROFILEREFERENCE|rp_invoice_id|item_number1|item_number`, or use an existing string.
|
309 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
310 |
/**/
|
311 |
if (is_array ($array = $array_or_string) && (!empty ($array["PROFILEREFERENCE"]) || !empty ($array["rp_invoice_id"])))
|
312 |
+
list ($_reference, $_domain, $_item_number) = array_map ("trim", preg_split ("/~/", ( (!empty ($array["PROFILEREFERENCE"])) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"]), 3));
|
313 |
/**/
|
314 |
else if (is_array ($array = $array_or_string) && !empty ($array["item_number1"]))
|
315 |
$_item_number = trim ($array["item_number1"]);
|
320 |
else if (is_string ($string = $array_or_string) && !empty ($string))
|
321 |
$_item_number = trim ($string);
|
322 |
/**/
|
323 |
+
if (!empty ($_item_number) && preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], $_item_number))
|
324 |
$item_number = $_item_number;
|
325 |
/**/
|
326 |
+
else if (!empty ($_item_number) && preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"], $_item_number))
|
327 |
$item_number = $_item_number;
|
328 |
/**/
|
329 |
+
return apply_filters ("ws_plugin__s2member_paypal_pro_item_number", ( (!empty ($item_number)) ? $item_number : false), get_defined_vars ());
|
330 |
}
|
331 |
/**
|
332 |
* Get `item_name` from either an array with `product_name|item_name1|item_name`, or use an existing string.
|
355 |
else if (is_string ($string = $array_or_string) && !empty ($string))
|
356 |
$item_name = trim ($string);
|
357 |
/**/
|
358 |
+
return apply_filters ("ws_plugin__s2member_paypal_pro_item_name", ( (!empty ($item_name)) ? $item_name : false), get_defined_vars ());
|
359 |
}
|
360 |
/**
|
361 |
* Get `period1` from either an array with `PROFILEREFERENCE|rp_invoice_id|period1`, or use an existing string.
|
378 |
/**/
|
379 |
if (is_array ($array = $array_or_string) && (!empty ($array["PROFILEREFERENCE"]) || !empty ($array["rp_invoice_id"])))
|
380 |
{
|
381 |
+
list ($_reference, $_domain, $_item_number) = array_map ("trim", preg_split ("/~/", ( (!empty ($array["PROFILEREFERENCE"])) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"]), 3));
|
382 |
list ($_start_time, $_period1, $_period3) = array_map ("trim", preg_split ("/\:/", $_reference, 3));
|
383 |
}
|
384 |
else if (is_array ($array = $array_or_string) && !empty ($array["period1"]))
|
430 |
/**/
|
431 |
if (is_array ($array = $array_or_string) && (!empty ($array["PROFILEREFERENCE"]) || !empty ($array["rp_invoice_id"])))
|
432 |
{
|
433 |
+
list ($_reference, $_domain, $_item_number) = array_map ("trim", preg_split ("/~/", ( (!empty ($array["PROFILEREFERENCE"])) ? $array["PROFILEREFERENCE"] : $array["rp_invoice_id"]), 3));
|
434 |
list ($_start_time, $_period1, $_period3) = array_map ("trim", preg_split ("/\:/", $_reference, 3));
|
435 |
}
|
436 |
else if (is_array ($array = $array_or_string) && !empty ($array["period3"]))
|
includes/classes/profile-in.inc.php
CHANGED
@@ -56,7 +56,10 @@ if (!class_exists ("c_ws_plugin__s2member_profile_in"))
|
|
56 |
/**/
|
57 |
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
|
58 |
/**/
|
59 |
-
echo '<script type="text/javascript" src="
|
|
|
|
|
|
|
60 |
echo '<script type="text/javascript" src="' . esc_attr (site_url ("/?ws_plugin__s2member_js_w_globals=" . urlencode (WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5) . "&qcABC=1&ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
|
61 |
echo '<link href="' . esc_attr (site_url ("/?ws_plugin__s2member_css=1&qcABC=1&ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '" type="text/css" rel="stylesheet" media="all" />' . "\n";
|
62 |
/**/
|
56 |
/**/
|
57 |
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
|
58 |
/**/
|
59 |
+
echo '<script type="text/javascript" src="' . esc_attr (site_url ("/wp-includes/js/jquery/jquery.js?ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
|
60 |
+
echo '<script type="text/javascript" src="' . esc_attr (site_url ("/wp-includes/js/l10n.js?ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
|
61 |
+
echo '<script type="text/javascript">var pwsL10n = {empty: "Strength indicator", short: "Very weak", bad: "Weak", good: "Medium", strong: "Strong", mismatch: "Mismatch"}; try{convertEntities(pwsL10n);}catch(e){};</script>' . "\n";
|
62 |
+
echo '<script type="text/javascript" src="' . esc_attr (site_url ("/wp-admin/js/password-strength-meter.js?ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
|
63 |
echo '<script type="text/javascript" src="' . esc_attr (site_url ("/?ws_plugin__s2member_js_w_globals=" . urlencode (WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5) . "&qcABC=1&ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
|
64 |
echo '<link href="' . esc_attr (site_url ("/?ws_plugin__s2member_css=1&qcABC=1&ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '" type="text/css" rel="stylesheet" media="all" />' . "\n";
|
65 |
/**/
|
includes/classes/register-access.inc.php
CHANGED
@@ -83,6 +83,25 @@ if (!class_exists ("c_ws_plugin__s2member_register_access"))
|
|
83 |
/**/
|
84 |
exit (); /* Clean exit. */
|
85 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
}
|
88 |
?>
|
83 |
/**/
|
84 |
exit (); /* Clean exit. */
|
85 |
}
|
86 |
+
/**
|
87 |
+
* Checks registration cookies.
|
88 |
+
*
|
89 |
+
* @package s2Member\Registrations
|
90 |
+
* @since 110707
|
91 |
+
*
|
92 |
+
* @return array|bool An array of cookies if they're OK, else false.
|
93 |
+
*/
|
94 |
+
public static function reg_cookies_ok ()
|
95 |
+
{
|
96 |
+
global $wpdb; /* Global database object reference. */
|
97 |
+
/**/
|
98 |
+
do_action ("ws_plugin__s2member_before_reg_cookies_ok", get_defined_vars ());
|
99 |
+
/**/
|
100 |
+
if (isset ($_COOKIE["s2member_subscr_gateway"], $_COOKIE["s2member_subscr_id"], $_COOKIE["s2member_custom"], $_COOKIE["s2member_item_number"]) && ($subscr_gateway = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_subscr_gateway"])) && ($subscr_id = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_subscr_id"])) && preg_match ("/^" . preg_quote (preg_replace ("/\:([0-9]+)$/", "", $_SERVER["HTTP_HOST"]), "/") . "/i", ($custom = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_custom"]))) && preg_match ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"], ($item_number = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_item_number"]))) && !$wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' AND `meta_value` = '" . $wpdb->escape ($subscr_id) . "' LIMIT 1"))
|
101 |
+
$reg_cookies = array ("subscr_gateway" => $subscr_gateway, "subscr_id" => $subscr_id, "custom" => $custom, "item_number" => $item_number);
|
102 |
+
/**/
|
103 |
+
return apply_filters ("ws_plugin__s2member_reg_cookies_ok", ((isset ($reg_cookies) && is_array ($reg_cookies)) ? $reg_cookies : false), get_defined_vars ());
|
104 |
+
}
|
105 |
}
|
106 |
}
|
107 |
?>
|
includes/classes/register-in.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_register_in"))
|
21 |
{
|
@@ -45,36 +45,50 @@ if (!class_exists ("c_ws_plugin__s2member_register_in"))
|
|
45 |
{
|
46 |
if (is_array ($register = preg_split ("/\:\.\:\|\:\.\:/", c_ws_plugin__s2member_utils_encryption::decrypt (trim (stripslashes ($_GET["s2member_register"]))))))
|
47 |
{
|
48 |
-
if (count ($register) === 6 && $register[0] === "subscr_gateway_subscr_id_custom_item_number_time" && $register[1] && $register[2] && $register[3] && $register[4] && $register[5])
|
49 |
{
|
50 |
if ($register[5] <= strtotime ("now") && $register[5] >= strtotime ("-" . apply_filters ("ws_plugin__s2member_register_link_exp_time", "2 days", get_defined_vars ())))
|
51 |
{
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
/**/
|
57 |
-
|
58 |
-
/**/
|
59 |
-
if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && is_main_site ())
|
60 |
-
{
|
61 |
-
echo '<script type="text/javascript">' . "\n";
|
62 |
-
echo "window.location = '" . esc_js (c_ws_plugin__s2member_utils_urls::wp_signup_url ()) . "';";
|
63 |
-
echo '</script>' . "\n";
|
64 |
-
}
|
65 |
-
else /* Otherwise, this is NOT a Multisite install. Or it is, but the Super Admin is NOT selling Blogs. */
|
66 |
{
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
|
|
|
|
71 |
}
|
|
|
|
|
72 |
}
|
|
|
|
|
73 |
}
|
|
|
|
|
74 |
/**/
|
75 |
-
|
76 |
-
/**/
|
77 |
-
exit (); /* $_GET["s2member_register"] has expired. Or simply invalid. */
|
78 |
}
|
79 |
/**/
|
80 |
do_action ("ws_plugin__s2member_after_register", get_defined_vars ());
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_register_in"))
|
21 |
{
|
45 |
{
|
46 |
if (is_array ($register = preg_split ("/\:\.\:\|\:\.\:/", c_ws_plugin__s2member_utils_encryption::decrypt (trim (stripslashes ($_GET["s2member_register"]))))))
|
47 |
{
|
48 |
+
if (count ($register) === 6 && !empty ($register[0]) && $register[0] === "subscr_gateway_subscr_id_custom_item_number_time" && !empty ($register[1]) && !empty ($register[2]) && !empty ($register[3]) && !empty ($register[4]) && !empty ($register[5]))
|
49 |
{
|
50 |
if ($register[5] <= strtotime ("now") && $register[5] >= strtotime ("-" . apply_filters ("ws_plugin__s2member_register_link_exp_time", "2 days", get_defined_vars ())))
|
51 |
{
|
52 |
+
$_COOKIE["s2member_subscr_gateway"] = c_ws_plugin__s2member_utils_encryption::encrypt ($register[1]);
|
53 |
+
$_COOKIE["s2member_subscr_id"] = c_ws_plugin__s2member_utils_encryption::encrypt ($register[2]);
|
54 |
+
$_COOKIE["s2member_custom"] = c_ws_plugin__s2member_utils_encryption::encrypt ($register[3]);
|
55 |
+
$_COOKIE["s2member_item_number"] = c_ws_plugin__s2member_utils_encryption::encrypt ($register[4]);
|
56 |
/**/
|
57 |
+
if (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
{
|
59 |
+
setcookie ("s2member_subscr_gateway", c_ws_plugin__s2member_utils_encryption::encrypt ($register[1]), time () + 31556926, "/");
|
60 |
+
setcookie ("s2member_subscr_id", c_ws_plugin__s2member_utils_encryption::encrypt ($register[2]), time () + 31556926, "/");
|
61 |
+
setcookie ("s2member_custom", c_ws_plugin__s2member_utils_encryption::encrypt ($register[3]), time () + 31556926, "/");
|
62 |
+
setcookie ("s2member_item_number", c_ws_plugin__s2member_utils_encryption::encrypt ($register[4]), time () + 31556926, "/");
|
63 |
+
/**/
|
64 |
+
do_action ("ws_plugin__s2member_during_register", get_defined_vars ());
|
65 |
+
/**/
|
66 |
+
if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && is_main_site ())
|
67 |
+
{
|
68 |
+
echo '<script type="text/javascript">' . "\n";
|
69 |
+
echo "window.location = '" . esc_js (c_ws_plugin__s2member_utils_urls::wp_signup_url ()) . "';";
|
70 |
+
echo '</script>' . "\n";
|
71 |
+
}
|
72 |
+
else /* Otherwise, this is NOT a Multisite install. Or it is, but the Super Admin is NOT selling Blogs. */
|
73 |
+
{
|
74 |
+
echo '<script type="text/javascript">' . "\n";
|
75 |
+
echo "window.location = '" . esc_js (c_ws_plugin__s2member_utils_urls::wp_register_url ()) . "';";
|
76 |
+
echo '</script>' . "\n";
|
77 |
+
}
|
78 |
}
|
79 |
+
else
|
80 |
+
echo '<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.';
|
81 |
}
|
82 |
+
else
|
83 |
+
echo '<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.';
|
84 |
}
|
85 |
+
else
|
86 |
+
echo '<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.';
|
87 |
}
|
88 |
+
else
|
89 |
+
echo '<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.';
|
90 |
/**/
|
91 |
+
exit (); /* Clean exit. This is always the case with `$_GET["s2member_register"]`. */
|
|
|
|
|
92 |
}
|
93 |
/**/
|
94 |
do_action ("ws_plugin__s2member_after_register", get_defined_vars ());
|
includes/classes/registrations.inc.php
CHANGED
@@ -444,18 +444,16 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
|
|
444 |
$_pmr = array_merge ($_p, $meta, $GLOBALS["ws_plugin__s2member_registration_vars"]); /* Merge these all together now. */
|
445 |
unset ($_p, $meta, $GLOBALS["ws_plugin__s2member_registration_vars"]); /* These vars can all be unset now; we now have them all inside $_pmr. */
|
446 |
/**/
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
/*
|
451 |
-
{ /*
|
452 |
-
This routine could be processed through `wp-login.php?action=register`, `wp-activate.php`, or `/activate` via BuddyPress`.
|
453 |
This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
|
454 |
If processed through `wp-activate.php`, it could've originated inside the admin, via `user-new.php`. */
|
455 |
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
456 |
/**/
|
457 |
$current_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
458 |
-
list ($level, $ccaps, $eotper) = preg_split ("/\:/", $
|
459 |
$role = "s2member_level" . $level; /* Membership Level. */
|
460 |
/**/
|
461 |
$email = $user->user_email;
|
@@ -522,8 +520,17 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
|
|
522 |
if (!$user->last_name && $lname)
|
523 |
update_user_meta ($user_id, "last_name", $lname);
|
524 |
/**/
|
525 |
-
if (!$user->display_name
|
526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
/**/
|
528 |
if (is_multisite ()) /* Should we handle Main Site permissions and Originating Blog ID#? */
|
529 |
{
|
@@ -595,20 +602,21 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
|
|
595 |
}
|
596 |
/**/
|
597 |
else if (!is_admin ()) /* Otherwise, if we are NOT inside the Dashboard during the creation of this account. */
|
598 |
-
{ /*
|
599 |
-
This routine could be processed through `wp-login.php?action=register`, `wp-activate.php`, or `/activate` via BuddyPress`.
|
600 |
This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
|
601 |
If processed through `wp-activate.php`, it could've originated inside the admin, via `user-new.php`. */
|
602 |
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
603 |
/**/
|
604 |
$current_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
605 |
-
$role =
|
|
|
|
|
606 |
$role = (!$role && $current_role) ? $current_role : $role; /* Use existing Role? */
|
607 |
$role = (!$role) ? get_option ("default_role") : $role; /* Otherwise default. */
|
608 |
/**/
|
609 |
$level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"];
|
610 |
$level = (!$level && preg_match ("/^(administrator|editor|author|contributor)$/i", $role)) ? "4" : $level;
|
611 |
-
$level = (!$level && preg_match ("/^s2member_level[1-
|
612 |
$level = (!$level && preg_match ("/^subscriber$/i", $role)) ? "0" : $level;
|
613 |
$level = (!$level) ? "0" : $level;
|
614 |
/**/
|
@@ -679,8 +687,17 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
|
|
679 |
if (!$user->last_name && $lname)
|
680 |
update_user_meta ($user_id, "last_name", $lname);
|
681 |
/**/
|
682 |
-
if (!$user->display_name
|
683 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
/**/
|
685 |
if (is_multisite ()) /* Should we handle Main Site permissions and Originating Blog ID#? */
|
686 |
{
|
@@ -731,18 +748,19 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
|
|
731 |
}
|
732 |
/**/
|
733 |
else if (is_blog_admin () && $pagenow === "user-new.php")
|
734 |
-
{ /*
|
735 |
-
This routine can ONLY be processed through `user-new.php` in the Administrative area. */
|
736 |
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
737 |
/**/
|
738 |
$current_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
739 |
-
$role =
|
|
|
|
|
740 |
$role = (!$role && $current_role) ? $current_role : $role; /* Use existing Role? */
|
741 |
$role = (!$role) ? get_option ("default_role") : $role; /* Otherwise default. */
|
742 |
/**/
|
743 |
$level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"];
|
744 |
$level = (!$level && preg_match ("/^(administrator|editor|author|contributor)$/i", $role)) ? "4" : $level;
|
745 |
-
$level = (!$level && preg_match ("/^s2member_level[1-
|
746 |
$level = (!$level && preg_match ("/^subscriber$/i", $role)) ? "0" : $level;
|
747 |
$level = (!$level) ? "0" : $level;
|
748 |
/**/
|
@@ -803,8 +821,17 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
|
|
803 |
if (!$user->last_name && $lname)
|
804 |
update_user_meta ($user_id, "last_name", $lname);
|
805 |
/**/
|
806 |
-
if (!$user->display_name
|
807 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
808 |
/**/
|
809 |
if (is_multisite ()) /* Should we handle Main Site permissions and Originating Blog ID#? */
|
810 |
{
|
@@ -976,7 +1003,7 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
|
|
976 |
@setcookie ("s2member_subscr_gateway", "", time () + 31556926, "/");
|
977 |
@setcookie ("s2member_subscr_id", "", time () + 31556926, "/");
|
978 |
@setcookie ("s2member_custom", "", time () + 31556926, "/");
|
979 |
-
@setcookie ("
|
980 |
}
|
981 |
/**/
|
982 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
444 |
$_pmr = array_merge ($_p, $meta, $GLOBALS["ws_plugin__s2member_registration_vars"]); /* Merge these all together now. */
|
445 |
unset ($_p, $meta, $GLOBALS["ws_plugin__s2member_registration_vars"]); /* These vars can all be unset now; we now have them all inside $_pmr. */
|
446 |
/**/
|
447 |
+
$custom_reg_display_name = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"]; /* Can be configured by the site owner. */
|
448 |
+
/**/
|
449 |
+
if (!is_admin () && ($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies))
|
450 |
+
{ /* This routine could be processed through `wp-login.php?action=register`, `wp-activate.php`, or `/activate` via BuddyPress`.
|
|
|
|
|
451 |
This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
|
452 |
If processed through `wp-activate.php`, it could've originated inside the admin, via `user-new.php`. */
|
453 |
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
454 |
/**/
|
455 |
$current_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
456 |
+
list ($level, $ccaps, $eotper) = preg_split ("/\:/", $item_number, 3);
|
457 |
$role = "s2member_level" . $level; /* Membership Level. */
|
458 |
/**/
|
459 |
$email = $user->user_email;
|
520 |
if (!$user->last_name && $lname)
|
521 |
update_user_meta ($user_id, "last_name", $lname);
|
522 |
/**/
|
523 |
+
if (!$user->display_name || $user->display_name === $user->user_login)
|
524 |
+
{
|
525 |
+
if ($custom_reg_display_name === "full" && $name)
|
526 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $name));
|
527 |
+
else if ($custom_reg_display_name === "first" && $fname)
|
528 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $fname));
|
529 |
+
else if ($custom_reg_display_name === "last" && $lname)
|
530 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $lname));
|
531 |
+
else if ($custom_reg_display_name === "login" && $login)
|
532 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $login));
|
533 |
+
}
|
534 |
/**/
|
535 |
if (is_multisite ()) /* Should we handle Main Site permissions and Originating Blog ID#? */
|
536 |
{
|
602 |
}
|
603 |
/**/
|
604 |
else if (!is_admin ()) /* Otherwise, if we are NOT inside the Dashboard during the creation of this account. */
|
605 |
+
{ /* This routine could be processed through `wp-login.php?action=register`, `wp-activate.php`, or `/activate` via BuddyPress`.
|
|
|
606 |
This may also be processed through a standard BuddyPress installation, or another plugin calling `user_register`.
|
607 |
If processed through `wp-activate.php`, it could've originated inside the admin, via `user-new.php`. */
|
608 |
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
609 |
/**/
|
610 |
$current_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
611 |
+
$role = ""; /* Initialize $role to an empty string here, before processing. */
|
612 |
+
$role = (!$role && ($level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) > 0) ? "s2member_level" . $level : $role;
|
613 |
+
$role = (!$role && ($level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) === "0") ? "subscriber" : $role;
|
614 |
$role = (!$role && $current_role) ? $current_role : $role; /* Use existing Role? */
|
615 |
$role = (!$role) ? get_option ("default_role") : $role; /* Otherwise default. */
|
616 |
/**/
|
617 |
$level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"];
|
618 |
$level = (!$level && preg_match ("/^(administrator|editor|author|contributor)$/i", $role)) ? "4" : $level;
|
619 |
+
$level = (!$level && preg_match ("/^s2member_level[1-9][0-9]*$/i", $role)) ? preg_replace ("/^s2member_level/", "", $role) : $level;
|
620 |
$level = (!$level && preg_match ("/^subscriber$/i", $role)) ? "0" : $level;
|
621 |
$level = (!$level) ? "0" : $level;
|
622 |
/**/
|
687 |
if (!$user->last_name && $lname)
|
688 |
update_user_meta ($user_id, "last_name", $lname);
|
689 |
/**/
|
690 |
+
if (!$user->display_name || $user->display_name === $user->user_login)
|
691 |
+
{
|
692 |
+
if ($custom_reg_display_name === "full" && $name)
|
693 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $name));
|
694 |
+
else if ($custom_reg_display_name === "first" && $fname)
|
695 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $fname));
|
696 |
+
else if ($custom_reg_display_name === "last" && $lname)
|
697 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $lname));
|
698 |
+
else if ($custom_reg_display_name === "login" && $login)
|
699 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $login));
|
700 |
+
}
|
701 |
/**/
|
702 |
if (is_multisite ()) /* Should we handle Main Site permissions and Originating Blog ID#? */
|
703 |
{
|
748 |
}
|
749 |
/**/
|
750 |
else if (is_blog_admin () && $pagenow === "user-new.php")
|
751 |
+
{ /* This routine can ONLY be processed through `user-new.php` in the Administrative area. */
|
|
|
752 |
$processed = "yes"; /* Mark this as yes, to indicate that a routine was processed. */
|
753 |
/**/
|
754 |
$current_role = c_ws_plugin__s2member_user_access::user_access_role ($user);
|
755 |
+
$role = ""; /* Initialize $role to an empty string here, before processing. */
|
756 |
+
$role = (!$role && ($level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) > 0) ? "s2member_level" . $level : $role;
|
757 |
+
$role = (!$role && ($level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"]) === "0") ? "subscriber" : $role;
|
758 |
$role = (!$role && $current_role) ? $current_role : $role; /* Use existing Role? */
|
759 |
$role = (!$role) ? get_option ("default_role") : $role; /* Otherwise default. */
|
760 |
/**/
|
761 |
$level = $_pmr["ws_plugin__s2member_custom_reg_field_s2member_level"];
|
762 |
$level = (!$level && preg_match ("/^(administrator|editor|author|contributor)$/i", $role)) ? "4" : $level;
|
763 |
+
$level = (!$level && preg_match ("/^s2member_level[1-9][0-9]*$/i", $role)) ? preg_replace ("/^s2member_level/", "", $role) : $level;
|
764 |
$level = (!$level && preg_match ("/^subscriber$/i", $role)) ? "0" : $level;
|
765 |
$level = (!$level) ? "0" : $level;
|
766 |
/**/
|
821 |
if (!$user->last_name && $lname)
|
822 |
update_user_meta ($user_id, "last_name", $lname);
|
823 |
/**/
|
824 |
+
if (!$user->display_name || $user->display_name === $user->user_login)
|
825 |
+
{
|
826 |
+
if ($custom_reg_display_name === "full" && $name)
|
827 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $name));
|
828 |
+
else if ($custom_reg_display_name === "first" && $fname)
|
829 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $fname));
|
830 |
+
else if ($custom_reg_display_name === "last" && $lname)
|
831 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $lname));
|
832 |
+
else if ($custom_reg_display_name === "login" && $login)
|
833 |
+
wp_update_user (array ("ID" => $user_id, "display_name" => $login));
|
834 |
+
}
|
835 |
/**/
|
836 |
if (is_multisite ()) /* Should we handle Main Site permissions and Originating Blog ID#? */
|
837 |
{
|
1003 |
@setcookie ("s2member_subscr_gateway", "", time () + 31556926, "/");
|
1004 |
@setcookie ("s2member_subscr_id", "", time () + 31556926, "/");
|
1005 |
@setcookie ("s2member_custom", "", time () + 31556926, "/");
|
1006 |
+
@setcookie ("s2member_item_number", "", time () + 31556926, "/");
|
1007 |
}
|
1008 |
/**/
|
1009 |
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
includes/classes/roles-caps.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 110524RC
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_roles_caps"))
|
21 |
{
|
@@ -111,8 +111,8 @@ if (!class_exists ("c_ws_plugin__s2member_roles_caps"))
|
|
111 |
if (($role = &get_role ("subscriber")))
|
112 |
$role->remove_cap ("access_s2member_level0");
|
113 |
/**/
|
114 |
-
for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["
|
115 |
-
remove_role
|
116 |
/**/
|
117 |
foreach (array ("administrator", "editor", "author", "contributor", "bbp_moderator") as $role)
|
118 |
{
|
@@ -142,10 +142,10 @@ if (!class_exists ("c_ws_plugin__s2member_roles_caps"))
|
|
142 |
{
|
143 |
c_ws_plugin__s2member_roles_caps::config_roles ();
|
144 |
/**/
|
145 |
-
exit
|
146 |
}
|
147 |
else
|
148 |
-
exit
|
149 |
}
|
150 |
}
|
151 |
}
|
15 |
* @since 110524RC
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_roles_caps"))
|
21 |
{
|
111 |
if (($role = &get_role ("subscriber")))
|
112 |
$role->remove_cap ("access_s2member_level0");
|
113 |
/**/
|
114 |
+
for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["max_levels"]; $n++)
|
115 |
+
remove_role("s2member_level" . $n);
|
116 |
/**/
|
117 |
foreach (array ("administrator", "editor", "author", "contributor", "bbp_moderator") as $role)
|
118 |
{
|
142 |
{
|
143 |
c_ws_plugin__s2member_roles_caps::config_roles ();
|
144 |
/**/
|
145 |
+
exit("1"); /* Success. */
|
146 |
}
|
147 |
else
|
148 |
+
exit("0"); /* Locked. */
|
149 |
}
|
150 |
}
|
151 |
}
|
includes/classes/tracking-codes.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_tracking_codes"))
|
21 |
{
|
@@ -51,15 +51,15 @@ if (!class_exists ("c_ws_plugin__s2member_tracking_codes"))
|
|
51 |
{
|
52 |
do_action ("ws_plugin__s2member_before_display_signup_tracking_codes", get_defined_vars ());
|
53 |
/**/
|
54 |
-
if ((
|
55 |
{
|
56 |
if (($code = get_transient ($transient = "s2m_" . md5 ("s2member_transient_signup_tracking_codes_" . $subscr_id))))
|
57 |
{
|
58 |
-
delete_transient($transient); /* Only display this ONE time. Delete transient immediately. */
|
59 |
/**/
|
60 |
echo '<img src="' . esc_attr (site_url ("/?s2member_delete_signup_tracking_cookie=1")) . '" alt="." style="width:1px; height:1px; border:0;" />' . "\n";
|
61 |
/**/
|
62 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
63 |
do_action ("ws_plugin__s2member_during_display_signup_tracking_codes", get_defined_vars ());
|
64 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
65 |
/**/
|
@@ -101,11 +101,11 @@ if (!class_exists ("c_ws_plugin__s2member_tracking_codes"))
|
|
101 |
{
|
102 |
if (($code = get_transient ($transient = "s2m_" . md5 ("s2member_transient_sp_tracking_codes_" . $txn_id))))
|
103 |
{
|
104 |
-
delete_transient($transient); /* Only display this ONE time. Delete transient immediately. */
|
105 |
/**/
|
106 |
echo '<img src="' . esc_attr (site_url ("/?s2member_delete_sp_tracking_cookie=1")) . '" alt="." style="width:1px; height:1px; border:0;" />' . "\n";
|
107 |
/**/
|
108 |
-
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
109 |
do_action ("ws_plugin__s2member_during_display_sp_tracking_codes", get_defined_vars ());
|
110 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
111 |
/**/
|
@@ -115,7 +115,7 @@ if (!class_exists ("c_ws_plugin__s2member_tracking_codes"))
|
|
115 |
}
|
116 |
else /* Otherwise, it's safe to allow PHP code. */
|
117 |
{
|
118 |
-
eval("?>" . $code);
|
119 |
}
|
120 |
}
|
121 |
}
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_tracking_codes"))
|
21 |
{
|
51 |
{
|
52 |
do_action ("ws_plugin__s2member_before_display_signup_tracking_codes", get_defined_vars ());
|
53 |
/**/
|
54 |
+
if ((($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok ()) && extract ($reg_cookies)) || (!empty ($_COOKIE["s2member_signup_tracking"]) && ($subscr_id = c_ws_plugin__s2member_utils_encryption::decrypt ($_COOKIE["s2member_signup_tracking"]))))
|
55 |
{
|
56 |
if (($code = get_transient ($transient = "s2m_" . md5 ("s2member_transient_signup_tracking_codes_" . $subscr_id))))
|
57 |
{
|
58 |
+
delete_transient ($transient); /* Only display this ONE time. Delete transient immediately. */
|
59 |
/**/
|
60 |
echo '<img src="' . esc_attr (site_url ("/?s2member_delete_signup_tracking_cookie=1")) . '" alt="." style="width:1px; height:1px; border:0;" />' . "\n";
|
61 |
/**/
|
62 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
63 |
do_action ("ws_plugin__s2member_during_display_signup_tracking_codes", get_defined_vars ());
|
64 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
65 |
/**/
|
101 |
{
|
102 |
if (($code = get_transient ($transient = "s2m_" . md5 ("s2member_transient_sp_tracking_codes_" . $txn_id))))
|
103 |
{
|
104 |
+
delete_transient ($transient); /* Only display this ONE time. Delete transient immediately. */
|
105 |
/**/
|
106 |
echo '<img src="' . esc_attr (site_url ("/?s2member_delete_sp_tracking_cookie=1")) . '" alt="." style="width:1px; height:1px; border:0;" />' . "\n";
|
107 |
/**/
|
108 |
+
eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
|
109 |
do_action ("ws_plugin__s2member_during_display_sp_tracking_codes", get_defined_vars ());
|
110 |
unset ($__refs, $__v); /* Unset defined __refs, __v. */
|
111 |
/**/
|
115 |
}
|
116 |
else /* Otherwise, it's safe to allow PHP code. */
|
117 |
{
|
118 |
+
eval ("?>" . $code);
|
119 |
}
|
120 |
}
|
121 |
}
|
includes/classes/utils-users.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_utils_users"))
|
21 |
{
|
@@ -44,8 +44,8 @@ if (!class_exists ("c_ws_plugin__s2member_utils_users"))
|
|
44 |
/**/
|
45 |
$users = (int)mysql_result ($q2, 0);
|
46 |
/**/
|
47 |
-
mysql_free_result
|
48 |
-
mysql_free_result
|
49 |
/**/
|
50 |
return $users;
|
51 |
}
|
@@ -317,7 +317,7 @@ if (!class_exists ("c_ws_plugin__s2member_utils_users"))
|
|
317 |
else if (strcasecmp ($field_id, "ip") === 0 && is_object ($current_user) && $current_user->ID === $user_id)
|
318 |
return $_SERVER["REMOTE_ADDR"]; /* The current User's IP address, right now. */
|
319 |
/**/
|
320 |
-
else if (strcasecmp ($field_id, "s2member_registration_ip") === 0 || strcasecmp ($field_id, "ip") === 0)
|
321 |
return get_user_option ("s2member_registration_ip", $user_id);
|
322 |
/**/
|
323 |
else if (strcasecmp ($field_id, "s2member_subscr_or_wp_id") === 0)
|
15 |
* @since 3.5
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_utils_users"))
|
21 |
{
|
44 |
/**/
|
45 |
$users = (int)mysql_result ($q2, 0);
|
46 |
/**/
|
47 |
+
mysql_free_result($q2);
|
48 |
+
mysql_free_result($q1);
|
49 |
/**/
|
50 |
return $users;
|
51 |
}
|
317 |
else if (strcasecmp ($field_id, "ip") === 0 && is_object ($current_user) && $current_user->ID === $user_id)
|
318 |
return $_SERVER["REMOTE_ADDR"]; /* The current User's IP address, right now. */
|
319 |
/**/
|
320 |
+
else if (strcasecmp ($field_id, "s2member_registration_ip") === 0 || strcasecmp ($field_id, "reg_ip") === 0 || strcasecmp ($field_id, "ip") === 0)
|
321 |
return get_user_option ("s2member_registration_ip", $user_id);
|
322 |
/**/
|
323 |
else if (strcasecmp ($field_id, "s2member_subscr_or_wp_id") === 0)
|
includes/functions/class-autoloader.inc.php
CHANGED
@@ -20,9 +20,7 @@
|
|
20 |
*/
|
21 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
22 |
exit ("Do not access this file directly.");
|
23 |
-
|
24 |
-
The __autoload function for s2Member classes.
|
25 |
-
*/
|
26 |
if (!function_exists ("ws_plugin__s2member_classes"))
|
27 |
{
|
28 |
/**
|
20 |
*/
|
21 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
22 |
exit ("Do not access this file directly.");
|
23 |
+
/**/
|
|
|
|
|
24 |
if (!function_exists ("ws_plugin__s2member_classes"))
|
25 |
{
|
26 |
/**
|
includes/hooks.inc.php
CHANGED
@@ -28,7 +28,6 @@ add_action ("init", "c_ws_plugin__s2member_user_securities::initialize", 1);
|
|
28 |
/**/
|
29 |
add_action ("init", "c_ws_plugin__s2member_no_cache::no_cache", 1);
|
30 |
/**/
|
31 |
-
add_action ("init", "c_ws_plugin__s2member_profile::profile", 1);
|
32 |
add_action ("init", "c_ws_plugin__s2member_register::register", 1);
|
33 |
add_action ("init", "c_ws_plugin__s2member_paypal_return::paypal_return", 1);
|
34 |
add_action ("init", "c_ws_plugin__s2member_paypal_notify::paypal_notify", 1);
|
@@ -48,12 +47,16 @@ add_action ("init", "c_ws_plugin__s2member_css_js::css", 1);
|
|
48 |
add_action ("init", "c_ws_plugin__s2member_constants::constants", 1);
|
49 |
add_action ("init", "c_ws_plugin__s2member_css_js::js_w_globals", 1);
|
50 |
/**/
|
|
|
|
|
51 |
add_action ("init", "c_ws_plugin__s2member_labels::config_label_translations");
|
52 |
add_action ("init", "c_ws_plugin__s2member_login_redirects_r::remove_login_redirect_filters", 11);
|
53 |
/**/
|
54 |
add_action ("template_redirect", "c_ws_plugin__s2member_ssl::check_force_ssl", 1);
|
55 |
add_action ("template_redirect", "c_ws_plugin__s2member_security::security_gate", 1);
|
56 |
/**/
|
|
|
|
|
57 |
add_filter ("widget_text", "do_shortcode"); /* Shortcodes in widgets. */
|
58 |
/**/
|
59 |
add_action ("wp_print_styles", "c_ws_plugin__s2member_css_js_themes::add_css");
|
28 |
/**/
|
29 |
add_action ("init", "c_ws_plugin__s2member_no_cache::no_cache", 1);
|
30 |
/**/
|
|
|
31 |
add_action ("init", "c_ws_plugin__s2member_register::register", 1);
|
32 |
add_action ("init", "c_ws_plugin__s2member_paypal_return::paypal_return", 1);
|
33 |
add_action ("init", "c_ws_plugin__s2member_paypal_notify::paypal_notify", 1);
|
47 |
add_action ("init", "c_ws_plugin__s2member_constants::constants", 1);
|
48 |
add_action ("init", "c_ws_plugin__s2member_css_js::js_w_globals", 1);
|
49 |
/**/
|
50 |
+
add_action ("init", "c_ws_plugin__s2member_profile::profile", 1);
|
51 |
+
/**/
|
52 |
add_action ("init", "c_ws_plugin__s2member_labels::config_label_translations");
|
53 |
add_action ("init", "c_ws_plugin__s2member_login_redirects_r::remove_login_redirect_filters", 11);
|
54 |
/**/
|
55 |
add_action ("template_redirect", "c_ws_plugin__s2member_ssl::check_force_ssl", 1);
|
56 |
add_action ("template_redirect", "c_ws_plugin__s2member_security::security_gate", 1);
|
57 |
/**/
|
58 |
+
add_filter ("wp_mail", "c_ws_plugin__s2member_email_configs::email_filter");
|
59 |
+
/**/
|
60 |
add_filter ("widget_text", "do_shortcode"); /* Shortcodes in widgets. */
|
61 |
/**/
|
62 |
add_action ("wp_print_styles", "c_ws_plugin__s2member_css_js_themes::add_css");
|
includes/menu-pages/api-ops.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_api_ops"))
|
21 |
{
|
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_api_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -166,7 +164,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_api_ops"))
|
|
166 |
echo 'Registration Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
|
167 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
168 |
echo '<ul>' . "\n";
|
169 |
-
echo '<li><code>%%role%%</code> = The Role ID <code>( subscriber, s2member_level[
|
170 |
echo '<li><code>%%level%%</code> = The Level number <code>( 0, 1, 2, 3, 4 )</code>. ( <em>deprecated, no longer recommended; use <code>%%role%%</code></em> )</li>' . "\n";
|
171 |
echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> ( <em>in comma-delimited format</em> ).</li>' . "\n";
|
172 |
echo '<li><code>%%auto_eot_time%%</code> = Auto-EOT Time ( if applicable ). Ex: <code>1299925670</code> ( <em>unix timestamp</em> ).</li>' . "\n";
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_api_ops"))
|
21 |
{
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® API / Notifications</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
164 |
echo 'Registration Notifications take place silently behind-the-scene, using an HTTP connection.<br /><br />' . "\n";
|
165 |
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
166 |
echo '<ul>' . "\n";
|
167 |
+
echo '<li><code>%%role%%</code> = The Role ID <code>( subscriber, s2member_level[0-9]+, administrator, editor, author, contributor )</code>.</li>' . "\n";
|
168 |
echo '<li><code>%%level%%</code> = The Level number <code>( 0, 1, 2, 3, 4 )</code>. ( <em>deprecated, no longer recommended; use <code>%%role%%</code></em> )</li>' . "\n";
|
169 |
echo '<li><code>%%ccaps%%</code> = Custom Capabilities. Ex: <code>music,videos,free_gift</code> ( <em>in comma-delimited format</em> ).</li>' . "\n";
|
170 |
echo '<li><code>%%auto_eot_time%%</code> = Auto-EOT Time ( if applicable ). Ex: <code>1299925670</code> ( <em>unix timestamp</em> ).</li>' . "\n";
|
includes/menu-pages/code-samples/api-mop-vars.php
CHANGED
@@ -28,65 +28,7 @@ Here is a breakdown on each of these Variables:
|
|
28 |
`s2member_seeking` is always passed in; it is never excluded.
|
29 |
`s2member_level_req`, `s2member_ccap_req`, `s2member_sp_req` are mutually exclusive.
|
30 |
Only ONE of these three Variables will be passed in combination with `s2member_seeking`.
|
31 |
-
|
32 |
-
-----------------------------------------------------------------------------------------------------------
|
33 |
-
|
34 |
-
Example PHP code ( and conditionals ) that could be implemented within your Membership Options Page.
|
35 |
-
( TIP: these code samples are intended for "advanced" site owners and developers )
|
36 |
-
|
37 |
-
<?php /* Parse s2Member's MOP Vars into local variables. */
|
38 |
-
list($seeking, $id) = preg_split("/-/", $_GET["s2member_seeking"], 2);
|
39 |
-
list($seeking, $uri) = preg_split("/-/", $_GET["s2member_seeking"], 2);
|
40 |
-
list($seeking, $file) = preg_split("/-/", $_GET["s2member_seeking"], 2);
|
41 |
-
$level_req = $_GET["s2member_level_req"];
|
42 |
-
$ccap_req = $_GET["s2member_ccap_req"];
|
43 |
-
$sp_req = $_GET["s2member_sp_req"]; ?>
|
44 |
-
|
45 |
-
-----------------------------------------------------------------------------------------------------------
|
46 |
-
You probably will NOT use all of these conditionals; but this attempts to provide several examples for you.
|
47 |
-
-----------------------------------------------------------------------------------------------------------
|
48 |
-
|
49 |
-
<?php if(is_user_logged_in() && $level_req){ /* A Member is already logged-in. */ ?>
|
50 |
-
|
51 |
-
The content you requested, requires an upgrade to Level# <?php echo $level_req; ?>.
|
52 |
-
|
53 |
-
<?php else if(is_user_logged_in() && $ccap_req){ /* A Member is already logged-in. */ ?>
|
54 |
-
|
55 |
-
The content you requested, requires an upgrade; for access to: <?php echo $ccap_req; ?>.
|
56 |
-
|
57 |
-
<?php else if(is_user_logged_in() && $sp_req){ /* A Member is already logged-in. */ ?>
|
58 |
-
|
59 |
-
The content you requested, requires a separate purchase of: <?php echo get_the_title($id); ?>.
|
60 |
-
|
61 |
-
<?php else if(preg_match("/^(post|page)$/", $seeking) && $id && $level_req){ /* A Post or Page ( i.e. post|page ). */ ?>
|
62 |
-
|
63 |
-
The Post/Page you were looking for ( <?php echo get_the_title($id); ?> ) requires access @ Level #<?php echo $level_req; ?>.
|
64 |
-
|
65 |
-
<?php } else if($seeking === "catg" && $id && $level_req && !is_wp_error($catg_name = get_term_field("name", $id, "category"))){ ?>
|
66 |
-
|
67 |
-
The Category you were looking for ( <?php echo $catg_name; ?> ) requires access @ Level #<?php echo $level_req; ?>.
|
68 |
-
|
69 |
-
<?php } else if($seeking === "ptag" && $id && $level_req && !is_wp_error($ptag_name = get_term_field("name", $id, "post_tag"))){ ?>
|
70 |
-
|
71 |
-
The Tag you were looking for ( <?php echo $ptag_name; ?> ) requires access @ Level #<?php echo $level_req; ?>.
|
72 |
-
|
73 |
-
<?php } else if($seeking === "ruri" && $uri && $level_req && ($uri = base64_decode($uri))){ /* Decoding the URI value. */ ?>
|
74 |
-
|
75 |
-
The URI you were looking for ( <?php echo $uri; ?> ) requires access @ Level #<?php echo $level_req; ?>.
|
76 |
-
|
77 |
-
<?php } else if($seeking && $id && $sp_req){ /* Specific Post/Page Access ( i.e. s2member_sp_req ) */ ?>
|
78 |
-
|
79 |
-
Buy Now: The Post/Page you were looking for ( <?php echo get_the_title($id); ?> ) requires payment.
|
80 |
-
|
81 |
-
<?php } else { /* It's good to include a general default handler. */ ?>
|
82 |
-
|
83 |
-
Buy Now ( general default ).
|
84 |
-
|
85 |
-
<?php } ?>
|
86 |
|
87 |
-----------------------------------------------------------------------------------------------------------
|
88 |
-
* All of the conditional examples above are 100% completely optional ( for advanced site owners ).
|
89 |
-
By default, s2Member will simply display your Membership Options Page; in its entirety.
|
90 |
|
91 |
-
*
|
92 |
-
See: http://wordpress.org/extend/plugins/php-execution-plugin/
|
28 |
`s2member_seeking` is always passed in; it is never excluded.
|
29 |
`s2member_level_req`, `s2member_ccap_req`, `s2member_sp_req` are mutually exclusive.
|
30 |
Only ONE of these three Variables will be passed in combination with `s2member_seeking`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-----------------------------------------------------------------------------------------------------------
|
|
|
|
|
33 |
|
34 |
+
* The use of MOP Vars is 100% completely optional ( for advanced site owners ).
|
|
includes/menu-pages/code-samples/current-user-fields.php
CHANGED
@@ -8,20 +8,23 @@ Custom Fields are also included in the JSON decoded array.
|
|
8 |
|
9 |
---- s2member Shortcode Equivalents ----
|
10 |
|
|
|
|
|
|
|
|
|
|
|
11 |
[s2Get user_field="first_name" /]
|
12 |
[s2Get user_field="last_name" /]
|
13 |
-
[s2Get user_field="
|
14 |
-
[s2Get user_field="
|
15 |
-
[s2Get user_field="
|
|
|
|
|
|
|
16 |
[s2Get user_field="any other WP_User property" /]
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
[s2Get
|
21 |
-
|
22 |
-
|
23 |
-
[s2Get user_option="s2member_auto_eot_time" /]
|
24 |
-
[s2Get user_option="any other meta_key" /]
|
25 |
-
|
26 |
-
Or to include the JSON encoded array into a JavaScript routine.
|
27 |
-
[s2Get constant="S2MEMBER_CURRENT_USER_FIELDS" /]
|
8 |
|
9 |
---- s2member Shortcode Equivalents ----
|
10 |
|
11 |
+
[s2Get user_field="id" /]
|
12 |
+
[s2Get user_field="ip" /]
|
13 |
+
[s2Get user_field="reg_ip" /]
|
14 |
+
[s2Get user_field="email" /]
|
15 |
+
[s2Get user_field="login" /]
|
16 |
[s2Get user_field="first_name" /]
|
17 |
[s2Get user_field="last_name" /]
|
18 |
+
[s2Get user_field="display_name" /]
|
19 |
+
[s2Get user_field="s2member_custom" /]
|
20 |
+
[s2Get user_field="s2member_subscr_id" /]
|
21 |
+
[s2Get user_field="s2member_subscr_or_wp_id" /]
|
22 |
+
[s2Get user_field="s2member_subscr_gateway" /]
|
23 |
+
[s2Get user_field="my_custom_field_id" /]
|
24 |
[s2Get user_field="any other WP_User property" /]
|
25 |
|
26 |
+
Or, to include the JSON encoded array in a JavaScript routine.
|
27 |
+
<script type="text/javascript">
|
28 |
+
var fieldsObj = [s2Get constant="S2MEMBER_CURRENT_USER_FIELDS" /];
|
29 |
+
document.write(fieldsObj.display_name);
|
30 |
+
</script>
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/current-user-profile-modification-page-url-1.php
CHANGED
@@ -1,5 +1 @@
|
|
1 |
-
<a href="<?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; ?>">Modify Profile</a>
|
2 |
-
|
3 |
-
---- s2member Shortcode Equivalent ----
|
4 |
-
|
5 |
-
<a href="[s2Get constant="S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL" /]">Modify Profile</a>
|
1 |
+
<a href="<?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; ?>">Modify Profile</a>
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/current-user-value-for-pp-on0-os0.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<!-- Identifies/Updates An Existing Member After Checkout -->
|
2 |
-
<input type="hidden" name="on0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>" />
|
3 |
-
<input type="hidden" name="os0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>" />
|
4 |
-
<input type="hidden" name="modify" value="1" />
|
5 |
-
|
6 |
-
---- s2member Shortcode Equivalents ----
|
7 |
-
|
8 |
-
[s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0" /]
|
9 |
-
[s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level0-file-downloads-allowed-days.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #0 Users are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level0-file-downloads-allowed.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #0 Users are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level0-label.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php echo S2MEMBER_LEVEL0_LABEL; ?>
|
2 |
-
This may output something like: Free
|
3 |
-
( or whatever Label you've configured for Level #0 )
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL0_LABEL" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level1-file-downloads-allowed-days.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #1 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level1-file-downloads-allowed.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #1 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level1-label.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php echo S2MEMBER_LEVEL1_LABEL; ?>
|
2 |
-
This may output something like: Bronze Membership
|
3 |
-
( or whatever Label you've configured for Level #1 )
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL1_LABEL" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level2-file-downloads-allowed-days.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #2 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level2-file-downloads-allowed.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #2 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level2-label.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php echo S2MEMBER_LEVEL2_LABEL; ?>
|
2 |
-
This may output something like: Silver Membership
|
3 |
-
( or whatever Label you've configured for Level #2 )
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL2_LABEL" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level3-file-downloads-allowed-days.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #3 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level3-file-downloads-allowed.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #3 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level3-label.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php echo S2MEMBER_LEVEL3_LABEL; ?>
|
2 |
-
This may output something like: Gold Membership
|
3 |
-
( or whatever Label you've configured for Level #3 )
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL3_LABEL" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level4-file-downloads-allowed-days.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #4 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level4-file-downloads-allowed.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
Level #4 Members are allowed to download
|
2 |
-
<?php echo S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED; ?> files
|
3 |
-
every <?php S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS; ?> days.
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/level4-label.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php echo S2MEMBER_LEVEL4_LABEL; ?>
|
2 |
-
This may output something like: Platinum Membership
|
3 |
-
( or whatever Label you've configured for Level #4 )
|
4 |
-
|
5 |
-
---- s2member Shortcode Equivalent ----
|
6 |
-
|
7 |
-
[s2Get constant="S2MEMBER_LEVEL4_LABEL" /]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/query-conditional-examples.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
Is a specific [Category, Tag, Post, Page, or URI] protected by s2Member?
|
2 |
-
<?php is_protected_by_s2member ($__id, $__type, $check_user); ?>
|
3 |
-
( * This ignores the current User/Member status.
|
4 |
-
Just "is it protected" by s2Member at all? )
|
5 |
-
|
6 |
-
If true, returns a non-empty array containing one of these elements.
|
7 |
-
["s2member_level_req"] = Level required for access.
|
8 |
-
["s2member_ccap_req"] = Custom Capability required.
|
9 |
-
["s2member_sp_req"] = "Specific Post/Page ID" required.
|
10 |
-
Otherwise returns false.
|
11 |
-
|
12 |
-
$__id - optional argument. Defaults to current $post->ID in The Loop.
|
13 |
-
$__type - optional argument. One of: `category`, `tag`, `post`, `page`, `singular`, `uri`. Defaults to: `singular`.
|
14 |
-
$check_user - optional ( consider the current User? ) defaults to: false.
|
15 |
-
|
16 |
-
-----------------------------------------------------------------------------
|
17 |
-
|
18 |
-
Is the current User permitted to access this [Category, Tag, Post, Page, or URI]?
|
19 |
-
<?php is_permitted_by_s2member ($__id, $__type); ?>
|
20 |
-
|
21 |
-
Returns true or false.
|
22 |
-
|
23 |
-
Similar to:
|
24 |
-
<?php is_protected_by_s2member ($__id, $__type, $check_user = TRUE); ?>
|
25 |
-
- BUT `is_permitted_by_s2member()` does NOT return an array.
|
26 |
-
|
27 |
-
$__id - optional argument. Defaults to current $post->ID in The Loop.
|
28 |
-
$__type - optional argument. One of: `category`, `tag`, `post`, `page`, `singular`, `uri`. Defaults to: `singular`.
|
29 |
-
|
30 |
-
-----------------------------------------------------------------------------
|
31 |
-
|
32 |
-
Further details and additional functions can be found inside:
|
33 |
-
/s2member/includes/functions/api-functions.inc.php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/menu-pages/code-samples/version.php
CHANGED
@@ -1,8 +1,12 @@
|
|
1 |
<?php echo S2MEMBER_VERSION; ?>
|
2 |
-
This may output something like:
|
3 |
( or whatever the current version number is )
|
4 |
Use PHP's version_compare() function to test this.
|
5 |
|
|
|
|
|
|
|
|
|
6 |
---- s2member Shortcode Equivalent ----
|
7 |
|
8 |
[s2Get constant="S2MEMBER_VERSION" /]
|
1 |
<?php echo S2MEMBER_VERSION; ?>
|
2 |
+
This may output something like: 110620
|
3 |
( or whatever the current version number is )
|
4 |
Use PHP's version_compare() function to test this.
|
5 |
|
6 |
+
Note: s2Member versions now follow their release date.
|
7 |
+
Ex: s2Member v110620 was released June 20th 2011.
|
8 |
+
( YYMMDD format )
|
9 |
+
|
10 |
---- s2member Shortcode Equivalent ----
|
11 |
|
12 |
[s2Get constant="S2MEMBER_VERSION" /]
|
includes/menu-pages/down-ops.inc.php
CHANGED
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_down_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -73,91 +71,30 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_down_ops"))
|
|
73 |
/**/
|
74 |
echo '<table class="form-table" style="margin-top:0;">' . "\n";
|
75 |
echo '<tbody>' . "\n";
|
76 |
-
echo '<tr>' . "\n";
|
77 |
/**/
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
/**/
|
87 |
-
echo '<td>' . "\n";
|
88 |
-
echo '<input type="text" name="ws_plugin__s2member_level0_file_downloads_allowed" id="ws-plugin--s2member-level0-file-downloads-allowed" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed"]) . '" style="width:200px;" maxlength="9" /> every <input type="text" name="ws_plugin__s2member_level0_file_downloads_allowed_days" id="ws-plugin--s2member-level0-file-downloads-allowed-days" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_file_downloads_allowed_days"]) . '" style="width:200px;" maxlength="3" onkeyup="if(this.value > 365){ alert(\'( 365 days is the maximum ).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> days.<br />' . "\n";
|
89 |
-
echo 'Only this many unique downloads ( <code><em>999999999 = unlimited</em></code> ) will be permitted every X days.' . "\n";
|
90 |
-
echo '</td>' . "\n";
|
91 |
-
/**/
|
92 |
-
echo '</tr>' . "\n";
|
93 |
-
echo '<tr>' . "\n";
|
94 |
-
/**/
|
95 |
-
echo '<th>' . "\n";
|
96 |
-
echo '<label for="ws-plugin--s2member-level1-file-downloads-allowed">' . "\n";
|
97 |
-
echo 'File Downloads ( Level #1 Or Higher ):' . "\n";
|
98 |
-
echo '</label>' . "\n";
|
99 |
-
echo '</th>' . "\n";
|
100 |
-
/**/
|
101 |
-
echo '</tr>' . "\n";
|
102 |
-
echo '<tr>' . "\n";
|
103 |
-
/**/
|
104 |
-
echo '<td>' . "\n";
|
105 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_file_downloads_allowed" id="ws-plugin--s2member-level1-file-downloads-allowed" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed"]) . '" style="width:200px;" maxlength="9" /> every <input type="text" name="ws_plugin__s2member_level1_file_downloads_allowed_days" id="ws-plugin--s2member-level1-file-downloads-allowed-days" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_file_downloads_allowed_days"]) . '" style="width:200px;" maxlength="3" onkeyup="if(this.value > 365){ alert(\'( 365 days is the maximum ).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> days.<br />' . "\n";
|
106 |
-
echo 'Only this many unique downloads ( <code><em>999999999 = unlimited</em></code> ) will be permitted every X days.' . "\n";
|
107 |
-
echo '</td>' . "\n";
|
108 |
-
/**/
|
109 |
-
echo '</tr>' . "\n";
|
110 |
-
echo '<tr>' . "\n";
|
111 |
-
/**/
|
112 |
-
echo '<th>' . "\n";
|
113 |
-
echo '<label for="ws-plugin--s2member-level2-file-downloads-allowed">' . "\n";
|
114 |
-
echo 'File Downloads ( Level #2 Or Higher ):' . "\n";
|
115 |
-
echo '</label>' . "\n";
|
116 |
-
echo '</th>' . "\n";
|
117 |
-
/**/
|
118 |
-
echo '</tr>' . "\n";
|
119 |
-
echo '<tr>' . "\n";
|
120 |
-
/**/
|
121 |
-
echo '<td>' . "\n";
|
122 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_file_downloads_allowed" id="ws-plugin--s2member-level2-file-downloads-allowed" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed"]) . '" style="width:200px;" maxlength="9" /> every <input type="text" name="ws_plugin__s2member_level2_file_downloads_allowed_days" id="ws-plugin--s2member-level2-file-downloads-allowed-days" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_file_downloads_allowed_days"]) . '" style="width:200px;" maxlength="3" onkeyup="if(this.value > 365){ alert(\'( 365 days is the maximum ).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> days.<br />' . "\n";
|
123 |
-
echo 'Only this many unique downloads ( <code><em>999999999 = unlimited</em></code> ) will be permitted every X days.' . "\n";
|
124 |
-
echo '</td>' . "\n";
|
125 |
-
/**/
|
126 |
-
echo '</tr>' . "\n";
|
127 |
-
echo '<tr>' . "\n";
|
128 |
-
/**/
|
129 |
-
echo '<th>' . "\n";
|
130 |
-
echo '<label for="ws-plugin--s2member-level3-file-downloads-allowed">' . "\n";
|
131 |
-
echo 'File Downloads ( Level #3 Or Higher ):' . "\n";
|
132 |
-
echo '</label>' . "\n";
|
133 |
-
echo '</th>' . "\n";
|
134 |
-
/**/
|
135 |
-
echo '</tr>' . "\n";
|
136 |
-
echo '<tr>' . "\n";
|
137 |
-
/**/
|
138 |
-
echo '<td>' . "\n";
|
139 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_file_downloads_allowed" id="ws-plugin--s2member-level3-file-downloads-allowed" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed"]) . '" style="width:200px;" maxlength="9" /> every <input type="text" name="ws_plugin__s2member_level3_file_downloads_allowed_days" id="ws-plugin--s2member-level3-file-downloads-allowed-days" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed_days"]) . '" style="width:200px;" maxlength="3" onkeyup="if(this.value > 365){ alert(\'( 365 days is the maximum ).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> days.<br />' . "\n";
|
140 |
-
echo 'Only this many unique downloads ( <code><em>999999999 = unlimited</em></code> ) will be permitted every X days.' . "\n";
|
141 |
-
echo '</td>' . "\n";
|
142 |
-
/**/
|
143 |
-
echo '</tr>' . "\n";
|
144 |
-
echo '<tr>' . "\n";
|
145 |
-
/**/
|
146 |
-
echo '<th>' . "\n";
|
147 |
-
echo '<label for="ws-plugin--s2member-level4-file-downloads-allowed">' . "\n";
|
148 |
-
echo 'File Downloads ( Highest Level #4 ):' . "\n";
|
149 |
-
echo '</label>' . "\n";
|
150 |
-
echo '</th>' . "\n";
|
151 |
-
/**/
|
152 |
-
echo '</tr>' . "\n";
|
153 |
-
echo '<tr>' . "\n";
|
154 |
-
/**/
|
155 |
-
echo '<td>' . "\n";
|
156 |
-
echo '<input type="text" name="ws_plugin__s2member_level4_file_downloads_allowed" id="ws-plugin--s2member-level4-file-downloads-allowed" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed"]) . '" style="width:200px;" maxlength="9" /> every <input type="text" name="ws_plugin__s2member_level4_file_downloads_allowed_days" id="ws-plugin--s2member-level4-file-downloads-allowed-days" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"]) . '" style="width:200px;" maxlength="3" onkeyup="if(this.value > 365){ alert(\'( 365 days is the maximum ).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> days.<br />' . "\n";
|
157 |
-
echo 'Only this many unique downloads ( <code><em>999999999 = unlimited</em></code> ) will be permitted every X days.' . "\n";
|
158 |
-
echo '</td>' . "\n";
|
159 |
-
/**/
|
160 |
-
echo '</tr>' . "\n";
|
161 |
echo '</tbody>' . "\n";
|
162 |
echo '</table>' . "\n";
|
163 |
echo '</div>' . "\n";
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® File Download Options</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
71 |
/**/
|
72 |
echo '<table class="form-table" style="margin-top:0;">' . "\n";
|
73 |
echo '<tbody>' . "\n";
|
|
|
74 |
/**/
|
75 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
76 |
+
{
|
77 |
+
echo '<tr>' . "\n";
|
78 |
+
/**/
|
79 |
+
echo '<th style="padding-top:0;">' . "\n";
|
80 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-file-downloads-allowed">' . "\n";
|
81 |
+
echo ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'File Downloads ( Highest Level #' . $n . ' ):' . "\n" : 'File Downloads ( Level #' . $n . ' Or Higher ):' . "\n";
|
82 |
+
echo '</label>' . "\n";
|
83 |
+
echo '</th>' . "\n";
|
84 |
+
/**/
|
85 |
+
echo '</tr>' . "\n";
|
86 |
+
echo '<tr>' . "\n";
|
87 |
+
/**/
|
88 |
+
echo '<td>' . "\n";
|
89 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_file_downloads_allowed" id="ws-plugin--s2member-level' . $n . '-file-downloads-allowed" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed"]) . '" style="width:200px;" maxlength="9" /> every <input type="text" name="ws_plugin__s2member_level' . $n . '_file_downloads_allowed_days" id="ws-plugin--s2member-level' . $n . '-file-downloads-allowed-days" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed_days"]) . '" style="width:200px;" maxlength="3" onkeyup="if(this.value > 365){ alert(\'( 365 days is the maximum ).\\nThis keeps the logs optimized.\'); this.value = 365; }" /> days.<br />' . "\n";
|
90 |
+
echo 'Only this many unique downloads ( <code><em>999999999 = unlimited</em></code> ) will be permitted every X days.' . "\n";
|
91 |
+
echo '</td>' . "\n";
|
92 |
+
/**/
|
93 |
+
echo '</tr>' . "\n";
|
94 |
+
/**/
|
95 |
+
echo ($n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? '<tr><td><div class="ws-menu-page-hr"></div></td></tr>' : '';
|
96 |
+
}
|
97 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
echo '</tbody>' . "\n";
|
99 |
echo '</table>' . "\n";
|
100 |
echo '</div>' . "\n";
|
includes/menu-pages/els-ops.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
|
21 |
{
|
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -78,95 +76,30 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
|
|
78 |
echo '</td>' . "\n";
|
79 |
/**/
|
80 |
echo '</tr>' . "\n";
|
81 |
-
echo '<tr>' . "\n";
|
82 |
-
/**/
|
83 |
-
echo '<th>' . "\n";
|
84 |
-
echo '<label for="ws-plugin--s2member-level0-mailchimp-list-ids">' . "\n";
|
85 |
-
echo 'List ID(s) for Free Subscribers ( comma-delimited ):' . "\n";
|
86 |
-
echo '</label>' . "\n";
|
87 |
-
echo '</th>' . "\n";
|
88 |
-
/**/
|
89 |
-
echo '</tr>' . "\n";
|
90 |
-
echo '<tr>' . "\n";
|
91 |
-
/**/
|
92 |
-
echo '<td>' . "\n";
|
93 |
-
echo '<input type="text" name="ws_plugin__s2member_level0_mailchimp_list_ids" id="ws-plugin--s2member-level0-mailchimp-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_mailchimp_list_ids"]) . '" /><br />' . "\n";
|
94 |
-
echo 'New Free Subscribers will be subscribed to these List IDs.<br />' . "\n";
|
95 |
-
echo 'Ex: <code>4a44fRio5d, 434ksvviEdf, 8834jsdf923, ee9djfs4jel3</code><br />' . "\n";
|
96 |
-
echo 'Or: <code>4a44fRio5d::Group Title::Group|Another Group</code>' . "\n";
|
97 |
-
echo '</td>' . "\n";
|
98 |
-
/**/
|
99 |
-
echo '</tr>' . "\n";
|
100 |
-
echo '<tr>' . "\n";
|
101 |
-
/**/
|
102 |
-
echo '<th>' . "\n";
|
103 |
-
echo '<label for="ws-plugin--s2member-level1-mailchimp-list-ids">' . "\n";
|
104 |
-
echo 'List ID(s) for Level #1 ( comma-delimited ):' . "\n";
|
105 |
-
echo '</label>' . "\n";
|
106 |
-
echo '</th>' . "\n";
|
107 |
-
/**/
|
108 |
-
echo '</tr>' . "\n";
|
109 |
-
echo '<tr>' . "\n";
|
110 |
-
/**/
|
111 |
-
echo '<td>' . "\n";
|
112 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_mailchimp_list_ids" id="ws-plugin--s2member-level1-mailchimp-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_mailchimp_list_ids"]) . '" /><br />' . "\n";
|
113 |
-
echo 'New Level 1 Members will be subscribed to these List IDs.<br />' . "\n";
|
114 |
-
echo 'Ex: <code>4a44fRio5d, 434ksvviEdf, 8834jsdf923, ee9djfs4jel3</code><br />' . "\n";
|
115 |
-
echo 'Or: <code>4a44fRio5d::Group Title::Group|Another Group</code>' . "\n";
|
116 |
-
echo '</td>' . "\n";
|
117 |
-
/**/
|
118 |
-
echo '</tr>' . "\n";
|
119 |
-
echo '<tr>' . "\n";
|
120 |
-
/**/
|
121 |
-
echo '<th>' . "\n";
|
122 |
-
echo '<label for="ws-plugin--s2member-level2-mailchimp-list-ids">' . "\n";
|
123 |
-
echo 'List ID(s) for Level #2 ( comma-delimited ):' . "\n";
|
124 |
-
echo '</label>' . "\n";
|
125 |
-
echo '</th>' . "\n";
|
126 |
-
/**/
|
127 |
-
echo '</tr>' . "\n";
|
128 |
-
echo '<tr>' . "\n";
|
129 |
-
/**/
|
130 |
-
echo '<td>' . "\n";
|
131 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_mailchimp_list_ids" id="ws-plugin--s2member-level2-mailchimp-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_mailchimp_list_ids"]) . '" /><br />' . "\n";
|
132 |
-
echo 'New Level 2 Members will be subscribed to these List IDs.' . "\n";
|
133 |
-
echo '</td>' . "\n";
|
134 |
-
/**/
|
135 |
-
echo '</tr>' . "\n";
|
136 |
-
echo '<tr>' . "\n";
|
137 |
-
/**/
|
138 |
-
echo '<th>' . "\n";
|
139 |
-
echo '<label for="ws-plugin--s2member-level3-mailchimp-list-ids">' . "\n";
|
140 |
-
echo 'List ID(s) for Level #3 ( comma-delimited ):' . "\n";
|
141 |
-
echo '</label>' . "\n";
|
142 |
-
echo '</th>' . "\n";
|
143 |
-
/**/
|
144 |
-
echo '</tr>' . "\n";
|
145 |
-
echo '<tr>' . "\n";
|
146 |
-
/**/
|
147 |
-
echo '<td>' . "\n";
|
148 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_mailchimp_list_ids" id="ws-plugin--s2member-level3-mailchimp-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_mailchimp_list_ids"]) . '" /><br />' . "\n";
|
149 |
-
echo 'New Level 3 Members will be subscribed to these List IDs.' . "\n";
|
150 |
-
echo '</td>' . "\n";
|
151 |
-
/**/
|
152 |
-
echo '</tr>' . "\n";
|
153 |
-
echo '<tr>' . "\n";
|
154 |
-
/**/
|
155 |
-
echo '<th>' . "\n";
|
156 |
-
echo '<label for="ws-plugin--s2member-level4-mailchimp-list-ids">' . "\n";
|
157 |
-
echo 'List ID(s) for Level #4 ( comma-delimited ):' . "\n";
|
158 |
-
echo '</label>' . "\n";
|
159 |
-
echo '</th>' . "\n";
|
160 |
-
/**/
|
161 |
-
echo '</tr>' . "\n";
|
162 |
-
echo '<tr>' . "\n";
|
163 |
/**/
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
/**/
|
169 |
-
echo '</tr>' . "\n";
|
170 |
echo '</tbody>' . "\n";
|
171 |
echo '</table>' . "\n";
|
172 |
echo '</div>' . "\n";
|
@@ -191,93 +124,29 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
|
|
191 |
/**/
|
192 |
echo '<table class="form-table">' . "\n";
|
193 |
echo '<tbody>' . "\n";
|
194 |
-
echo '<tr>' . "\n";
|
195 |
-
/**/
|
196 |
-
echo '<th>' . "\n";
|
197 |
-
echo '<label for="ws-plugin--s2member-level0-aweber-list-ids">' . "\n";
|
198 |
-
echo 'List ID(s) for Free Subscribers ( comma-delimited ):' . "\n";
|
199 |
-
echo '</label>' . "\n";
|
200 |
-
echo '</th>' . "\n";
|
201 |
-
/**/
|
202 |
-
echo '</tr>' . "\n";
|
203 |
-
echo '<tr>' . "\n";
|
204 |
-
/**/
|
205 |
-
echo '<td>' . "\n";
|
206 |
-
echo '<input type="text" name="ws_plugin__s2member_level0_aweber_list_ids" id="ws-plugin--s2member-level0-aweber-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_aweber_list_ids"]) . '" /><br />' . "\n";
|
207 |
-
echo 'New Free Subscribers will be subscribed to these List IDs.<br />' . "\n";
|
208 |
-
echo 'Ex: <code>mylist, myotherlist, anotherlist</code>' . "\n";
|
209 |
-
echo '</td>' . "\n";
|
210 |
-
/**/
|
211 |
-
echo '</tr>' . "\n";
|
212 |
-
echo '<tr>' . "\n";
|
213 |
-
/**/
|
214 |
-
echo '<th>' . "\n";
|
215 |
-
echo '<label for="ws-plugin--s2member-level1-aweber-list-ids">' . "\n";
|
216 |
-
echo 'List ID(s) for Level #1 ( comma-delimited ):' . "\n";
|
217 |
-
echo '</label>' . "\n";
|
218 |
-
echo '</th>' . "\n";
|
219 |
-
/**/
|
220 |
-
echo '</tr>' . "\n";
|
221 |
-
echo '<tr>' . "\n";
|
222 |
-
/**/
|
223 |
-
echo '<td>' . "\n";
|
224 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_aweber_list_ids" id="ws-plugin--s2member-level1-aweber-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_aweber_list_ids"]) . '" /><br />' . "\n";
|
225 |
-
echo 'New Level 1 Members will be subscribed to these List IDs.<br />' . "\n";
|
226 |
-
echo 'Ex: <code>mylist, myotherlist, anotherlist</code>' . "\n";
|
227 |
-
echo '</td>' . "\n";
|
228 |
-
/**/
|
229 |
-
echo '</tr>' . "\n";
|
230 |
-
echo '<tr>' . "\n";
|
231 |
-
/**/
|
232 |
-
echo '<th>' . "\n";
|
233 |
-
echo '<label for="ws-plugin--s2member-level2-aweber-list-ids">' . "\n";
|
234 |
-
echo 'List ID(s) for Level #2 ( comma-delimited ):' . "\n";
|
235 |
-
echo '</label>' . "\n";
|
236 |
-
echo '</th>' . "\n";
|
237 |
/**/
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_aweber_list_ids" id="ws-plugin--s2member-level3-aweber-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_aweber_list_ids"]) . '" /><br />' . "\n";
|
260 |
-
echo 'New Level 3 Members will be subscribed to these List IDs.' . "\n";
|
261 |
-
echo '</td>' . "\n";
|
262 |
-
/**/
|
263 |
-
echo '</tr>' . "\n";
|
264 |
-
echo '<tr>' . "\n";
|
265 |
-
/**/
|
266 |
-
echo '<th>' . "\n";
|
267 |
-
echo '<label for="ws-plugin--s2member-level4-aweber-list-ids">' . "\n";
|
268 |
-
echo 'List ID(s) for Level #4 ( comma-delimited ):' . "\n";
|
269 |
-
echo '</label>' . "\n";
|
270 |
-
echo '</th>' . "\n";
|
271 |
-
/**/
|
272 |
-
echo '</tr>' . "\n";
|
273 |
-
echo '<tr>' . "\n";
|
274 |
/**/
|
275 |
-
echo '<td>' . "\n";
|
276 |
-
echo '<input type="text" name="ws_plugin__s2member_level4_aweber_list_ids" id="ws-plugin--s2member-level4-aweber-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_aweber_list_ids"]) . '" /><br />' . "\n";
|
277 |
-
echo 'New Level 4 Members will be subscribed to these List IDs.' . "\n";
|
278 |
-
echo '</td>' . "\n";
|
279 |
-
/**/
|
280 |
-
echo '</tr>' . "\n";
|
281 |
echo '</tbody>' . "\n";
|
282 |
echo '</table>' . "\n";
|
283 |
echo '</div>' . "\n";
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
|
21 |
{
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® API / List Servers</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
76 |
echo '</td>' . "\n";
|
77 |
/**/
|
78 |
echo '</tr>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
/**/
|
80 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
81 |
+
{
|
82 |
+
echo '<tr>' . "\n";
|
83 |
+
/**/
|
84 |
+
echo '<th>' . "\n";
|
85 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-mailchimp-list-ids">' . "\n";
|
86 |
+
echo 'List ID(s) for ' . (($n === 0) ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' ( comma-delimited ):' . "\n";
|
87 |
+
echo '</label>' . "\n";
|
88 |
+
echo '</th>' . "\n";
|
89 |
+
/**/
|
90 |
+
echo '</tr>' . "\n";
|
91 |
+
echo '<tr>' . "\n";
|
92 |
+
/**/
|
93 |
+
echo '<td>' . "\n";
|
94 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_mailchimp_list_ids" id="ws-plugin--s2member-level' . $n . '-mailchimp-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_mailchimp_list_ids"]) . '" /><br />' . "\n";
|
95 |
+
echo 'New ' . (($n === 0) ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' will be subscribed to these List IDs.<br />' . "\n";
|
96 |
+
echo 'Ex: <code>4a44fRio5d, 434ksvviEdf, 8834jsdf923, ee9djfs4jel3</code><br />' . "\n";
|
97 |
+
echo 'Or: <code>4a44fRio5d::Group Title::Group|Another Group</code>' . "\n";
|
98 |
+
echo '</td>' . "\n";
|
99 |
+
/**/
|
100 |
+
echo '</tr>' . "\n";
|
101 |
+
}
|
102 |
/**/
|
|
|
103 |
echo '</tbody>' . "\n";
|
104 |
echo '</table>' . "\n";
|
105 |
echo '</div>' . "\n";
|
124 |
/**/
|
125 |
echo '<table class="form-table">' . "\n";
|
126 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
/**/
|
128 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
129 |
+
{
|
130 |
+
echo '<tr>' . "\n";
|
131 |
+
/**/
|
132 |
+
echo '<th>' . "\n";
|
133 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-aweber-list-ids">' . "\n";
|
134 |
+
echo 'List ID(s) for ' . (($n === 0) ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' ( comma-delimited ):' . "\n";
|
135 |
+
echo '</label>' . "\n";
|
136 |
+
echo '</th>' . "\n";
|
137 |
+
/**/
|
138 |
+
echo '</tr>' . "\n";
|
139 |
+
echo '<tr>' . "\n";
|
140 |
+
/**/
|
141 |
+
echo '<td>' . "\n";
|
142 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_aweber_list_ids" id="ws-plugin--s2member-level' . $n . '-aweber-list-ids" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_aweber_list_ids"]) . '" /><br />' . "\n";
|
143 |
+
echo 'New ' . (($n === 0) ? 'Free Subscribers' : 'Level #' . $n . ' Members') . ' will be subscribed to these List IDs.<br />' . "\n";
|
144 |
+
echo 'Ex: <code>mylist, myotherlist, anotherlist</code>' . "\n";
|
145 |
+
echo '</td>' . "\n";
|
146 |
+
/**/
|
147 |
+
echo '</tr>' . "\n";
|
148 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
echo '</tbody>' . "\n";
|
151 |
echo '</table>' . "\n";
|
152 |
echo '</div>' . "\n";
|
includes/menu-pages/gen-ops.inc.php
CHANGED
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -200,9 +198,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
200 |
echo '<div class="ws-menu-page-group" title="Email Configuration">' . "\n";
|
201 |
/**/
|
202 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-email-section">' . "\n";
|
203 |
-
|
204 |
-
echo '<
|
205 |
-
|
|
|
206 |
/**/
|
207 |
echo '<table class="form-table">' . "\n";
|
208 |
echo '<tbody>' . "\n";
|
@@ -210,7 +209,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
210 |
/**/
|
211 |
echo '<th>' . "\n";
|
212 |
echo '<label for="ws-plugin--s2member-reg-email-from-name">' . "\n";
|
213 |
-
echo '
|
214 |
echo '</label>' . "\n";
|
215 |
echo '</th>' . "\n";
|
216 |
/**/
|
@@ -227,7 +226,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
227 |
/**/
|
228 |
echo '<th>' . "\n";
|
229 |
echo '<label for="ws-plugin--s2member-reg-email-from-email">' . "\n";
|
230 |
-
echo '
|
231 |
echo '</label>' . "\n";
|
232 |
echo '</th>' . "\n";
|
233 |
/**/
|
@@ -242,6 +241,85 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
242 |
echo '</tr>' . "\n";
|
243 |
echo '</tbody>' . "\n";
|
244 |
echo '</table>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
echo '</div>' . "\n";
|
246 |
/**/
|
247 |
echo '</div>' . "\n";
|
@@ -314,97 +392,34 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
314 |
/**/
|
315 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-levels-section">' . "\n";
|
316 |
echo '<h3>Membership Levels ( required, please customize these )</h3>' . "\n";
|
317 |
-
echo '<p>The default Membership Levels are labeled generically; feel free to modify them as needed. s2Member supports Free Subscribers ( at Level #0 )
|
318 |
-
echo (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? '<p><em>
|
319 |
do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_membership_levels", get_defined_vars ());
|
320 |
/**/
|
321 |
echo '<table class="form-table">' . "\n";
|
322 |
echo '<tbody>' . "\n";
|
323 |
-
echo '<tr>' . "\n";
|
324 |
-
/**/
|
325 |
-
echo '<th>' . "\n";
|
326 |
-
echo '<label for="ws-plugin--s2member-level0-label">' . "\n";
|
327 |
-
echo 'Level #0 ( Free Subscribers ):' . "\n";
|
328 |
-
echo '</label>' . "\n";
|
329 |
-
echo '</th>' . "\n";
|
330 |
-
/**/
|
331 |
-
echo '</tr>' . "\n";
|
332 |
-
echo '<tr>' . "\n";
|
333 |
-
/**/
|
334 |
-
echo '<td>' . "\n";
|
335 |
-
echo '<input type="text" name="ws_plugin__s2member_level0_label" id="ws-plugin--s2member-level0-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_label"]) . '" /><br />' . "\n";
|
336 |
-
echo 'This is the Label for Level 0 ( reserved for Free Subscribers ).<br />' . "\n";
|
337 |
-
echo '</td>' . "\n";
|
338 |
-
/**/
|
339 |
-
echo '</tr>' . "\n";
|
340 |
-
echo '<tr>' . "\n";
|
341 |
-
/**/
|
342 |
-
echo '<th>' . "\n";
|
343 |
-
echo '<label for="ws-plugin--s2member-level1-label">' . "\n";
|
344 |
-
echo 'Membership Level #1 Label:' . "\n";
|
345 |
-
echo '</label>' . "\n";
|
346 |
-
echo '</th>' . "\n";
|
347 |
/**/
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
echo '<td>' . "\n";
|
369 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_label" id="ws-plugin--s2member-level2-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]) . '" /><br />' . "\n";
|
370 |
-
echo 'This is the Label for Membership Level 2.<br />' . "\n";
|
371 |
-
echo '</td>' . "\n";
|
372 |
-
/**/
|
373 |
-
echo '</tr>' . "\n";
|
374 |
-
echo '<tr>' . "\n";
|
375 |
-
/**/
|
376 |
-
echo '<th>' . "\n";
|
377 |
-
echo '<label for="ws-plugin--s2member-level3-label">' . "\n";
|
378 |
-
echo 'Membership Level #3 Label:' . "\n";
|
379 |
-
echo '</label>' . "\n";
|
380 |
-
echo '</th>' . "\n";
|
381 |
-
/**/
|
382 |
-
echo '</tr>' . "\n";
|
383 |
-
echo '<tr>' . "\n";
|
384 |
-
/**/
|
385 |
-
echo '<td>' . "\n";
|
386 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_label" id="ws-plugin--s2member-level3-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]) . '" /><br />' . "\n";
|
387 |
-
echo 'This is the Label for Membership Level 3.<br />' . "\n";
|
388 |
-
echo '</td>' . "\n";
|
389 |
-
/**/
|
390 |
-
echo '</tr>' . "\n";
|
391 |
-
echo '<tr>' . "\n";
|
392 |
-
/**/
|
393 |
-
echo '<th>' . "\n";
|
394 |
-
echo '<label for="ws-plugin--s2member-level4-label">' . "\n";
|
395 |
-
echo 'Membership Level #4 Label:' . "\n";
|
396 |
-
echo '</label>' . "\n";
|
397 |
-
echo '</th>' . "\n";
|
398 |
-
/**/
|
399 |
-
echo '</tr>' . "\n";
|
400 |
-
echo '<tr>' . "\n";
|
401 |
-
/**/
|
402 |
-
echo '<td>' . "\n";
|
403 |
-
echo '<input type="text" name="ws_plugin__s2member_level4_label" id="ws-plugin--s2member-level4-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]) . '" /><br />' . "\n";
|
404 |
-
echo 'This is the Label for Membership Level 4.<br />' . "\n";
|
405 |
-
echo '</td>' . "\n";
|
406 |
/**/
|
407 |
-
echo '</tr>' . "\n";
|
408 |
echo '</tbody>' . "\n";
|
409 |
echo '</table>' . "\n";
|
410 |
/**/
|
@@ -425,7 +440,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
425 |
/**/
|
426 |
echo '<td>' . "\n";
|
427 |
echo '<input type="radio" name="ws_plugin__s2member_apply_label_translations" id="ws-plugin--s2member-apply-label-translations-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["apply_label_translations"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-apply-label-translations-0">No</label> <input type="radio" name="ws_plugin__s2member_apply_label_translations" id="ws-plugin--s2member-apply-label-translations-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["apply_label_translations"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-apply-label-translations-1">Yes, force WordPress® to use my Labels.</label><br />' . "\n";
|
428 |
-
echo 'This particular option affects your administrative Dashboard only ( i.e. your list of Users )
|
429 |
echo '</td>' . "\n";
|
430 |
/**/
|
431 |
echo '</tr>' . "\n";
|
@@ -748,7 +763,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
748 |
/**/
|
749 |
echo '<td>' . "\n";
|
750 |
echo '<h3 style="margin:0;">Footer Design ( i.e. Bottom )</h3>' . "\n";
|
751 |
-
echo '<p style="margin:0;">
|
752 |
echo '</td>' . "\n";
|
753 |
/**/
|
754 |
echo '</tr>' . "\n";
|
@@ -782,7 +797,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
782 |
{
|
783 |
do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_custom_reg_fields", get_defined_vars ());
|
784 |
/**/
|
785 |
-
echo '<div class="ws-menu-page-group" title="Custom Registration Fields">' . "\n";
|
786 |
/**/
|
787 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-reg-fields-section">' . "\n";
|
788 |
echo '<h3>Custom Registration Fields ( optional, for further customization )</h3>' . "\n";
|
@@ -839,6 +854,28 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
839 |
echo '<tr>' . "\n";
|
840 |
/**/
|
841 |
echo '<th>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
842 |
echo '<label for="ws-plugin--s2member-custom-reg-password">' . "\n";
|
843 |
echo 'Allow Custom Passwords during Registration?' . "\n";
|
844 |
echo '</label>' . "\n";
|
@@ -1036,17 +1073,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
|
|
1036 |
/**/
|
1037 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1038 |
/**/
|
1039 |
-
echo '<p><strong>Shortcode
|
1040 |
-
echo '<p><input type="text" value="' . format_to_edit ('[s2Member-Profile /]') . '" style="
|
1041 |
-
/**/
|
1042 |
-
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( standard link tag ):</p>' . "\n";
|
1043 |
-
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1-ops.php"))) . '" style="background:#EEEEEE; font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
|
1044 |
-
/**/
|
1045 |
-
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( open the link in a popup window ):</p>' . "\n";
|
1046 |
-
echo '<p><textarea rows="2" spellcheck="false" style="background:#EEEEEE; font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();">' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.php"))) . '"</textarea></p>' . "\n";
|
1047 |
/**/
|
1048 |
-
echo '<p style="margin-top:20px;"><strong>Stand-Alone /
|
1049 |
-
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-
|
1050 |
echo '</div>' . "\n";
|
1051 |
/**/
|
1052 |
echo '</div>' . "\n";
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® General Options</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
198 |
echo '<div class="ws-menu-page-group" title="Email Configuration">' . "\n";
|
199 |
/**/
|
200 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-email-section">' . "\n";
|
201 |
+
/**/
|
202 |
+
echo '<h3 style="margin:0;">Email From: ' . esc_html ('"Name" <address>') . '</h3>' . "\n";
|
203 |
+
echo '<p style="margin:0;">This is the name/address that will appear in outgoing email notifications sent by the s2Member plugin.</p>' . "\n";
|
204 |
+
do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_email_from_name_config", get_defined_vars ());
|
205 |
/**/
|
206 |
echo '<table class="form-table">' . "\n";
|
207 |
echo '<tbody>' . "\n";
|
209 |
/**/
|
210 |
echo '<th>' . "\n";
|
211 |
echo '<label for="ws-plugin--s2member-reg-email-from-name">' . "\n";
|
212 |
+
echo 'Email From Name:' . "\n";
|
213 |
echo '</label>' . "\n";
|
214 |
echo '</th>' . "\n";
|
215 |
/**/
|
226 |
/**/
|
227 |
echo '<th>' . "\n";
|
228 |
echo '<label for="ws-plugin--s2member-reg-email-from-email">' . "\n";
|
229 |
+
echo 'Email From Address:' . "\n";
|
230 |
echo '</label>' . "\n";
|
231 |
echo '</th>' . "\n";
|
232 |
/**/
|
241 |
echo '</tr>' . "\n";
|
242 |
echo '</tbody>' . "\n";
|
243 |
echo '</table>' . "\n";
|
244 |
+
/**/
|
245 |
+
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["pluggables"]["wp_new_user_notification"])
|
246 |
+
{
|
247 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
248 |
+
/**/
|
249 |
+
echo '<h3 style="margin:0;">New User Email Message</h3>' . "\n";
|
250 |
+
echo '<p style="margin:0;">This email is sent to all new Users/Members. It should always contain their Username/Password. In addition to this email, s2Member will also send new paying Customers a Signup Confirmation Email, which you can customize from your Dashboard, under: <code>s2Member -> PayPal® Options</code>. You may wish to customize these emails further, by providing details that are specifically geared to your site.</p>' . "\n";
|
251 |
+
do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_email_new_user_config", get_defined_vars ());
|
252 |
+
/**/
|
253 |
+
echo '<table class="form-table">' . "\n";
|
254 |
+
echo '<tbody>' . "\n";
|
255 |
+
echo '<tr>' . "\n";
|
256 |
+
/**/
|
257 |
+
echo '<th>' . "\n";
|
258 |
+
echo '<label for="ws-plugin--s2member-new-user-email-subject">' . "\n";
|
259 |
+
echo 'New User Email Subject:' . "\n";
|
260 |
+
echo '</label>' . "\n";
|
261 |
+
echo '</th>' . "\n";
|
262 |
+
/**/
|
263 |
+
echo '</tr>' . "\n";
|
264 |
+
echo '<tr>' . "\n";
|
265 |
+
/**/
|
266 |
+
echo '<td>' . "\n";
|
267 |
+
echo '<input type="text" name="ws_plugin__s2member_new_user_email_subject" id="ws-plugin--s2member-new-user-email-subject" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_subject"]) . '" /><br />' . "\n";
|
268 |
+
echo 'Subject Line used in the email sent to new Users/Members.' . "\n";
|
269 |
+
echo '</td>' . "\n";
|
270 |
+
/**/
|
271 |
+
echo '</tr>' . "\n";
|
272 |
+
echo '<tr>' . "\n";
|
273 |
+
/**/
|
274 |
+
echo '<th>' . "\n";
|
275 |
+
echo '<label for="ws-plugin--s2member-new-user-email-message">' . "\n";
|
276 |
+
echo 'New User Email Message:' . "\n";
|
277 |
+
echo '</label>' . "\n";
|
278 |
+
echo '</th>' . "\n";
|
279 |
+
/**/
|
280 |
+
echo '</tr>' . "\n";
|
281 |
+
echo '<tr>' . "\n";
|
282 |
+
/**/
|
283 |
+
echo '<td>' . "\n";
|
284 |
+
echo '<textarea name="ws_plugin__s2member_new_user_email_message" id="ws-plugin--s2member-new-user-email-message" rows="10">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["new_user_email_message"]) . '</textarea><br />' . "\n";
|
285 |
+
echo 'Message Body used in the email sent to new Users/Members.<br /><br />' . "\n";
|
286 |
+
echo '<strong>You can also use these special Replacement Codes if you need them:</strong>' . "\n";
|
287 |
+
echo '<ul>' . "\n";
|
288 |
+
echo '<li><code>%%user_first_name%%</code> = The First Name of the Member who registered their Username.</li>' . "\n";
|
289 |
+
echo '<li><code>%%user_last_name%%</code> = The Last Name of the Member who registered their Username.</li>' . "\n";
|
290 |
+
echo '<li><code>%%user_full_name%%</code> = The Full Name ( First & Last ) of the Member who registered their Username.</li>' . "\n";
|
291 |
+
echo '<li><code>%%user_email%%</code> = The Email Address of the Member who registered their Username.</li>' . "\n";
|
292 |
+
echo '<li><code>%%user_login%%</code> = The Username the Member selected during registration.</li>' . "\n";
|
293 |
+
echo '<li><code>%%user_pass%%</code> = The Password selected or generated during registration.</li>' . "\n";
|
294 |
+
echo '<li><code>%%user_ip%%</code> = The User\'s IP Address, detected via <code>$_SERVER["REMOTE_ADDR"]</code>.</li>' . "\n";
|
295 |
+
echo '<li><code>%%user_id%%</code> = A unique WordPress® User ID generated during registration.</li>' . "\n";
|
296 |
+
echo '<li><code>%%wp_login_url%%</code> = The full URL where Users can get logged into your site.</li>' . "\n";
|
297 |
+
echo '</ul>' . "\n";
|
298 |
+
/**/
|
299 |
+
echo '<strong>Custom Registration Fields are also supported in this email:</strong>' . "\n";
|
300 |
+
echo '<ul>' . "\n";
|
301 |
+
echo '<li><code>%%date_of_birth%%</code> would be valid; if you have a Custom Registration Field with the ID <code>date_of_birth</code>.</li>' . "\n";
|
302 |
+
echo '<li><code>%%street_address%%</code> would be valid; if you have a Custom Registration Field with the ID <code>street_address</code>.</li>' . "\n";
|
303 |
+
echo '<li><code>%%country%%</code> would be valid; if you have a Custom Registration Field with the ID <code>country</code>.</li>' . "\n";
|
304 |
+
echo '<li><em><code>%%etc, etc...%%</code> <strong>see:</strong> s2Member -> General Options -> Custom Registration Fields</em>.</li>' . "\n";
|
305 |
+
echo '</ul>' . "\n";
|
306 |
+
/**/
|
307 |
+
echo '<strong>Custom Replacement Codes can also be inserted using these instructions:</strong>' . "\n";
|
308 |
+
echo '<ul>' . "\n";
|
309 |
+
echo '<li><code>%%cv0%%</code> = The domain of your site, which is passed through the `custom` attribute in your Shortcode.</li>' . "\n";
|
310 |
+
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. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.</li>' . "\n";
|
311 |
+
echo '</ul>' . "\n";
|
312 |
+
echo '<strong>This example uses cv1 to record a special marketing campaign:</strong><br />' . "\n";
|
313 |
+
echo '<em>( The campaign ( i.e. christmas-promo ) could be referenced using <code>%%cv1%%</code> )</em><br />' . "\n";
|
314 |
+
echo '<code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|christmas-promo"</code>' . "\n";
|
315 |
+
/**/
|
316 |
+
echo '</td>' . "\n";
|
317 |
+
/**/
|
318 |
+
echo '</tr>' . "\n";
|
319 |
+
echo '</tbody>' . "\n";
|
320 |
+
echo '</table>' . "\n";
|
321 |
+
}
|
322 |
+
/**/
|
323 |
echo '</div>' . "\n";
|
324 |
/**/
|
325 |
echo '</div>' . "\n";
|
392 |
/**/
|
393 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-membership-levels-section">' . "\n";
|
394 |
echo '<h3>Membership Levels ( required, please customize these )</h3>' . "\n";
|
395 |
+
echo '<p>The default Membership Levels are labeled generically; feel free to modify them as needed. s2Member supports Free Subscribers <em>( at Level #0 )</em>, along with several Primary Roles for paid Membership <em>( i.e. Levels 1-4 )</em>, created by the s2Member plugin.' . ((!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? ' s2Member also supports unlimited Custom Capability Packages <em>( see <code>s2Member -> API Scripting -> Custom Capabilities</code> )</em>' : '') . '. That being said, you don\'t have to use all of the Membership Levels if you don\'t want to. To use only 1 or 2 of these Levels, just create and/or modify your Membership Options Page, so that it only includes payment Buttons for the Levels you wish to use.</p>' . "\n";
|
396 |
+
echo (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? '<p><em><strong>TIP:</strong> <strong>Unlimited Membership Levels</strong> are only possible with <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro</a>. However, Custom Capabilities are possible in all versions of s2Member, including the free version. Custom Capabilities are a great way to extend s2Member in creative ways. If you\'re an advanced site owner, a theme designer, or a web developer integrating s2Member for a client, please check your Dashboard, under: <code>s2Member -> API Scripting -> Custom Capabilities</code>. We also recommend the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.</em></p>' . "\n" : '';
|
397 |
do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_membership_levels", get_defined_vars ());
|
398 |
/**/
|
399 |
echo '<table class="form-table">' . "\n";
|
400 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
/**/
|
402 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
403 |
+
{
|
404 |
+
echo '<tr>' . "\n";
|
405 |
+
/**/
|
406 |
+
echo '<th>' . "\n";
|
407 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-label">' . "\n";
|
408 |
+
echo ($n === 0) ? 'Level #' . $n . ' <em>( Free Subscribers )</em>:' . "\n" : 'Level #' . $n . ' Members:' . "\n";
|
409 |
+
echo '</label>' . "\n";
|
410 |
+
echo '</th>' . "\n";
|
411 |
+
/**/
|
412 |
+
echo '</tr>' . "\n";
|
413 |
+
echo '<tr>' . "\n";
|
414 |
+
/**/
|
415 |
+
echo '<td>' . "\n";
|
416 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_label" id="ws-plugin--s2member-level' . $n . '-label" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"]) . '" /><br />' . "\n";
|
417 |
+
echo 'This is the Label for Level #' . $n . (($n === 0) ? ' ( Free Subscribers )' : ' Members') . '.<br />' . "\n";
|
418 |
+
echo '</td>' . "\n";
|
419 |
+
/**/
|
420 |
+
echo '</tr>' . "\n";
|
421 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
/**/
|
|
|
423 |
echo '</tbody>' . "\n";
|
424 |
echo '</table>' . "\n";
|
425 |
/**/
|
440 |
/**/
|
441 |
echo '<td>' . "\n";
|
442 |
echo '<input type="radio" name="ws_plugin__s2member_apply_label_translations" id="ws-plugin--s2member-apply-label-translations-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["apply_label_translations"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-apply-label-translations-0">No</label> <input type="radio" name="ws_plugin__s2member_apply_label_translations" id="ws-plugin--s2member-apply-label-translations-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["apply_label_translations"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-apply-label-translations-1">Yes, force WordPress® to use my Labels.</label><br />' . "\n";
|
443 |
+
echo 'This particular option affects your administrative Dashboard only <em>( i.e. your list of Users )</em>. s2Member can force WordPress® to use your Labels instead of referencing Roles by `s2Member Level #`. If this is your first installation of s2Member, we suggest leaving this set to <code>no</code> until you\'ve had a chance to get acclimated with s2Member\'s functionality. In fact, many site owners choose to leave this off, because they find it less confusing when Roles are referred to by their s2Member Level #.' . "\n";
|
444 |
echo '</td>' . "\n";
|
445 |
/**/
|
446 |
echo '</tr>' . "\n";
|
763 |
/**/
|
764 |
echo '<td>' . "\n";
|
765 |
echo '<h3 style="margin:0;">Footer Design ( i.e. Bottom )</h3>' . "\n";
|
766 |
+
echo '<p style="margin:0;">This field accepts raw HTML' . ((!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? ' ( and/or PHP )' : '') . ' code.</p>' . "\n";
|
767 |
echo '</td>' . "\n";
|
768 |
/**/
|
769 |
echo '</tr>' . "\n";
|
797 |
{
|
798 |
do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_before_custom_reg_fields", get_defined_vars ());
|
799 |
/**/
|
800 |
+
echo '<div class="ws-menu-page-group" title="Custom Registration Fields/Options">' . "\n";
|
801 |
/**/
|
802 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-reg-fields-section">' . "\n";
|
803 |
echo '<h3>Custom Registration Fields ( optional, for further customization )</h3>' . "\n";
|
854 |
echo '<tr>' . "\n";
|
855 |
/**/
|
856 |
echo '<th>' . "\n";
|
857 |
+
echo '<label for="ws-plugin--s2member-custom-reg-display-name">' . "\n";
|
858 |
+
echo 'Set "Display Name" during Registration?' . "\n";
|
859 |
+
echo '</label>' . "\n";
|
860 |
+
echo '</th>' . "\n";
|
861 |
+
/**/
|
862 |
+
echo '</tr>' . "\n";
|
863 |
+
echo '<tr>' . "\n";
|
864 |
+
/**/
|
865 |
+
echo '<td>' . "\n";
|
866 |
+
echo '<select name="ws_plugin__s2member_custom_reg_display_name" id="ws-plugin--s2member-custom-reg-display-name">' . "\n";
|
867 |
+
echo '<option value="full"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "full") ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s Full Name )</option>' . "\n";
|
868 |
+
echo '<option value="first"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "first") ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s First Name )</option>' . "\n";
|
869 |
+
echo '<option value="last"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "last") ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s Last Name )</option>' . "\n";
|
870 |
+
echo '<option value="login"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"] === "login") ? ' selected="selected"' : '') . '>Yes ( set Display Name to User\'s Username )</option>' . "\n";
|
871 |
+
echo '<option value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_display_name"]) ? ' selected="selected"' : '') . '>No ( leave Display Name at default WordPress® value )</option>' . "\n";
|
872 |
+
echo '</select>' . "\n";
|
873 |
+
echo '</td>' . "\n";
|
874 |
+
/**/
|
875 |
+
echo '</tr>' . "\n";
|
876 |
+
echo '<tr>' . "\n";
|
877 |
+
/**/
|
878 |
+
echo '<th>' . "\n";
|
879 |
echo '<label for="ws-plugin--s2member-custom-reg-password">' . "\n";
|
880 |
echo 'Allow Custom Passwords during Registration?' . "\n";
|
881 |
echo '</label>' . "\n";
|
1073 |
/**/
|
1074 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1075 |
/**/
|
1076 |
+
echo '<p><strong>Shortcode ( copy/paste )</strong>, for an Inline Profile Modification Form:<br />' . "\n";
|
1077 |
+
echo '<p><input type="text" value="' . format_to_edit ('[s2Member-Profile /]') . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
1078 |
/**/
|
1079 |
+
echo '<p style="margin-top:20px;"><strong>Stand-Alone ( copy/paste )</strong>, for popup window:</p>' . "\n";
|
1080 |
+
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
|
1081 |
echo '</div>' . "\n";
|
1082 |
/**/
|
1083 |
echo '</div>' . "\n";
|
includes/menu-pages/info.inc.php
CHANGED
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_info"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® Information</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
includes/menu-pages/integrations.inc.php
CHANGED
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_integrations"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>Other s2Member® Integrations</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
includes/menu-pages/menu-pages-s-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($){var esc_attr=esc_html=function(str){return String(str).replace(/"/g,""").replace(/\</g,"<").replace(/\>/g,">")};if(location.href.match(/page\=ws-plugin--s2member/)){$("input.ws-plugin--s2member-update-roles-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_update_roles_via_ajax",ws_plugin__s2member_update_roles_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-update-roles-via-ajax")); ?>'},function(response){if(response==="0"){alert("Sorry, your request failed.\ns2Member's Roles/Capabilities are locked by Filter:\nws_plugin__s2member_lock_roles_caps"),$this.val("Update Roles/Capabilities")}else{if(response==="1"){alert("s2Member's Roles/Capabilities updated successfully."),$this.val("Update Roles/Capabilities")}}});return false})}if(location.href.match(/page\=ws-plugin--s2member-mms-ops/)){$("select#ws-plugin--s2member-mms-registration-file").change(function(){if($(this).val()==="wp-signup"){$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").show(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").hide(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").show();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[(($("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"show":"hide")](),$("input#ws-plugin--s2member-mms-registration-blogs-level0").val((($("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"1":"0"))}else{if($(this).val()==="wp-login"){$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").hide(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").show(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").hide(),$("input#ws-plugin--s2member-mms-registration-blogs-level0").val("0")}}}).trigger("change");$("select#ws-plugin--s2member-mms-registration-grants").change(function(){$("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}else{if(location.href.match(/page\=ws-plugin--s2member-integrations/)){$("select#ws-plugin--s2member-bbpress-ovg").change(function(){if($(this).val()==="0"){$("span#ws-plugin--s2member-bbpress-ovg-off-note").css("display","inline");var l='form#ws-plugin--s2member-bridge-bbpress-form label[for="ws_plugin--s2member-bridge-bbpress-min-level"]';$(l).text($(l).text().replace(/to (read\/)?participate/i,"to read/participate")),$("select#ws-plugin--s2member-bbpress-min-level option").each(function(){$(this).text($(this).text().replace(/\( to( read and)? participate \)/i,"( to read and participate )"))})}else{if($(this).val()==="1"){$("span#ws-plugin--s2member-bbpress-ovg-off-note").css("display","none");var l='form#ws-plugin--s2member-bridge-bbpress-form label[for="ws_plugin--s2member-bridge-bbpress-min-level"]';$(l).text($(l).text().replace(/to (read\/)?participate/i,"to participate")),$("select#ws-plugin--s2member-bbpress-min-level option").each(function(){$(this).text($(this).text().replace(/\( to( read and)? participate \)/i,"( to participate )"))})}}}).trigger("change")}else{if(location.href.match(/page\=ws-plugin--s2member-gen-ops/)){ws_plugin__s2member_generateSecurityKey=function(){var mt_rand=function(min,max){min=(arguments.length<1)?0:min;max=(arguments.length<2)?2147483647:max;return Math.floor(Math.random()*(max-min+1))+min};var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";for(var i=0,key="";i<64;i++){key+=chars.substr(mt_rand(0,chars.length-1),1)}$("input#ws-plugin--s2member-sec-encryption-key").val(key);return false};ws_plugin__s2member_enableSecurityKey=function(){if(confirm("Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you've been testing s2Member, feel free to change this Key before you go live. Just don't go live, and then change it. You'll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you've used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.")){$("input#ws-plugin--s2member-sec-encryption-key").removeAttr("disabled")}return false};ws_plugin__s2member_securityKeyHistory=function(){$("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false};if($("input#ws-plugin--s2member-custom-reg-fields").length&&$("div#ws-plugin--s2member-custom-reg-field-configuration").length){(function(){var i,fieldDefaults,tools,table,$tools,$table;var $fields=$("input#ws-plugin--s2member-custom-reg-fields");var $configuration=$("div#ws-plugin--s2member-custom-reg-field-configuration");var fields=($fields.val())?$.JSON.parse($fields.val()):[];fields=(fields instanceof Array)?fields:[];fieldDefaults={section:"no",sectitle:"",id:"",label:"",type:"text",deflt:"",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""};for(i=0;i<fields.length;i++){fields[i]=$.extend(true,{},fieldDefaults,fields[i])}tools='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>',table='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>';$configuration.html(tools+table);$tools=$("div#ws-plugin--s2member-custom-reg-field-configuration-tools"),$table=$("table#ws-plugin--s2member-custom-reg-field-configuration-table");ws_plugin__s2member_customRegFieldSectionChange=function(select){var section=$(select).val();var sectitle_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle";(section==="yes")?$(sectitle_trs).css("display",""):$(sectitle_trs).css("display","none")};ws_plugin__s2member_customRegFieldTypeChange=function(select){var type=$(select).val();var deflt_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt",options_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options",expected_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";(type.match(/^(text|textarea)$/))?$(deflt_trs).css("display",""):$(deflt_trs).css("display","none");(type.match(/^(select|selects|checkboxes|radios)$/))?$(options_trs).css("display",""):$(options_trs).css("display","none");(type.match(/^(text|textarea)$/))?$(expected_trs).css("display",""):$(expected_trs).css("display","none")};ws_plugin__s2member_customRegFieldDelete=function(index){var newFields=new Array();for(var i=0;i<fields.length;i++){if(i!==index){newFields.push(fields[i])}}fields=newFields,updateFields(),buildTable()};ws_plugin__s2member_customRegFieldMoveUp=function(index){if(typeof fields[index]==="object"&&typeof fields[index-1]==="object"){var prevFieldObj=fields[index-1],thisFieldObj=fields[index];fields[index-1]=thisFieldObj,fields[index]=prevFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldMoveDown=function(index){if(typeof fields[index]==="object"&&typeof fields[index+1]==="object"){var nextFieldObj=fields[index+1],thisFieldObj=fields[index];fields[index+1]=thisFieldObj,fields[index]=nextFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldCreate=function(){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field))){fields.push(field),updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(fields.length-1);alert('Field created successfully.\n* Remember to "Save All Changes".');$(row).effect("highlight",1500)},500)}};ws_plugin__s2member_customRegFieldUpdate=function(index){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field,index))){fields[index]=field,updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+index;alert('Field updated successfully.\n* Remember to "Save All Changes".');$(row).effect("highlight",1500)},500)}};ws_plugin__s2member_customRegFieldAdd=function(){buildTools(true)};ws_plugin__s2member_customRegFieldEdit=function(index){buildTools(false,index),scrollReset()};ws_plugin__s2member_customRegFieldCancel=function(){buildTools(),scrollReset()};var validateField=function(field,index){var editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,errors=[],options,i;if(typeof field!=="object"||typeof(field=$.extend(true,{},fieldDefaults,field))!=="object"){alert("Invalid field object. Please try again.");return false}field.sectitle=(field.section==="yes")?field.sectitle:"";field.deflt=(field.type.match(/^(text|textarea)$/))?field.deflt:"";field.deflt=(field.type.match(/^(text)$/))?field.deflt.replace(/[\r\n\t ]+/g," "):field.deflt;field.options=(field.type.match(/^(select|selects|checkboxes|radios)$/))?field.options:"";field.expected=(field.type.match(/^(text|textarea)$/))?field.expected:"";if(!field.id){errors.push("Unique Field ID:\nThis is required. Please try again.")}else{if(fieldIdExists(field.id)&&(!editing||field.id!==fields[index].id)){errors.push("Unique Field ID:\nThat Field ID already exists. Please try again.")}}if(!field.label){errors.push("Field Label/Description:\nThis is required. Please try again.")}if(field.type.match(/^(select|selects|checkboxes|radios)$/)&&!field.options){errors.push("Option Configuration File:\nThis is required. Please try again.")}else{if(field.type.match(/^(select|selects|checkboxes|radios)$/)){for(i=0;i<(options=field.options.split(/[\r\n]+/)).length;i++){if(!(options[i]=$.trim(options[i])).match(/^([^\|]*)(\|)([^\|]*)(\|default)?$/)){errors.push("Option Configuration File:\nInvalid configuration at line #"+(i+1)+".");break}}field.options=$.trim(options.join("\n"))}}if(!(field.levels=field.levels.replace(/ /g,""))){errors.push("Applicable Levels:\nThis is required. Please try again.")}else{if(!field.levels.match(/^(all|[0-9,]+)$/)){errors.push("Applicable Levels:\nShould be comma-delimited Levels, or just type: all.\n( examples: 0,1,2,3,4 or type the word: all )")}}if(field.classes&&field.classes.match(/[^a-z 0-9 _ \-]/i)){errors.push("CSS Classes:\nContains invalid characters. Please try again.\n( only: alphanumerics, underscores, hyphens, spaces )")}if(field.styles&&field.styles.match(/["\=\>\<]/)){errors.push('CSS Styles:\nContains invalid characters. Please try again.\n( do NOT use these characters: = " < > )')}if(field.attrs&&field.attrs.match(/[\>\<]/)){errors.push("Other Attributes:\nContains invalid characters. Please try again.\n( do NOT use these characters: < > )")}if(errors.length>0){alert(errors.join("\n\n"));return false}else{return field}};var updateFields=function(){$fields.val(((fields.length>0)?$.JSON.stringify(fields):""))};var fieldId2Var=function(fieldId){return(typeof fieldId==="string")?$.trim(fieldId).toLowerCase().replace(/[^a-z0-9]/g,"_"):""};var fieldTypeDesc=function(type){var types={text:"Text ( single line )",textarea:"Textarea ( multi-line )",select:"Select Menu ( drop-down )",selects:"Select Menu ( multi-option )",checkbox:"Checkbox ( single )",pre_checkbox:"Checkbox ( pre-checked )",checkboxes:"Checkboxes ( multi-option )",radios:"Radio Buttons ( multi-option )"};if(typeof types[type]==="string"){return types[type]}return""};var fieldIdExists=function(fieldId){for(var i=0;i<fields.length;i++){if(fields[i].id===fieldId){return true}}};var scrollReset=function(){scrollTo(0,$("div.ws-plugin--s2member-custom-reg-fields-section").offset()["top"]-100)};var buildTools=function(adding,index){var i=0,html="",form="",w=0,h=0,editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,displayForm=(adding||editing)?true:false,field=(editing)?$.extend(true,{},fieldDefaults,fields[index]):fieldDefaults;html+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>';tb_remove(),$("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove();if(displayForm){form+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">';form+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">';form+="<tbody>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">Starts A New Section?</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<select property="section" onchange="ws_plugin__s2member_customRegFieldSectionChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<option value="no"'+((field.section==="no")?' selected="selected"':"")+'">No ( this Field flows normally )</option>';form+='<option value="yes"'+((field.section==="yes")?' selected="selected"':"")+'">Yes ( this Field begins a new section )</option>';form+="</select><br />";form+="<small>Optional. Allows Fields to be grouped into sections.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+'><td colspan="2"><hr /></td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+">";form+='<td colspan="2">';form+="Title for this new section? ( optional )<br />";form+='<input type="text" property="sectitle" value="'+esc_attr(field.sectitle)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle" /><br />';form+="<small>If empty, a simple divider will be used by default.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-type"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<select property="type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<option value="text"'+((field.type==="text")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("text"))+"</option>";form+='<option value="textarea"'+((field.type==="textarea")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("textarea"))+"</option>";form+='<option value="select"'+((field.type==="select")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("select"))+"</option>";form+='<option value="selects"'+((field.type==="selects")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("selects"))+"</option>";form+='<option value="checkbox"'+((field.type==="checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkbox"))+"</option>";form+='<option value="pre_checkbox"'+((field.type==="pre_checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("pre_checkbox"))+"</option>";form+='<option value="checkboxes"'+((field.type==="checkboxes")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkboxes"))+"</option>";form+='<option value="radios"'+((field.type==="radios")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("radios"))+"</option>";form+="</select><br />";form+="<small>The options below may change, based on the Field Type you choose here.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-label"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<input type="text" property="label" value="'+esc_attr(field.label)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" /><br />';form+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-id"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<input type="text" property="id" value="'+esc_attr(field.id)+'" maxlength="25" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" /><br />';form+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />";form+='<small>e.g. <code>[s2Get user_field="country_code" /]</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-required"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<option value="yes"'+((field.required==="yes")?' selected="selected"':"")+'">Yes ( required )</option>';form+='<option value="no"'+((field.required==="no")?' selected="selected"':"")+'">No ( optional )</option>';form+="</select><br />";form+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';form+="<small>* Administrators are exempt from this requirement.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">Default Text Value: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="deflt" rows="1" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">'+esc_html(field.deflt)+"</textarea><br />";form+="<small>Default value before user input is received.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+'><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * ( one option per line )</label><br />';form+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="options" rows="3" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">'+esc_html(field.options)+"</textarea><br />";form+="Here is a quick example:<br />";form+="<small>You can also specify a <em>default</em> option:</small><br />";form+="<code>US|United States|default</code><br />";form+="<code>CA|Canada</code><br />";form+="<code>VI|Virgin Islands (U.S.)</code>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';form+='<option value=""'+((field.expected==="")?' selected="selected"':"")+'">Anything Goes</option>';form+='<option disabled="disabled"></option>';form+='<optgroup label="Specific Input Types">';form+='<option value="numeric-wp-commas"'+((field.expected==="numeric-wp-commas")?' selected="selected"':"")+'">Numeric ( with or without decimals, commas allowed )</option>';form+='<option value="numeric"'+((field.expected==="numeric")?' selected="selected"':"")+'">Numeric ( with or without decimals, no commas )</option>';form+='<option value="integer"'+((field.expected==="integer")?' selected="selected"':"")+'">Integer ( whole number, without any decimals )</option>';form+='<option value="integer-gt-0"'+((field.expected==="integer-gt-0")?' selected="selected"':"")+'">Integer > 0 ( whole number, no decimals, greater than 0 )</option>';form+='<option value="float"'+((field.expected==="float")?' selected="selected"':"")+'">Float ( floating point number, decimals required )</option>';form+='<option value="float-gt-0"'+((field.expected==="float-gt-0")?' selected="selected"':"")+'">Float > 0 ( floating point number, decimals required, greater than 0 )</option>';form+='<option value="date"'+((field.expected==="date")?' selected="selected"':"")+'">Date ( required date format: dd/mm/yyyy )</option>';form+='<option value="email"'+((field.expected==="email")?' selected="selected"':"")+'">Email ( require valid email )</option>';form+='<option value="url"'+((field.expected==="url")?' selected="selected"':"")+'">Full URL ( starting with http or https )</option>';form+='<option value="domain"'+((field.expected==="domain")?' selected="selected"':"")+'">Domain Name ( domain name only, without http )</option>';form+='<option value="phone"'+((field.expected==="phone")?' selected="selected"':"")+'">Phone # ( 10 digits w/possible hyphens,spaces,brackets )</option>';form+='<option value="uszip"'+((field.expected==="uszip")?' selected="selected"':"")+'">US Zipcode ( 5-9 digits w/possible hyphen )</option>';form+='<option value="cazip"'+((field.expected==="cazip")?' selected="selected"':"")+'">Canadian Zipcode ( 6 alpha-numerics w/possible space )</option>';form+='<option value="uczip"'+((field.expected==="uczip")?' selected="selected"':"")+'">US/Canadian Zipcode ( either a US or Canadian zipcode )</option>';form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Any Character Combination">';for(i=1;i<=25;i++){form+='<option value="any-'+i+'"'+((field.expected==="any-"+i)?' selected="selected"':"")+'">Any Character Combination ( '+i+" character minimum )</option>";form+='<option value="any-'+i+'-e"'+((field.expected==="any-"+i+"-e")?' selected="selected"':"")+'">Any Character Combination ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics, Spaces & Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-punctuation-'+i+'"'+((field.expected==="alphanumerics-spaces-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics, Spaces & Punctuation ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-spaces-punctuation-'+i+'-e"'+((field.expected==="alphanumerics-spaces-punctuation-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics, Spaces & Punctuation ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics & Spaces Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-'+i+'"'+((field.expected==="alphanumerics-spaces-"+i)?' selected="selected"':"")+'">Alphanumerics & Spaces ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-spaces-'+i+'-e"'+((field.expected==="alphanumerics-spaces-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics & Spaces ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics & Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-punctuation-'+i+'"'+((field.expected==="alphanumerics-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics & Punctuation ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-punctuation-'+i+'-e"'+((field.expected==="alphanumerics-punctuation-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics & Punctuation ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-'+i+'"'+((field.expected==="alphanumerics-"+i)?' selected="selected"':"")+'">Alphanumerics ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-'+i+'-e"'+((field.expected==="alphanumerics-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphabetics Only">';for(i=1;i<=25;i++){form+='<option value="alphabetics-'+i+'"'+((field.expected==="alphabetics-"+i)?' selected="selected"':"")+'">Alphabetics ( '+i+" character minimum )</option>";form+='<option value="alphabetics-'+i+'-e"'+((field.expected==="alphabetics-"+i+"-e")?' selected="selected"':"")+'">Alphabetics ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Numeric Digits Only">';for(i=1;i<=25;i++){form+='<option value="numerics-'+i+'"'+((field.expected==="numerics-"+i)?' selected="selected"':"")+'">Numeric Digits ( '+i+" digit minimum )</option>";form+='<option value="numerics-'+i+'-e"'+((field.expected==="numerics-"+i+"-e")?' selected="selected"':"")+'">Numeric Digits ( exactly '+i+" digit"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+="</select><br />";form+="<small>Only Users/Members will be required to meet this criteria.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<input type="text" property="levels" value="'+esc_attr(field.levels)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" /><br />';form+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />";form+="<small>This allows you to enable this field - only at specific Membership Levels.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<option value="yes"'+((field.editable==="yes")?' selected="selected"':"")+'">Yes ( editable )</option>';form+='<option value="no"'+((field.editable==="no")?' selected="selected"':"")+'">No ( uneditable after registration )</option>';form+='<option value="no-invisible"'+((field.editable==="no-invisible")?' selected="selected"':"")+'">No ( uneditable & totally invisible after registration )</option>';form+='<option value="yes-invisible"'+((field.editable==="yes-invisible")?' selected="selected"':"")+'">Yes ( editable after registration / invisible during registration )</option>';form+="</select><br />";form+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<input type="text" property="classes" value="'+esc_attr(field.classes)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" /><br />';form+="<small>Example: <code>my-style-1 my-style-2</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<input type="text" property="styles" value="'+esc_attr(field.styles)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" /><br />';form+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<input type="text" property="attrs" value="'+esc_attr(field.attrs)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" /><br />';form+='<small>Example: <code>onkeyup="" onblur=""</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">';form+='<td align="left">';form+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';form+="</td>";form+='<td align="right">';form+='<input type="button" value="'+((editing)?"Update This Field":"Create Registration Field")+'" onclick="'+((editing)?"ws_plugin__s2member_customRegFieldUpdate("+index+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />';form+="</td>";form+="</tr>";form+="</tbody>";form+="</table>";form+="<div>";$("body").append(form);tb_show(((editing)?"Editing Registration Field":"New Custom Registration Field"),"#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form"),$(window).trigger("resize");$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}$tools.html(html)};var attachTBResizer=function(){$(window).resize(function(){var w,h;w=$(window).width(),h=$(window).height(),w=(w>720)?720:w;$("#TB_ajaxContent").css({width:w-50,height:h-75,margin:0,padding:0})})};var buildTable=function(){var l=fields.length,i=0,html="",eo="o";html+="<tbody>";html+="<tr>";html+="<th>Order</th>";html+="<th>Field Type</th>";html+="<th>Unique ID</th>";html+="<th>Required</th>";html+="<th>Levels</th>";html+="<th>- Tools -</th>";html+="</tr>";if(fields.length>0){for(i=0;i<fields.length;i++){html+='<tr class="'+esc_attr((eo=(eo==="o")?"e":"o"))+((fields[i].section==="yes")?" s":"")+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+i+'">';html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+i+'); return false;"></a></td>';html+='<td nowrap="nowrap">'+esc_html(fieldTypeDesc(fields[i].type))+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].id)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].required)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].levels)+"</td>";html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+i+'); return false;"></a></td>';html+="</tr>"}}else{html+="<tr>";html+='<td colspan="6">No Custom Fields are configured.</td>';html+="</tr>"}html+="</tbody>";$table.html(html)};buildTools(),attachTBResizer(),buildTable()})()}}else{if(location.href.match(/page\=ws-plugin--s2member-res-ops/)){$("input#ws-plugin--s2member-brute-force-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's Brute Force Restriction Logs have all been reset."),$this.val("Reset Brute Force Logs")});return false});$("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's IP Restriction Logs have all been reset."),$this.val("Reset IP Restriction Logs")});return false})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){$("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var $this=$(this),val=$this.val();var $viaCron=$("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(val==2){$viaCron.show()}else{$viaCron.hide()}})}else{if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){$("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var $this=$(this),val=$this.val();var $rows=$("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var $prevImg=$("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(val<=0){$rows.css("display","none"),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(val==1){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(val==2){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}});$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').change(function(){var thisChange=$(this).val(),checkedIndexes=[];$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="removal-deletion"&&this.checked){$this.nextAll(checkboxes).slice(0,2).attr({checked:"checked",disabled:"disabled"})}else{if(val==="removal-deletion"&&!this.checked){$this.nextAll(checkboxes).slice(0,2).removeAttr("disabled");(thisChange==="removal-deletion")?$this.nextAll(checkboxes).slice(0,2).removeAttr("checked"):null}else{if(val==="modification"&&this.checked){$this.nextAll(checkboxes).slice(0,3).attr({checked:"checked",disabled:"disabled"})}else{if(val==="modification"&&!this.checked){(thisChange==="modification")?$this.nextAll(checkboxes).slice(0,3).removeAttr("checked"):null;$this.nextAll(checkboxes).slice(0,3).removeAttr("disabled")}}}}}).each(function(index){(this.checked)?checkedIndexes.push(index):null});$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").removeAttr("disabled");if($.inArray(3,checkedIndexes)===-1&&$.inArray(4,checkedIndexes)===-1&&$.inArray(5,checkedIndexes)===-1&&$.inArray(6,checkedIndexes)===-1){$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").attr("disabled","disabled")}}).last().trigger("change")}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){$("select#ws-plugin--s2member-level1-term, select#ws-plugin--s2member-level2-term, select#ws-plugin--s2member-level3-term, select#ws-plugin--s2member-level4-term, select#ws-plugin--s2member-modification-term").change(function(){var button=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var trialDisabled=($(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;$("p#ws-plugin--s2member-"+button+"-trial-line").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-trial-then").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-20p-rule").css("display",(trialDisabled?"none":""));(trialDisabled)?$("input#ws-plugin--s2member-"+form+"-trial-period").val(0):null;(trialDisabled)?$("input#ws-plugin--s2member-"+form+"-trial-amount").val("0.00"):null});$("input#ws-plugin--s2member-level1-ccaps, input#ws-plugin--s2member-level2-ccaps, input#ws-plugin--s2member-level3-ccaps, input#ws-plugin--s2member-level4-ccaps, input#ws-plugin--s2member-modification-ccaps").keyup(function(){var value=this.value.replace(/^\+/,""),plus=(this.value.match(/^\+/))?"+":"";if(value.match(/[^a-z_0-9,]/)){this.value=plus+$.trim($.trim(value).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(button){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="",labels={};eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_sq($labels); ?>");var shortCode=$("input#ws-plugin--s2member-"+button+"-shortcode");var code=$("textarea#ws-plugin--s2member-"+button+"-button");var modLevel=$("select#ws-plugin--s2member-modification-level");var level=(button==="modification")?modLevel.val().split(":",2)[1]:button.replace(/^level/,"");var label=labels["level"+level].replace(/"/g,"");var desc=$.trim($("input#ws-plugin--s2member-"+button+"-desc").val().replace(/"/g,""));var trialAmount=$("input#ws-plugin--s2member-"+button+"-trial-amount").val().replace(/[^0-9\.]/g,"");var trialPeriod=$("input#ws-plugin--s2member-"+button+"-trial-period").val().replace(/[^0-9]/g,"");var trialTerm=$("select#ws-plugin--s2member-"+button+"-trial-term").val().replace(/[^A-Z]/g,"");var regAmount=$("input#ws-plugin--s2member-"+button+"-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var regRecurTimes="",regRecurRetry="1";var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-"+button+"-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-"+button+"-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).match(/^\+/))?"+"+cCaps.toLowerCase():cCaps.toLowerCase();trialPeriod=(regRecur==="BN")?"0":trialPeriod;trialAmount=(!trialAmount||isNaN(trialAmount)||trialAmount<0.01||trialPeriod<=0)?"0":trialAmount;var levelCcapsPer=(regRecur==="BN"&®Term!=="L")?level+":"+cCaps+":"+regPeriod+" "+regTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(trialAmount!=="0"&&(isNaN(trialAmount)||trialAmount<0)){alert("— Oops, a slight problem: —\n\nWhen provided, Trial Amount must be >= 0.00");return false}else{if(trialAmount!=="0"&&trialAmount>10000){alert("— Oops, a slight problem: —\n\nMaximum Trial Amount is: 10000.00");return false}else{if(trialTerm==="D"&&trialPeriod>7){alert("— Oops, a slight problem: —\n\nMaximum Trial Days is: 7.\nIf you want to offer more than 7 days, please choose Weeks or Months from the drop-down.");return false}else{if(trialTerm==="W"&&trialPeriod>52){alert("— Oops, a slight problem: —\n\nMaximum Trial Weeks is: 52.\nIf you want to offer more than 52 weeks, please choose Months from the drop-down.");return false}else{if(trialTerm==="M"&&trialPeriod>12){alert("— Oops, a slight problem: —\n\nMaximum Trial Months is: 12.\nIf you want to offer more than 12 months, please choose Years from the drop-down.");return false}else{if(trialTerm==="Y"&&trialPeriod>1){alert("— Oops, a slight problem: —\n\nMax Trial Period Years is: 1.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}}}}}}code.html(code.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(trialPeriod)<=0)?code.html(code.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="(src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;shortCodeTemplateAttrs+=(button==="modification")?'modify="1" ':"";shortCodeTemplateAttrs+='level="'+esc_attr(level)+'" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';shortCodeTemplateAttrs+=' ta="'+esc_attr(trialAmount)+'" tp="'+esc_attr(trialPeriod)+'" tt="'+esc_attr(trialTerm)+'" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'" rrt="'+esc_attr(regRecurTimes)+'" rra="'+esc_attr(regRecurRetry)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((button==="modification")?"1":"0")+'"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+esc_attr(regRecur)+'"'));code.html(code.val().replace(/ name\="srt" value\="(.*?)"/,' name="srt" value="'+esc_attr(regRecurTimes)+'"'));code.html(code.val().replace(/ name\="sra" value\="(.*?)"/,' name="sra" value="'+esc_attr(regRecurRetry)+'"'));code.html(code.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+esc_attr(trialAmount)+'"'));code.html(code.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+esc_attr(trialPeriod)+'"'));code.html(code.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+esc_attr(trialTerm)+'"'));code.html(code.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+esc_attr(regPeriod)+'"'));code.html(code.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+esc_attr(regTerm)+'"'));$("div#ws-plugin--s2member-"+button+"-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));(button==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-sp-shortcode");var code=$("textarea#ws-plugin--s2member-sp-button");var leading=$("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var regAmount=$("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var desc=$.trim($("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!leading){alert("— Oops, a slight problem: —\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}var spIdsHours="sp:"+ids+":"+hours;shortCodeTemplateAttrs+='sp="1" ids="'+esc_attr(ids)+'" exp="'+esc_attr(hours)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(spIdsHours)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-sp-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalRegLinkGenerate=function(){var level=$("select#ws-plugin--s2member-reg-link-level").val().replace(/[^0-9]/g,"");var subscrID=$.trim($("input#ws-plugin--s2member-reg-link-subscr-id").val());var custom=$.trim($("input#ws-plugin--s2member-reg-link-custom").val());var cCaps=$.trim($.trim($("input#ws-plugin--s2member-reg-link-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());var fixedTerm=$.trim($("input#ws-plugin--s2member-reg-link-fixed-term").val().replace(/[^A-Z 0-9]/gi,"").toUpperCase());var $link=$("p#ws-plugin--s2member-reg-link"),$loading=$("img#ws-plugin--s2member-reg-link-loading");var levelCcapsPer=(fixedTerm&&!fixedTerm.match(/L$/))?level+":"+cCaps+":"+fixedTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(!subscrID){alert("— Oops, a slight problem: —\n\nPaid Subscr. ID is a required value.");return false}else{if(!custom||custom.indexOf('<?php echo c_ws_plugin__s2member_utils_strings::esc_sq ($_SERVER["HTTP_HOST"]); ?>')!==0){alert("— Oops, a slight problem: —\n\nThe Custom Value MUST start with your domain name.");return false}else{if(fixedTerm&&!fixedTerm.match(/^[1-9]+ (D|W|M|Y|L)$/)){alert("— Oops, a slight problem: —\n\nThe Fixed Term Length is not formatted properly.");return false}}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_reg_access_link_via_ajax",ws_plugin__s2member_reg_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-reg-access-link-via-ajax")); ?>',s2member_reg_access_link_subscr_gateway:"paypal",s2member_reg_access_link_subscr_id:subscrID,s2member_reg_access_link_custom:custom,s2member_reg_access_link_item_number:levelCcapsPer},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var leading=$("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var $link=$("p#ws-plugin--s2member-sp-link"),$loading=$("img#ws-plugin--s2member-sp-link-loading");if(!leading){alert("— Oops, a slight problem: —\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.");return false}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:ids,s2member_sp_access_link_hours:hours},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false}}}}}}}}});
|
1 |
+
jQuery(document).ready(function($){var esc_attr=esc_html=function(str){return String(str).replace(/"/g,""").replace(/\</g,"<").replace(/\>/g,">")};if(location.href.match(/page\=ws-plugin--s2member/)){$("input.ws-plugin--s2member-update-roles-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_update_roles_via_ajax",ws_plugin__s2member_update_roles_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-update-roles-via-ajax")); ?>'},function(response){if(response==="0"){alert("Sorry, your request failed.\ns2Member's Roles/Capabilities are locked by Filter:\nws_plugin__s2member_lock_roles_caps"),$this.val("Update Roles/Capabilities")}else{if(response==="1"){alert("s2Member's Roles/Capabilities updated successfully."),$this.val("Update Roles/Capabilities")}}});return false})}if(location.href.match(/page\=ws-plugin--s2member-mms-ops/)){$("select#ws-plugin--s2member-mms-registration-file").change(function(){if($(this).val()==="wp-signup"){$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").show(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").hide(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").show();$("div.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0, table.ws-plugin--s2member-mms-registration-wp-signup-blogs-level0")[(($("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"show":"hide")](),$("input#ws-plugin--s2member-mms-registration-blogs-level0").val((($("select#ws-plugin--s2member-mms-registration-grants").val()==="all")?"1":"0"))}else{if($(this).val()==="wp-login"){$("div#ws-plugin--s2member-mms-registration-support-package-details-wrapper").hide(),$("div.ws-plugin--s2member-mms-registration-wp-login, table.ws-plugin--s2member-mms-registration-wp-login").show(),$("div.ws-plugin--s2member-mms-registration-wp-signup, table.ws-plugin--s2member-mms-registration-wp-signup").hide(),$("input#ws-plugin--s2member-mms-registration-blogs-level0").val("0")}}}).trigger("change");$("select#ws-plugin--s2member-mms-registration-grants").change(function(){$("select#ws-plugin--s2member-mms-registration-file").trigger("change")})}else{if(location.href.match(/page\=ws-plugin--s2member-integrations/)){$("select#ws-plugin--s2member-bbpress-ovg").change(function(){if($(this).val()==="0"){$("span#ws-plugin--s2member-bbpress-ovg-off-note").css("display","inline");var l='form#ws-plugin--s2member-bridge-bbpress-form label[for="ws_plugin--s2member-bridge-bbpress-min-level"]';$(l).text($(l).text().replace(/to (read\/)?participate/i,"to read/participate")),$("select#ws-plugin--s2member-bbpress-min-level option").each(function(){$(this).text($(this).text().replace(/\( to( read and)? participate \)/i,"( to read and participate )"))})}else{if($(this).val()==="1"){$("span#ws-plugin--s2member-bbpress-ovg-off-note").css("display","none");var l='form#ws-plugin--s2member-bridge-bbpress-form label[for="ws_plugin--s2member-bridge-bbpress-min-level"]';$(l).text($(l).text().replace(/to (read\/)?participate/i,"to participate")),$("select#ws-plugin--s2member-bbpress-min-level option").each(function(){$(this).text($(this).text().replace(/\( to( read and)? participate \)/i,"( to participate )"))})}}}).trigger("change")}else{if(location.href.match(/page\=ws-plugin--s2member-gen-ops/)){ws_plugin__s2member_generateSecurityKey=function(){var mt_rand=function(min,max){min=(arguments.length<1)?0:min;max=(arguments.length<2)?2147483647:max;return Math.floor(Math.random()*(max-min+1))+min};var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";for(var i=0,key="";i<64;i++){key+=chars.substr(mt_rand(0,chars.length-1),1)}$("input#ws-plugin--s2member-sec-encryption-key").val(key);return false};ws_plugin__s2member_enableSecurityKey=function(){if(confirm("Edit Key? Are you sure?\nThis could break your installation!\n\n*Note* If you've been testing s2Member, feel free to change this Key before you go live. Just don't go live, and then change it. You'll have some very unhappy Customers. Data corruption WILL occur!\n\nFor your safety, s2Member keeps a history of the last 10 Keys that you've used. If you get yourself into a real situation, s2Member will let you revert back to a previous Key.")){$("input#ws-plugin--s2member-sec-encryption-key").removeAttr("disabled")}return false};ws_plugin__s2member_securityKeyHistory=function(){$("div#ws-plugin--s2member-sec-encryption-key-history").toggle();return false};if($("input#ws-plugin--s2member-custom-reg-fields").length&&$("div#ws-plugin--s2member-custom-reg-field-configuration").length){(function(){var i,fieldDefaults,tools,table,$tools,$table;var $fields=$("input#ws-plugin--s2member-custom-reg-fields");var $configuration=$("div#ws-plugin--s2member-custom-reg-field-configuration");var fields=($fields.val())?$.JSON.parse($fields.val()):[];fields=(fields instanceof Array)?fields:[];fieldDefaults={section:"no",sectitle:"",id:"",label:"",type:"text",deflt:"",options:"",expected:"",required:"yes",levels:"all",editable:"yes",classes:"",styles:"",attrs:""};for(i=0;i<fields.length;i++){fields[i]=$.extend(true,{},fieldDefaults,fields[i])}tools='<div id="ws-plugin--s2member-custom-reg-field-configuration-tools"></div>',table='<table id="ws-plugin--s2member-custom-reg-field-configuration-table"></table>';$configuration.html(tools+table);$tools=$("div#ws-plugin--s2member-custom-reg-field-configuration-tools"),$table=$("table#ws-plugin--s2member-custom-reg-field-configuration-table");ws_plugin__s2member_customRegFieldSectionChange=function(select){var section=$(select).val();var sectitle_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle";(section==="yes")?$(sectitle_trs).css("display",""):$(sectitle_trs).css("display","none")};ws_plugin__s2member_customRegFieldTypeChange=function(select){var type=$(select).val();var deflt_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt",options_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-options",expected_trs="tr.ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected";(type.match(/^(text|textarea)$/))?$(deflt_trs).css("display",""):$(deflt_trs).css("display","none");(type.match(/^(select|selects|checkboxes|radios)$/))?$(options_trs).css("display",""):$(options_trs).css("display","none");(type.match(/^(text|textarea)$/))?$(expected_trs).css("display",""):$(expected_trs).css("display","none")};ws_plugin__s2member_customRegFieldDelete=function(index){var newFields=new Array();for(var i=0;i<fields.length;i++){if(i!==index){newFields.push(fields[i])}}fields=newFields,updateFields(),buildTable()};ws_plugin__s2member_customRegFieldMoveUp=function(index){if(typeof fields[index]==="object"&&typeof fields[index-1]==="object"){var prevFieldObj=fields[index-1],thisFieldObj=fields[index];fields[index-1]=thisFieldObj,fields[index]=prevFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldMoveDown=function(index){if(typeof fields[index]==="object"&&typeof fields[index+1]==="object"){var nextFieldObj=fields[index+1],thisFieldObj=fields[index];fields[index+1]=thisFieldObj,fields[index]=nextFieldObj;updateFields(),buildTable()}};ws_plugin__s2member_customRegFieldCreate=function(){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field))){fields.push(field),updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+(fields.length-1);alert('Field created successfully.\n* Remember to "Save All Changes".');$(row).effect("highlight",1500)},500)}};ws_plugin__s2member_customRegFieldUpdate=function(index){var $table=$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form"),field={};$(":input[property]",$table).each(function(){var $this=$(this),property=$this.attr("property"),val=$.trim($this.val());field[property]=val});if((field=validateField(field,index))){fields[index]=field,updateFields(),buildTools(),buildTable(),scrollReset();setTimeout(function(){var row="tr.ws-plugin--s2member-custom-reg-field-configuration-table-row-"+index;alert('Field updated successfully.\n* Remember to "Save All Changes".');$(row).effect("highlight",1500)},500)}};ws_plugin__s2member_customRegFieldAdd=function(){buildTools(true)};ws_plugin__s2member_customRegFieldEdit=function(index){buildTools(false,index),scrollReset()};ws_plugin__s2member_customRegFieldCancel=function(){buildTools(),scrollReset()};var validateField=function(field,index){var editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,errors=[],options,i;if(typeof field!=="object"||typeof(field=$.extend(true,{},fieldDefaults,field))!=="object"){alert("Invalid field object. Please try again.");return false}field.sectitle=(field.section==="yes")?field.sectitle:"";field.deflt=(field.type.match(/^(text|textarea)$/))?field.deflt:"";field.deflt=(field.type.match(/^(text)$/))?field.deflt.replace(/[\r\n\t ]+/g," "):field.deflt;field.options=(field.type.match(/^(select|selects|checkboxes|radios)$/))?field.options:"";field.expected=(field.type.match(/^(text|textarea)$/))?field.expected:"";if(!field.id){errors.push("Unique Field ID:\nThis is required. Please try again.")}else{if(fieldIdExists(field.id)&&(!editing||field.id!==fields[index].id)){errors.push("Unique Field ID:\nThat Field ID already exists. Please try again.")}}if(!field.label){errors.push("Field Label/Description:\nThis is required. Please try again.")}if(field.type.match(/^(select|selects|checkboxes|radios)$/)&&!field.options){errors.push("Option Configuration File:\nThis is required. Please try again.")}else{if(field.type.match(/^(select|selects|checkboxes|radios)$/)){for(i=0;i<(options=field.options.split(/[\r\n]+/)).length;i++){if(!(options[i]=$.trim(options[i])).match(/^([^\|]*)(\|)([^\|]*)(\|default)?$/)){errors.push("Option Configuration File:\nInvalid configuration at line #"+(i+1)+".");break}}field.options=$.trim(options.join("\n"))}}if(!(field.levels=field.levels.replace(/ /g,""))){errors.push("Applicable Levels:\nThis is required. Please try again.")}else{if(!field.levels.match(/^(all|[0-9,]+)$/)){errors.push("Applicable Levels:\nShould be comma-delimited Levels, or just type: all.\n( examples: 0,1,2,3,4 or type the word: all )")}}if(field.classes&&field.classes.match(/[^a-z 0-9 _ \-]/i)){errors.push("CSS Classes:\nContains invalid characters. Please try again.\n( only: alphanumerics, underscores, hyphens, spaces )")}if(field.styles&&field.styles.match(/["\=\>\<]/)){errors.push('CSS Styles:\nContains invalid characters. Please try again.\n( do NOT use these characters: = " < > )')}if(field.attrs&&field.attrs.match(/[\>\<]/)){errors.push("Other Attributes:\nContains invalid characters. Please try again.\n( do NOT use these characters: < > )")}if(errors.length>0){alert(errors.join("\n\n"));return false}else{return field}};var updateFields=function(){$fields.val(((fields.length>0)?$.JSON.stringify(fields):""))};var fieldId2Var=function(fieldId){return(typeof fieldId==="string")?$.trim(fieldId).toLowerCase().replace(/[^a-z0-9]/g,"_"):""};var fieldTypeDesc=function(type){var types={text:"Text ( single line )",textarea:"Textarea ( multi-line )",select:"Select Menu ( drop-down )",selects:"Select Menu ( multi-option )",checkbox:"Checkbox ( single )",pre_checkbox:"Checkbox ( pre-checked )",checkboxes:"Checkboxes ( multi-option )",radios:"Radio Buttons ( multi-option )"};if(typeof types[type]==="string"){return types[type]}return""};var fieldIdExists=function(fieldId){for(var i=0;i<fields.length;i++){if(fields[i].id===fieldId){return true}}};var scrollReset=function(){scrollTo(0,$("div.ws-plugin--s2member-custom-reg-fields-section").offset()["top"]-100)};var buildTools=function(adding,index){var i=0,html="",form="",w=0,h=0,editing=(typeof index==="number"&&typeof fields[index]==="object")?true:false,displayForm=(adding||editing)?true:false,field=(editing)?$.extend(true,{},fieldDefaults,fields[index]):fieldDefaults;html+='<a href="#" onclick="ws_plugin__s2member_customRegFieldAdd(); return false;">Add New Field</a>';tb_remove(),$("div#ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form").remove();if(displayForm){form+='<div id="ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form">';form+='<table id="ws-plugin--s2member-custom-reg-field-configuration-tools-form">';form+="<tbody>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">Starts A New Section?</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<td colspan="2">';form+='<select property="section" onchange="ws_plugin__s2member_customRegFieldSectionChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-section">';form+='<option value="no"'+((field.section==="no")?' selected="selected"':"")+'">No ( this Field flows normally )</option>';form+='<option value="yes"'+((field.section==="yes")?' selected="selected"':"")+'">Yes ( this Field begins a new section )</option>';form+="</select><br />";form+="<small>Optional. Allows Fields to be grouped into sections.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+'><td colspan="2"><hr /></td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle ws-plugin--s2member-custom-reg-field-configuration-tools-form-section"'+((field.section==="yes")?"":' style="display:none;"')+">";form+='<td colspan="2">';form+="Title for this new section? ( optional )<br />";form+='<input type="text" property="sectitle" value="'+esc_attr(field.sectitle)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-sectitle" /><br />';form+="<small>If empty, a simple divider will be used by default.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-type"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">Form Field Type: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<td colspan="2">';form+='<select property="type" onchange="ws_plugin__s2member_customRegFieldTypeChange(this);" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-type">';form+='<option value="text"'+((field.type==="text")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("text"))+"</option>";form+='<option value="textarea"'+((field.type==="textarea")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("textarea"))+"</option>";form+='<option value="select"'+((field.type==="select")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("select"))+"</option>";form+='<option value="selects"'+((field.type==="selects")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("selects"))+"</option>";form+='<option value="checkbox"'+((field.type==="checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkbox"))+"</option>";form+='<option value="pre_checkbox"'+((field.type==="pre_checkbox")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("pre_checkbox"))+"</option>";form+='<option value="checkboxes"'+((field.type==="checkboxes")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("checkboxes"))+"</option>";form+='<option value="radios"'+((field.type==="radios")?' selected="selected"':"")+'">'+esc_html(fieldTypeDesc("radios"))+"</option>";form+="</select><br />";form+="<small>The options below may change, based on the Field Type you choose here.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-label"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">Field Label/Desc: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label">';form+='<td colspan="2">';form+='<input type="text" property="label" value="'+esc_attr(field.label)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-label" /><br />';form+="<small>Examples: <code>Choose Country</code>, <code>Street Address</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-id"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">Unique Field ID: *</label></label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id">';form+='<td colspan="2">';form+='<input type="text" property="id" value="'+esc_attr(field.id)+'" maxlength="25" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-id" /><br />';form+="<small>Examples: <code>country_code</code>, <code>street_address</code></small><br />";form+='<small>e.g. <code>[s2Get user_field="country_code" /]</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-required"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">Field Required: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<td colspan="2">';form+='<select property="required" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-required">';form+='<option value="yes"'+((field.required==="yes")?' selected="selected"':"")+'">Yes ( required )</option>';form+='<option value="no"'+((field.required==="no")?' selected="selected"':"")+'">No ( optional )</option>';form+="</select><br />";form+='<small>If <code>yes</code>, only Users/Members will be "required" to enter this field.</small><br />';form+="<small>* Administrators are exempt from this requirement.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">Default Text Value: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="deflt" rows="1" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-deflt">'+esc_html(field.deflt)+"</textarea><br />";form+="<small>Default value before user input is received.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+'><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">Option Configuration File: * ( one option per line )</label><br />';form+="<small>Use a pipe <code>|</code> delimited format: <code>option value|option label</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options"'+((field.type.match(/^(select|selects|checkboxes|radios)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<textarea property="options" rows="3" wrap="off" spellcheck="false" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-options">'+esc_html(field.options)+"</textarea><br />";form+="Here is a quick example:<br />";form+="<small>You can also specify a <em>default</em> option:</small><br />";form+="<code>US|United States|default</code><br />";form+="<code>CA|Canada</code><br />";form+="<code>VI|Virgin Islands (U.S.)</code>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+'><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">Expected Format: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected"'+((field.type.match(/^(text|textarea)$/))?"":' style="display:none;"')+">";form+='<td colspan="2">';form+='<select property="expected" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-expected">';form+='<option value=""'+((field.expected==="")?' selected="selected"':"")+'">Anything Goes</option>';form+='<option disabled="disabled"></option>';form+='<optgroup label="Specific Input Types">';form+='<option value="numeric-wp-commas"'+((field.expected==="numeric-wp-commas")?' selected="selected"':"")+'">Numeric ( with or without decimals, commas allowed )</option>';form+='<option value="numeric"'+((field.expected==="numeric")?' selected="selected"':"")+'">Numeric ( with or without decimals, no commas )</option>';form+='<option value="integer"'+((field.expected==="integer")?' selected="selected"':"")+'">Integer ( whole number, without any decimals )</option>';form+='<option value="integer-gt-0"'+((field.expected==="integer-gt-0")?' selected="selected"':"")+'">Integer > 0 ( whole number, no decimals, greater than 0 )</option>';form+='<option value="float"'+((field.expected==="float")?' selected="selected"':"")+'">Float ( floating point number, decimals required )</option>';form+='<option value="float-gt-0"'+((field.expected==="float-gt-0")?' selected="selected"':"")+'">Float > 0 ( floating point number, decimals required, greater than 0 )</option>';form+='<option value="date"'+((field.expected==="date")?' selected="selected"':"")+'">Date ( required date format: dd/mm/yyyy )</option>';form+='<option value="email"'+((field.expected==="email")?' selected="selected"':"")+'">Email ( require valid email )</option>';form+='<option value="url"'+((field.expected==="url")?' selected="selected"':"")+'">Full URL ( starting with http or https )</option>';form+='<option value="domain"'+((field.expected==="domain")?' selected="selected"':"")+'">Domain Name ( domain name only, without http )</option>';form+='<option value="phone"'+((field.expected==="phone")?' selected="selected"':"")+'">Phone # ( 10 digits w/possible hyphens,spaces,brackets )</option>';form+='<option value="uszip"'+((field.expected==="uszip")?' selected="selected"':"")+'">US Zipcode ( 5-9 digits w/possible hyphen )</option>';form+='<option value="cazip"'+((field.expected==="cazip")?' selected="selected"':"")+'">Canadian Zipcode ( 6 alpha-numerics w/possible space )</option>';form+='<option value="uczip"'+((field.expected==="uczip")?' selected="selected"':"")+'">US/Canadian Zipcode ( either a US or Canadian zipcode )</option>';form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Any Character Combination">';for(i=1;i<=25;i++){form+='<option value="any-'+i+'"'+((field.expected==="any-"+i)?' selected="selected"':"")+'">Any Character Combination ( '+i+" character minimum )</option>";form+='<option value="any-'+i+'-e"'+((field.expected==="any-"+i+"-e")?' selected="selected"':"")+'">Any Character Combination ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics, Spaces & Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-punctuation-'+i+'"'+((field.expected==="alphanumerics-spaces-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics, Spaces & Punctuation ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-spaces-punctuation-'+i+'-e"'+((field.expected==="alphanumerics-spaces-punctuation-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics, Spaces & Punctuation ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics & Spaces Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-spaces-'+i+'"'+((field.expected==="alphanumerics-spaces-"+i)?' selected="selected"':"")+'">Alphanumerics & Spaces ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-spaces-'+i+'-e"'+((field.expected==="alphanumerics-spaces-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics & Spaces ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics & Punctuation Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-punctuation-'+i+'"'+((field.expected==="alphanumerics-punctuation-"+i)?' selected="selected"':"")+'">Alphanumerics & Punctuation ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-punctuation-'+i+'-e"'+((field.expected==="alphanumerics-punctuation-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics & Punctuation ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphanumerics Only">';for(i=1;i<=25;i++){form+='<option value="alphanumerics-'+i+'"'+((field.expected==="alphanumerics-"+i)?' selected="selected"':"")+'">Alphanumerics ( '+i+" character minimum )</option>";form+='<option value="alphanumerics-'+i+'-e"'+((field.expected==="alphanumerics-"+i+"-e")?' selected="selected"':"")+'">Alphanumerics ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Alphabetics Only">';for(i=1;i<=25;i++){form+='<option value="alphabetics-'+i+'"'+((field.expected==="alphabetics-"+i)?' selected="selected"':"")+'">Alphabetics ( '+i+" character minimum )</option>";form+='<option value="alphabetics-'+i+'-e"'+((field.expected==="alphabetics-"+i+"-e")?' selected="selected"':"")+'">Alphabetics ( exactly '+i+" character"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+='<option disabled="disabled"></option>';form+='<optgroup label="Numeric Digits Only">';for(i=1;i<=25;i++){form+='<option value="numerics-'+i+'"'+((field.expected==="numerics-"+i)?' selected="selected"':"")+'">Numeric Digits ( '+i+" digit minimum )</option>";form+='<option value="numerics-'+i+'-e"'+((field.expected==="numerics-"+i+"-e")?' selected="selected"':"")+'">Numeric Digits ( exactly '+i+" digit"+((i>1)?"s":"")+" )</option>"}form+="</optgroup>";form+="</select><br />";form+="<small>Only Users/Members will be required to meet this criteria.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">Applicable Membership Levels: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels">';form+='<td colspan="2">';form+='<input type="text" property="levels" value="'+esc_attr(field.levels)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-levels" /><br />';form+="<small>Please use comma-delimited Level #'s: <code>0,1,2,3,4</code> or type: <code>all</code>.</small><br />";form+="<small>This allows you to enable this field - only at specific Membership Levels.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">Allow Profile Edits: *</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<td colspan="2">';form+='<select property="editable" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-editable">';form+='<option value="yes"'+((field.editable==="yes")?' selected="selected"':"")+'">Yes ( editable )</option>';form+='<option value="no"'+((field.editable==="no")?' selected="selected"':"")+'">No ( uneditable after registration )</option>';form+='<option value="no-invisible"'+((field.editable==="no-invisible")?' selected="selected"':"")+'">No ( uneditable & totally invisible after registration )</option>';form+='<option value="yes-invisible"'+((field.editable==="yes-invisible")?' selected="selected"':"")+'">Yes ( editable after registration / invisible during registration )</option>';form+="</select><br />";form+="<small>If <code>No</code>, this field will be un-editable after registration.</small><br />";form+="<small>* Administrators are exempt from this.</small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">CSS Classes: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes">';form+='<td colspan="2">';form+='<input type="text" property="classes" value="'+esc_attr(field.classes)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-classes" /><br />';form+="<small>Example: <code>my-style-1 my-style-2</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">CSS Styles: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles">';form+='<td colspan="2">';form+='<input type="text" property="styles" value="'+esc_attr(field.styles)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-styles" /><br />';form+="<small>Example: <code>color:#000000; background:#FFFFFF;</code></small>";form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<label for="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">Other Attributes: ( optional )</label>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs">';form+='<td colspan="2">';form+='<input type="text" property="attrs" value="'+esc_attr(field.attrs)+'" id="ws-plugin--s2member-custom-reg-field-configuration-tools-form-attrs" /><br />';form+='<small>Example: <code>onkeyup="" onblur=""</code></small>';form+="</td>";form+="</tr>";form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-spacer ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons"><td colspan="2"> </td></tr>';form+='<tr class="ws-plugin--s2member-custom-reg-field-configuration-tools-form-buttons">';form+='<td align="left">';form+='<input type="button" value="Cancel" onclick="ws_plugin__s2member_customRegFieldCancel();" />';form+="</td>";form+='<td align="right">';form+='<input type="button" value="'+((editing)?"Update This Field":"Create Registration Field")+'" onclick="'+((editing)?"ws_plugin__s2member_customRegFieldUpdate("+index+");":"ws_plugin__s2member_customRegFieldCreate();")+'" />';form+="</td>";form+="</tr>";form+="</tbody>";form+="</table>";form+="<div>";$("body").append(form);tb_show(((editing)?"Editing Registration Field":"New Custom Registration Field"),"#TB_inline?inlineId=ws-plugin--s2member-custom-reg-field-configuration-thickbox-tools-form"),$(window).trigger("resize");$("table#ws-plugin--s2member-custom-reg-field-configuration-tools-form").show()}$tools.html(html)};var attachTBResizer=function(){$(window).resize(function(){var w,h;w=$(window).width(),h=$(window).height(),w=(w>720)?720:w;$("#TB_ajaxContent").css({width:w-50,height:h-75,margin:0,padding:0})})};var buildTable=function(){var l=fields.length,i=0,html="",eo="o";html+="<tbody>";html+="<tr>";html+="<th>Order</th>";html+="<th>Field Type</th>";html+="<th>Unique ID</th>";html+="<th>Required</th>";html+="<th>Levels</th>";html+="<th>- Tools -</th>";html+="</tr>";if(fields.length>0){for(i=0;i<fields.length;i++){html+='<tr class="'+esc_attr((eo=(eo==="o")?"e":"o"))+((fields[i].section==="yes")?" s":"")+" ws-plugin--s2member-custom-reg-field-configuration-table-row-"+i+'">';html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-move-up" href="#" onclick="ws_plugin__s2member_customRegFieldMoveUp('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-move-down" href="#" onclick="ws_plugin__s2member_customRegFieldMoveDown('+i+'); return false;"></a></td>';html+='<td nowrap="nowrap">'+esc_html(fieldTypeDesc(fields[i].type))+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].id)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].required)+"</td>";html+='<td nowrap="nowrap">'+esc_html(fields[i].levels)+"</td>";html+='<td nowrap="nowrap"><a class="ws-plugin--s2member-custom-reg-field-configuration-edit" href="#" onclick="ws_plugin__s2member_customRegFieldEdit('+i+'); return false;"></a><a class="ws-plugin--s2member-custom-reg-field-configuration-delete" href="#" onclick="ws_plugin__s2member_customRegFieldDelete('+i+'); return false;"></a></td>';html+="</tr>"}}else{html+="<tr>";html+='<td colspan="6">No Custom Fields are configured.</td>';html+="</tr>"}html+="</tbody>";$table.html(html)};buildTools(),attachTBResizer(),buildTable()})()}}else{if(location.href.match(/page\=ws-plugin--s2member-res-ops/)){$("input#ws-plugin--s2member-brute-force-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's Brute Force Restriction Logs have all been reset."),$this.val("Reset Brute Force Logs")});return false});$("input#ws-plugin--s2member-ip-restrictions-reset-button").click(function(){var $this=$(this);$this.val("one moment please ...");$.post(ajaxurl,{action:"ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax",ws_plugin__s2member_delete_reset_all_ip_restrictions_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-delete-reset-all-ip-restrictions-via-ajax")); ?>'},function(response){alert("s2Member's IP Restriction Logs have all been reset."),$this.val("Reset IP Restriction Logs")});return false})}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-ops/)){$("select#ws-plugin--s2member-auto-eot-system-enabled").change(function(){var $this=$(this),val=$this.val();var $viaCron=$("p#ws-plugin--s2member-auto-eot-system-enabled-via-cron");if(val==2){$viaCron.show()}else{$viaCron.hide()}})}else{if(location.href.match(/page\=ws-plugin--s2member-els-ops/)){$("select#ws-plugin--s2member-custom-reg-opt-in").change(function(){var $this=$(this),val=$this.val();var $rows=$("tr.ws-plugin--s2member-custom-reg-opt-in-label-row");var $prevImg=$("img.ws-plugin--s2member-custom-reg-opt-in-label-prev-img");if(val<=0){$rows.css("display","none"),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}else{if(val==1){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/unchecked\.png$/,"/checked.png"))}else{if(val==2){$rows.css("display",""),$prevImg.attr("src",$prevImg.attr("src").replace(/\/checked\.png$/,"/unchecked.png"))}}}});$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').change(function(){var thisChange=$(this).val(),checkedIndexes=[];$('div.ws-plugin--s2member-opt-out-section input[type="checkbox"][name="ws_plugin__s2member_custom_reg_auto_opt_outs[]"]').each(function(){var $this=$(this),val=$this.val(),checkboxes='input[type="checkbox"]';if(val==="removal-deletion"&&this.checked){$this.nextAll(checkboxes).slice(0,2).attr({checked:"checked",disabled:"disabled"})}else{if(val==="removal-deletion"&&!this.checked){$this.nextAll(checkboxes).slice(0,2).removeAttr("disabled");(thisChange==="removal-deletion")?$this.nextAll(checkboxes).slice(0,2).removeAttr("checked"):null}else{if(val==="modification"&&this.checked){$this.nextAll(checkboxes).slice(0,3).attr({checked:"checked",disabled:"disabled"})}else{if(val==="modification"&&!this.checked){(thisChange==="modification")?$this.nextAll(checkboxes).slice(0,3).removeAttr("checked"):null;$this.nextAll(checkboxes).slice(0,3).removeAttr("disabled")}}}}}).each(function(index){(this.checked)?checkedIndexes.push(index):null});$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").removeAttr("disabled");if($.inArray(3,checkedIndexes)===-1&&$.inArray(4,checkedIndexes)===-1&&$.inArray(5,checkedIndexes)===-1&&$.inArray(6,checkedIndexes)===-1){$("select#ws-plugin--s2member-custom-reg-auto-opt-out-transitions").attr("disabled","disabled")}}).last().trigger("change")}else{if(location.href.match(/page\=ws-plugin--s2member-paypal-buttons/)){$("div.ws-menu-page select[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-term$/)}).change(function(){var button=this.id.replace(/^ws-plugin--s2member-(.+?)-term$/g,"$1");var trialDisabled=($(this).val().split("-")[2].replace(/[^0-1BN]/g,"")==="BN")?1:0;$("p#ws-plugin--s2member-"+button+"-trial-line").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-trial-then").css("display",(trialDisabled?"none":""));$("span#ws-plugin--s2member-"+button+"-20p-rule").css("display",(trialDisabled?"none":""));(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-period").val(0):null;(trialDisabled)?$("input#ws-plugin--s2member-"+button+"-trial-amount").val("0.00"):null});$("div.ws-menu-page input[id]").filter(function(){return this.id.match(/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-ccaps$/)}).keyup(function(){var value=this.value.replace(/^\+/,""),plus=(this.value.match(/^\+/))?"+":"";if(value.match(/[^a-z_0-9,]/)){this.value=plus+$.trim($.trim(value).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase())}});ws_plugin__s2member_paypalButtonGenerate=function(button){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="",labels={};eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_dq($labels); ?>");var shortCode=$("input#ws-plugin--s2member-"+button+"-shortcode");var code=$("textarea#ws-plugin--s2member-"+button+"-button");var modLevel=$("select#ws-plugin--s2member-modification-level");var level=(button==="modification")?modLevel.val().split(":",2)[1]:button.replace(/^level/,"");var label=labels["level"+level].replace(/"/g,"");var desc=$.trim($("input#ws-plugin--s2member-"+button+"-desc").val().replace(/"/g,""));var trialAmount=$("input#ws-plugin--s2member-"+button+"-trial-amount").val().replace(/[^0-9\.]/g,"");var trialPeriod=$("input#ws-plugin--s2member-"+button+"-trial-period").val().replace(/[^0-9]/g,"");var trialTerm=$("select#ws-plugin--s2member-"+button+"-trial-term").val().replace(/[^A-Z]/g,"");var regAmount=$("input#ws-plugin--s2member-"+button+"-amount").val().replace(/[^0-9\.]/g,"");var regPeriod=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[0].replace(/[^0-9]/g,"");var regTerm=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[1].replace(/[^A-Z]/g,"");var regRecur=$("select#ws-plugin--s2member-"+button+"-term").val().split("-")[2].replace(/[^0-1BN]/g,"");var regRecurTimes="",regRecurRetry="1";var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-"+button+"-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-"+button+"-currency").val().replace(/[^A-Z]/g,"");var cCaps=$.trim($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());cCaps=($.trim($("input#ws-plugin--s2member-"+button+"-ccaps").val()).match(/^\+/))?"+"+cCaps.toLowerCase():cCaps.toLowerCase();trialPeriod=(regRecur==="BN")?"0":trialPeriod;trialAmount=(!trialAmount||isNaN(trialAmount)||trialAmount<0.01||trialPeriod<=0)?"0":trialAmount;var levelCcapsPer=(regRecur==="BN"&®Term!=="L")?level+":"+cCaps+":"+regPeriod+" "+regTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(trialAmount!=="0"&&(isNaN(trialAmount)||trialAmount<0)){alert("— Oops, a slight problem: —\n\nWhen provided, Trial Amount must be >= 0.00");return false}else{if(trialAmount!=="0"&&trialAmount>10000){alert("— Oops, a slight problem: —\n\nMaximum Trial Amount is: 10000.00");return false}else{if(trialTerm==="D"&&trialPeriod>7){alert("— Oops, a slight problem: —\n\nMaximum Trial Days is: 7.\nIf you want to offer more than 7 days, please choose Weeks or Months from the drop-down.");return false}else{if(trialTerm==="W"&&trialPeriod>52){alert("— Oops, a slight problem: —\n\nMaximum Trial Weeks is: 52.\nIf you want to offer more than 52 weeks, please choose Months from the drop-down.");return false}else{if(trialTerm==="M"&&trialPeriod>12){alert("— Oops, a slight problem: —\n\nMaximum Trial Months is: 12.\nIf you want to offer more than 12 months, please choose Years from the drop-down.");return false}else{if(trialTerm==="Y"&&trialPeriod>1){alert("— Oops, a slight problem: —\n\nMax Trial Period Years is: 1.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}}}}}}code.html(code.val().replace(/ \<\!--(\<input type\="hidden" name\="(amount|src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)--\>/g," $1"));(parseInt(trialPeriod)<=0)?code.html(code.val().replace(/ (\<input type\="hidden" name\="(a1|p1|t1)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick$3")):null;(regRecur==="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="(src|srt|sra|a1|p1|t1|a3|p3|t3)" value\="(.*?)" \/\>)/g," <!--$1-->")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="cmd" value\=")(.*?)(" \/\>)/g," $1_xclick-subscriptions$3")):null;(regRecur!=="BN")?code.html(code.val().replace(/ (\<input type\="hidden" name\="amount" value\="(.*?)" \/\>)/g," <!--$1-->")):null;shortCodeTemplateAttrs+=(button==="modification")?'modify="1" ':"";shortCodeTemplateAttrs+='level="'+esc_attr(level)+'" ccaps="'+esc_attr(cCaps)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'" custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"';shortCodeTemplateAttrs+=' ta="'+esc_attr(trialAmount)+'" tp="'+esc_attr(trialPeriod)+'" tt="'+esc_attr(trialTerm)+'" ra="'+esc_attr(regAmount)+'" rp="'+esc_attr(regPeriod)+'" rt="'+esc_attr(regTerm)+'" rr="'+esc_attr(regRecur)+'" rrt="'+esc_attr(regRecurTimes)+'" rra="'+esc_attr(regRecurRetry)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(levelCcapsPer)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="modify" value\="(.*?)"/,' name="modify" value="'+((button==="modification")?"1":"0")+'"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="src" value\="(.*?)"/,' name="src" value="'+esc_attr(regRecur)+'"'));code.html(code.val().replace(/ name\="srt" value\="(.*?)"/,' name="srt" value="'+esc_attr(regRecurTimes)+'"'));code.html(code.val().replace(/ name\="sra" value\="(.*?)"/,' name="sra" value="'+esc_attr(regRecurRetry)+'"'));code.html(code.val().replace(/ name\="a1" value\="(.*?)"/,' name="a1" value="'+esc_attr(trialAmount)+'"'));code.html(code.val().replace(/ name\="p1" value\="(.*?)"/,' name="p1" value="'+esc_attr(trialPeriod)+'"'));code.html(code.val().replace(/ name\="t1" value\="(.*?)"/,' name="t1" value="'+esc_attr(trialTerm)+'"'));code.html(code.val().replace(/ name\="a3" value\="(.*?)"/,' name="a3" value="'+esc_attr(regAmount)+'"'));code.html(code.val().replace(/ name\="p3" value\="(.*?)"/,' name="p3" value="'+esc_attr(regPeriod)+'"'));code.html(code.val().replace(/ name\="t3" value\="(.*?)"/,' name="t3" value="'+esc_attr(regTerm)+'"'));$("div#ws-plugin--s2member-"+button+"-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));(button==="modification")?alert("Your Modification Button has been generated.\nPlease copy/paste the Shortcode Format into your Login Welcome Page, or wherever you feel it would be most appropriate."):alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalSpButtonGenerate=function(){var shortCodeTemplate='[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]',shortCodeTemplateAttrs="";var shortCode=$("input#ws-plugin--s2member-sp-shortcode");var code=$("textarea#ws-plugin--s2member-sp-button");var leading=$("select#ws-plugin--s2member-sp-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-hours").val().replace(/[^0-9]/g,"");var regAmount=$("input#ws-plugin--s2member-sp-amount").val().replace(/[^0-9\.]/g,"");var desc=$.trim($("input#ws-plugin--s2member-sp-desc").val().replace(/"/g,""));var localeCode="",digital="0",noShipping="1";var pageStyle=$.trim($("input#ws-plugin--s2member-sp-page-style").val().replace(/"/g,""));var currencyCode=$("select#ws-plugin--s2member-sp-currency").val().replace(/[^A-Z]/g,"");if(!leading){alert("— Oops, a slight problem: —\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.");return false}else{if(!regAmount||isNaN(regAmount)||regAmount<0.01){alert("— Oops, a slight problem: —\n\nAmount must be >= 0.01");return false}else{if(regAmount>10000){alert("— Oops, a slight problem: —\n\nMaximum Amount is: 10000.00");return false}else{if(!desc){alert("— Oops, a slight problem: —\n\nPlease type a Description for this Button.");return false}}}}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}var spIdsHours="sp:"+ids+":"+hours;shortCodeTemplateAttrs+='sp="1" ids="'+esc_attr(ids)+'" exp="'+esc_attr(hours)+'" desc="'+esc_attr(desc)+'" ps="'+esc_attr(pageStyle)+'" lc="'+esc_attr(localeCode)+'" cc="'+esc_attr(currencyCode)+'" dg="'+esc_attr(digital)+'" ns="'+esc_attr(noShipping)+'"';shortCodeTemplateAttrs+=' custom="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>" ra="'+esc_attr(regAmount)+'"';shortCode.val(shortCodeTemplate.replace(/%%attrs%%/,shortCodeTemplateAttrs));code.html(code.val().replace(/ name\="lc" value\="(.*?)"/,' name="lc" value="'+esc_attr(localeCode)+'"'));code.html(code.val().replace(/ name\="no_shipping" value\="(.*?)"/,' name="no_shipping" value="'+esc_attr(noShipping)+'"'));code.html(code.val().replace(/ name\="item_name" value\="(.*?)"/,' name="item_name" value="'+esc_attr(desc)+'"'));code.html(code.val().replace(/ name\="item_number" value\="(.*?)"/,' name="item_number" value="'+esc_attr(spIdsHours)+'"'));code.html(code.val().replace(/ name\="page_style" value\="(.*?)"/,' name="page_style" value="'+esc_attr(pageStyle)+'"'));code.html(code.val().replace(/ name\="currency_code" value\="(.*?)"/,' name="currency_code" value="'+esc_attr(currencyCode)+'"'));code.html(code.val().replace(/ name\="custom" value\="(.*?)"/,' name="custom" value="<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])); ?>"'));code.html(code.val().replace(/ name\="amount" value\="(.*?)"/,' name="amount" value="'+esc_attr(regAmount)+'"'));$("div#ws-plugin--s2member-sp-button-prev").html(code.val().replace(/\<form/,'<form target="_blank"').replace(/\<\?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_(ON0|OS0|ON1|OS1); \?\>/g,""));alert("Your Button has been generated.\nPlease copy/paste the Shortcode Format into your Membership Options Page.");shortCode.each(function(){this.focus(),this.select()});return false};ws_plugin__s2member_paypalRegLinkGenerate=function(){var level=$("select#ws-plugin--s2member-reg-link-level").val().replace(/[^0-9]/g,"");var subscrID=$.trim($("input#ws-plugin--s2member-reg-link-subscr-id").val());var custom=$.trim($("input#ws-plugin--s2member-reg-link-custom").val());var cCaps=$.trim($.trim($("input#ws-plugin--s2member-reg-link-ccaps").val()).replace(/[ \-]/g,"_").replace(/[^A-Z_0-9,]/gi,"").toLowerCase());var fixedTerm=$.trim($("input#ws-plugin--s2member-reg-link-fixed-term").val().replace(/[^A-Z 0-9]/gi,"").toUpperCase());var $link=$("p#ws-plugin--s2member-reg-link"),$loading=$("img#ws-plugin--s2member-reg-link-loading");var levelCcapsPer=(fixedTerm&&!fixedTerm.match(/L$/))?level+":"+cCaps+":"+fixedTerm:level+":"+cCaps;levelCcapsPer=levelCcapsPer.replace(/\:+$/g,"");if(!subscrID){alert("— Oops, a slight problem: —\n\nPaid Subscr. ID is a required value.");return false}else{if(!custom||custom.indexOf('<?php echo c_ws_plugin__s2member_utils_strings::esc_sq ($_SERVER["HTTP_HOST"]); ?>')!==0){alert("— Oops, a slight problem: —\n\nThe Custom Value MUST start with your domain name.");return false}else{if(fixedTerm&&!fixedTerm.match(/^[1-9]+ (D|W|M|Y|L)$/)){alert("— Oops, a slight problem: —\n\nThe Fixed Term Length is not formatted properly.");return false}}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_reg_access_link_via_ajax",ws_plugin__s2member_reg_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-reg-access-link-via-ajax")); ?>',s2member_reg_access_link_subscr_gateway:"paypal",s2member_reg_access_link_subscr_id:subscrID,s2member_reg_access_link_custom:custom,s2member_reg_access_link_item_number:levelCcapsPer},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false};ws_plugin__s2member_paypalSpLinkGenerate=function(){var leading=$("select#ws-plugin--s2member-sp-link-leading-id").val().replace(/[^0-9]/g,"");var additionals=$("select#ws-plugin--s2member-sp-link-additional-ids").val()||[];var hours=$("select#ws-plugin--s2member-sp-link-hours").val().replace(/[^0-9]/g,"");var $link=$("p#ws-plugin--s2member-sp-link"),$loading=$("img#ws-plugin--s2member-sp-link-loading");if(!leading){alert("— Oops, a slight problem: —\n\nPlease select a Leading Post/Page.\n\n*Tip* If there are no Posts/Pages in the menu, it's because you've not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.");return false}for(var i=0,ids=leading;i<additionals.length;i++){if(additionals[i]&&additionals[i]!==leading){ids+=","+additionals[i]}}$link.hide(),$loading.show(),$.post(ajaxurl,{action:"ws_plugin__s2member_sp_access_link_via_ajax",ws_plugin__s2member_sp_access_link_via_ajax:'<?php echo c_ws_plugin__s2member_utils_strings::esc_sq (wp_create_nonce ("ws-plugin--s2member-sp-access-link-via-ajax")); ?>',s2member_sp_access_link_ids:ids,s2member_sp_access_link_hours:hours},function(response){$link.show().html('<a href="'+esc_attr(response)+'" target="_blank" rel="external">'+esc_html(response)+"</a>"),$loading.hide()});return false}}}}}}}}});
|
includes/menu-pages/menu-pages-s.js
CHANGED
@@ -98,7 +98,7 @@ jQuery(document).ready (function($)
|
|
98 |
{
|
99 |
ws_plugin__s2member_generateSecurityKey = function() /* Generates a unique Security Key. */
|
100 |
{
|
101 |
-
var mt_rand = function(min, max) /* The
|
102 |
{
|
103 |
min = (arguments.length < 1) ? 0 : min;
|
104 |
max = (arguments.length < 2) ? 2147483647 : max;
|
@@ -908,21 +908,26 @@ jQuery(document).ready (function($)
|
|
908 |
/**/
|
909 |
else if (location.href.match (/page\=ws-plugin--s2member-paypal-buttons/))
|
910 |
{
|
911 |
-
$('
|
|
|
|
|
|
|
912 |
{
|
913 |
var button = this.id.replace (/^ws-plugin--s2member-(.+?)-term$/g, '$1');
|
914 |
-
/**/
|
915 |
var trialDisabled = ($(this).val ().split ('-')[2].replace (/[^0-1BN]/g, '') === 'BN') ? 1 : 0;
|
916 |
/**/
|
917 |
$('p#ws-plugin--s2member-' + button + '-trial-line').css ('display', (trialDisabled ? 'none' : ''));
|
918 |
$('span#ws-plugin--s2member-' + button + '-trial-then').css ('display', (trialDisabled ? 'none' : ''));
|
919 |
$('span#ws-plugin--s2member-' + button + '-20p-rule').css ('display', (trialDisabled ? 'none' : ''));
|
920 |
/**/
|
921 |
-
(trialDisabled) ? $('input#ws-plugin--s2member-' +
|
922 |
-
(trialDisabled) ? $('input#ws-plugin--s2member-' +
|
923 |
});
|
924 |
/**/
|
925 |
-
$('
|
|
|
|
|
|
|
926 |
{
|
927 |
var value = this.value.replace (/^\+/, ''), plus = (this.value.match (/^\+/)) ? '+' : '';
|
928 |
if (value.match (/[^a-z_0-9,]/)) /* Only if there is a problem; because this causes interruptions. */
|
@@ -933,7 +938,7 @@ jQuery(document).ready (function($)
|
|
933 |
{
|
934 |
var shortCodeTemplate = '[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]', shortCodeTemplateAttrs = '', labels = {};
|
935 |
/**/
|
936 |
-
eval("<?php echo c_ws_plugin__s2member_utils_strings::
|
937 |
/**/
|
938 |
var shortCode = $('input#ws-plugin--s2member-' + button + '-shortcode');
|
939 |
var code = $('textarea#ws-plugin--s2member-' + button + '-button');
|
98 |
{
|
99 |
ws_plugin__s2member_generateSecurityKey = function() /* Generates a unique Security Key. */
|
100 |
{
|
101 |
+
var mt_rand = function(min, max) /* The JS equivalent to mt_rand(). */
|
102 |
{
|
103 |
min = (arguments.length < 1) ? 0 : min;
|
104 |
max = (arguments.length < 2) ? 2147483647 : max;
|
908 |
/**/
|
909 |
else if (location.href.match (/page\=ws-plugin--s2member-paypal-buttons/))
|
910 |
{
|
911 |
+
$('div.ws-menu-page select[id]').filter (function() /* Filter all select elements with an id. */
|
912 |
+
{
|
913 |
+
return this.id.match (/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-term$/);
|
914 |
+
}).change (function()
|
915 |
{
|
916 |
var button = this.id.replace (/^ws-plugin--s2member-(.+?)-term$/g, '$1');
|
|
|
917 |
var trialDisabled = ($(this).val ().split ('-')[2].replace (/[^0-1BN]/g, '') === 'BN') ? 1 : 0;
|
918 |
/**/
|
919 |
$('p#ws-plugin--s2member-' + button + '-trial-line').css ('display', (trialDisabled ? 'none' : ''));
|
920 |
$('span#ws-plugin--s2member-' + button + '-trial-then').css ('display', (trialDisabled ? 'none' : ''));
|
921 |
$('span#ws-plugin--s2member-' + button + '-20p-rule').css ('display', (trialDisabled ? 'none' : ''));
|
922 |
/**/
|
923 |
+
(trialDisabled) ? $('input#ws-plugin--s2member-' + button + '-trial-period').val (0) : null;
|
924 |
+
(trialDisabled) ? $('input#ws-plugin--s2member-' + button + '-trial-amount').val ('0.00') : null;
|
925 |
});
|
926 |
/**/
|
927 |
+
$('div.ws-menu-page input[id]').filter (function() /* Filter all input elements with an id. */
|
928 |
+
{
|
929 |
+
return this.id.match (/^ws-plugin--s2member-(level[1-9][0-9]*|modification)-ccaps$/);
|
930 |
+
}).keyup (function()
|
931 |
{
|
932 |
var value = this.value.replace (/^\+/, ''), plus = (this.value.match (/^\+/)) ? '+' : '';
|
933 |
if (value.match (/[^a-z_0-9,]/)) /* Only if there is a problem; because this causes interruptions. */
|
938 |
{
|
939 |
var shortCodeTemplate = '[s2Member-PayPal-Button %%attrs%% image="default" output="button" /]', shortCodeTemplateAttrs = '', labels = {};
|
940 |
/**/
|
941 |
+
eval("<?php echo c_ws_plugin__s2member_utils_strings::esc_dq($labels); ?>");
|
942 |
/**/
|
943 |
var shortCode = $('input#ws-plugin--s2member-' + button + '-shortcode');
|
944 |
var code = $('textarea#ws-plugin--s2member-' + button + '-button');
|
includes/menu-pages/menu-pages.css
CHANGED
@@ -20,7 +20,6 @@ These CSS selectors address common layout styles.
|
|
20 |
*/
|
21 |
div.ws-menu-page
|
22 |
{
|
23 |
-
clear: both;
|
24 |
min-width: 800px;
|
25 |
margin-bottom: 20px;
|
26 |
background: url('<?php echo $i; ?>/brand-bg.png') no-repeat top right;
|
@@ -32,21 +31,7 @@ div.ws-menu-page a.ws-dotted-link
|
|
32 |
}
|
33 |
div.ws-menu-page > h2
|
34 |
{
|
35 |
-
|
36 |
-
}
|
37 |
-
div.ws-menu-page > h2 > div
|
38 |
-
{
|
39 |
-
float: right;
|
40 |
-
font-size: 80%;
|
41 |
-
margin: 0 0 0 25px;
|
42 |
-
}
|
43 |
-
div.ws-menu-page > h2 > div > a > img
|
44 |
-
{
|
45 |
-
border: 0px;
|
46 |
-
width: 132px;
|
47 |
-
height: 35px;
|
48 |
-
margin: 0 0 0 10px;
|
49 |
-
vertical-align: middle;
|
50 |
}
|
51 |
div.ws-menu-page .ws-menu-page-right
|
52 |
{
|
@@ -510,7 +495,7 @@ td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header
|
|
510 |
}
|
511 |
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-feed-animator
|
512 |
{
|
513 |
-
margin
|
514 |
}
|
515 |
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header > ins
|
516 |
{
|
20 |
*/
|
21 |
div.ws-menu-page
|
22 |
{
|
|
|
23 |
min-width: 800px;
|
24 |
margin-bottom: 20px;
|
25 |
background: url('<?php echo $i; ?>/brand-bg.png') no-repeat top right;
|
31 |
}
|
32 |
div.ws-menu-page > h2
|
33 |
{
|
34 |
+
margin-bottom: 15px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
div.ws-menu-page .ws-menu-page-right
|
37 |
{
|
495 |
}
|
496 |
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-feed-animator
|
497 |
{
|
498 |
+
margin: 0 0 15px 0;
|
499 |
}
|
500 |
td.ws-menu-page-table-r div.ws-menu-page-mlist div#ws-mlist-div-header > ins
|
501 |
{
|
includes/menu-pages/mms-ops.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_mms_ops"))
|
21 |
{
|
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_mms_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -130,9 +128,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_mms_ops"))
|
|
130 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-mms-registration-section">' . "\n";
|
131 |
echo '<img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
|
132 |
echo '<h3>Multisite Registration ( Main Site Configuration )</h3>' . "\n";
|
133 |
-
echo '<p>s2Member supports Free Subscribers ( at Level #0 )
|
134 |
/**/
|
135 |
-
echo '<p><strong>Running A Multisite Blog Farm?</strong> With Multisite Networking enabled, your Main Site could ALSO offer a Customer access to create a Blog of their own <em>( optional )</em>, where a Customer becomes a "Member" of your Main Site, and also a Blog Owner/Administrator of at least one other Blog on your Network. With s2Member installed ( Network wide )
|
136 |
/**/
|
137 |
echo '<p>Multisite Networking makes a new Registration Form available <em>( driven by your theme )</em>; which we refer to as: <code>/wp-signup.php</code>. If, and only if, you\'re planning to offer Blogs, you MUST use <a href="' . esc_attr (c_ws_plugin__s2member_utils_urls::wp_signup_url ()) . '" target="_blank" rel="external">/wp-signup.php</a>, instead of using the Standard Login/Registration Form. In a Multisite installation, we refer to the Standard Login/Registration Form, as: <code>/wp-login.php?action=register</code>. If you\'re planning to offer Membership Access only, and NOT Blogs, you can simply use the <a href="' . esc_attr (c_ws_plugin__s2member_utils_urls::wp_register_url ()) . '" target="_blank" rel="external">Standard Login/Registration Form</a>, which is easily customized through <code>s2Member -> General Options -> Login/Registration Design</code>, on your Main Site. In either case, s2Member Pro Forms are possible too. If you\'ve purchased s2Member Pro, you could use Pro Forms instead of these WordPress® defaults. That being said, even with s2Member Pro Forms, if you are offering Blogs, you will still need to facilitate the actual creation of each Blog through <code>/wp-signup.php</code>. In other words, Customers can register through s2Member Pro Forms, and even checkout. But when it comes time to setup a new Blog, you will need to redirect your Customer to <code>/wp-signup.php</code>, while they are logged-in. This will allow them to create a new Blog on your Network, based on the configuration options you set below.</p>' . "\n";
|
138 |
do_action ("ws_plugin__s2member_during_mms_ops_page_during_left_sections_during_mms_registration", get_defined_vars ());
|
@@ -260,74 +258,28 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_mms_ops"))
|
|
260 |
/**/
|
261 |
echo '<table class="form-table ws-plugin--s2member-mms-registration-wp-signup" style="margin:0;">' . "\n";
|
262 |
echo '<tbody>' . "\n";
|
263 |
-
echo '<tr>' . "\n";
|
264 |
-
/**/
|
265 |
-
echo '<th style="padding-top:0;">' . "\n";
|
266 |
-
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level1">' . "\n";
|
267 |
-
echo 'Membership Level #1 / Maximum Blogs Allowed:' . "\n";
|
268 |
-
echo '</label>' . "\n";
|
269 |
-
echo '</th>' . "\n";
|
270 |
-
/**/
|
271 |
-
echo '</tr>' . "\n";
|
272 |
-
echo '<tr>' . "\n";
|
273 |
/**/
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
echo '</td>' . "\n";
|
295 |
-
/**/
|
296 |
-
echo '</tr>' . "\n";
|
297 |
-
echo '<tr>' . "\n";
|
298 |
-
/**/
|
299 |
-
echo '<th>' . "\n";
|
300 |
-
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level3">' . "\n";
|
301 |
-
echo 'Membership Level #3 / Maximum Blogs Allowed:' . "\n";
|
302 |
-
echo '</label>' . "\n";
|
303 |
-
echo '</th>' . "\n";
|
304 |
-
/**/
|
305 |
-
echo '</tr>' . "\n";
|
306 |
-
echo '<tr>' . "\n";
|
307 |
-
/**/
|
308 |
-
echo '<td>' . "\n";
|
309 |
-
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level3" id="ws-plugin--s2member-mms-registration-blogs-level3" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level3"]) . '" /><br />' . "\n";
|
310 |
-
echo 'How many blogs can a Member ( at Level #3 ) create?' . "\n";
|
311 |
-
echo '</td>' . "\n";
|
312 |
-
/**/
|
313 |
-
echo '</tr>' . "\n";
|
314 |
-
echo '<tr>' . "\n";
|
315 |
-
/**/
|
316 |
-
echo '<th>' . "\n";
|
317 |
-
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level4">' . "\n";
|
318 |
-
echo 'Membership Level #4 / Maximum Blogs Allowed:' . "\n";
|
319 |
-
echo '</label>' . "\n";
|
320 |
-
echo '</th>' . "\n";
|
321 |
-
/**/
|
322 |
-
echo '</tr>' . "\n";
|
323 |
-
echo '<tr>' . "\n";
|
324 |
-
/**/
|
325 |
-
echo '<td>' . "\n";
|
326 |
-
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level4" id="ws-plugin--s2member-mms-registration-blogs-level4" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level4"]) . '" /><br />' . "\n";
|
327 |
-
echo 'How many blogs can a Member ( at Level #4 ) create?' . "\n";
|
328 |
-
echo '</td>' . "\n";
|
329 |
/**/
|
330 |
-
echo '</tr>' . "\n";
|
331 |
echo '</tbody>' . "\n";
|
332 |
echo '</table>' . "\n";
|
333 |
echo '</div>' . "\n";
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_mms_ops"))
|
21 |
{
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® Multisite ( Configuration )</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
128 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-mms-registration-section">' . "\n";
|
129 |
echo '<img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/large-icon.png" title="s2Member ( a Membership management system for WordPress® )" alt="" style="float:right; margin:0 0 0 25px; border:0;" />' . "\n";
|
130 |
echo '<h3>Multisite Registration ( Main Site Configuration )</h3>' . "\n";
|
131 |
+
echo '<p>s2Member supports Free Subscribers <em>( at Level #0 )</em>, and several Primary Roles created by the s2Member plugin (<em> i.e. s2Member Levels 1-4, or up to the number of configured Levels )</em>. If you want your visitors to be capable of registering absolutely free, you will want to "allow" Open Registration. Whenever a visitor registers without paying, they\'ll automatically become a Free Subscriber, at Level #0.</p>' . "\n";
|
132 |
/**/
|
133 |
+
echo '<p><strong>Running A Multisite Blog Farm?</strong> With Multisite Networking enabled, your Main Site could ALSO offer a Customer access to create a Blog of their own <em>( optional )</em>, where a Customer becomes a "Member" of your Main Site, and also a Blog Owner/Administrator of at least one other Blog on your Network. With s2Member installed <em>( Network wide )</em>, each of your Blog Owners could offer Membership too, using a single copy of the s2Member plugin, which is a great selling point<em>!</em> We refer to this type of installation as a Multisite Blog Farm. If your Network is making it possible for Members to create and/or manage Blogs, s2Member will consider your installation to be a Multisite Blog Farm.</p>' . "\n";
|
134 |
/**/
|
135 |
echo '<p>Multisite Networking makes a new Registration Form available <em>( driven by your theme )</em>; which we refer to as: <code>/wp-signup.php</code>. If, and only if, you\'re planning to offer Blogs, you MUST use <a href="' . esc_attr (c_ws_plugin__s2member_utils_urls::wp_signup_url ()) . '" target="_blank" rel="external">/wp-signup.php</a>, instead of using the Standard Login/Registration Form. In a Multisite installation, we refer to the Standard Login/Registration Form, as: <code>/wp-login.php?action=register</code>. If you\'re planning to offer Membership Access only, and NOT Blogs, you can simply use the <a href="' . esc_attr (c_ws_plugin__s2member_utils_urls::wp_register_url ()) . '" target="_blank" rel="external">Standard Login/Registration Form</a>, which is easily customized through <code>s2Member -> General Options -> Login/Registration Design</code>, on your Main Site. In either case, s2Member Pro Forms are possible too. If you\'ve purchased s2Member Pro, you could use Pro Forms instead of these WordPress® defaults. That being said, even with s2Member Pro Forms, if you are offering Blogs, you will still need to facilitate the actual creation of each Blog through <code>/wp-signup.php</code>. In other words, Customers can register through s2Member Pro Forms, and even checkout. But when it comes time to setup a new Blog, you will need to redirect your Customer to <code>/wp-signup.php</code>, while they are logged-in. This will allow them to create a new Blog on your Network, based on the configuration options you set below.</p>' . "\n";
|
136 |
do_action ("ws_plugin__s2member_during_mms_ops_page_during_left_sections_during_mms_registration", get_defined_vars ());
|
258 |
/**/
|
259 |
echo '<table class="form-table ws-plugin--s2member-mms-registration-wp-signup" style="margin:0;">' . "\n";
|
260 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
/**/
|
262 |
+
for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
263 |
+
{
|
264 |
+
echo '<tr>' . "\n";
|
265 |
+
/**/
|
266 |
+
echo '<th style="padding-top:0;">' . "\n";
|
267 |
+
echo '<label for="ws-plugin--s2member-mms-registration-blogs-level' . $n . '">' . "\n";
|
268 |
+
echo 'Membership Level #' . $n . ' / Maximum Blogs Allowed:' . "\n";
|
269 |
+
echo '</label>' . "\n";
|
270 |
+
echo '</th>' . "\n";
|
271 |
+
/**/
|
272 |
+
echo '</tr>' . "\n";
|
273 |
+
echo '<tr>' . "\n";
|
274 |
+
/**/
|
275 |
+
echo '<td>' . "\n";
|
276 |
+
echo '<input type="text" name="ws_plugin__s2member_mms_registration_blogs_level' . $n . '" id="ws-plugin--s2member-mms-registration-blogs-level' . $n . '" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mms_registration_blogs_level" . $n]) . '" /><br />' . "\n";
|
277 |
+
echo 'How many blogs can a Member ( at Level #' . $n . ' ) create?' . "\n";
|
278 |
+
echo '</td>' . "\n";
|
279 |
+
/**/
|
280 |
+
echo '</tr>' . "\n";
|
281 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
/**/
|
|
|
283 |
echo '</tbody>' . "\n";
|
284 |
echo '</table>' . "\n";
|
285 |
echo '</div>' . "\n";
|
includes/menu-pages/paypal-buttons.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
21 |
{
|
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -43,320 +41,93 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
43 |
/**/
|
44 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_before_left_sections", get_defined_vars ());
|
45 |
/**/
|
46 |
-
|
47 |
{
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Button Code). These special PayPal® Buttons are customized to work with s2Member seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, s2Member will automatically terminate their Membership privileges. s2Member makes extensive use of the PayPal® IPN service. s2Member receives updates from PayPal® behind-the-scene.</p>' . "\n";
|
134 |
-
echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back & re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n";
|
135 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level2_buttons", get_defined_vars ());
|
136 |
-
/**/
|
137 |
-
echo '<table class="form-table">' . "\n";
|
138 |
-
echo '<tbody>' . "\n";
|
139 |
-
echo '<tr>' . "\n";
|
140 |
-
/**/
|
141 |
-
echo '<th class="ws-menu-page-th-side">' . "\n";
|
142 |
-
echo '<label for="ws-plugin--s2member-level2-shortcode">' . "\n";
|
143 |
-
echo 'Button Code<br />For Level #2:<br /><br />' . "\n";
|
144 |
-
echo '<div id="ws-plugin--s2member-level2-button-prev"></div>' . "\n";
|
145 |
-
echo '</label>' . "\n";
|
146 |
-
echo '</th>' . "\n";
|
147 |
-
/**/
|
148 |
-
echo '<td>' . "\n";
|
149 |
-
echo '<form onsubmit="return false;">' . "\n";
|
150 |
-
echo '<p id="ws-plugin--s2member-level2-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level2-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level2-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> @ $<input type="text" id="ws-plugin--s2member-level2-trial-amount" value="0.00" size="4" /></p>' . "\n";
|
151 |
-
echo '<p><span id="ws-plugin--s2member-level2-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level2-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level2-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
152 |
-
echo '<p>Checkout Page Style <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 enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level2-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level2-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level2\');" class="button-primary" /></p>' . "\n";
|
153 |
-
echo '<p>Description: <input type="text" id="ws-plugin--s2member-level2-desc" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n";
|
154 |
-
echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that come with this purchase. Or, you could tell s2Member to (ADD) Custom Capabilities to any that already exist for a particular Member. Just start your list of Custom Capabilities with a (+) sign.\\n\\nSo instead of setting a Member\\\'s full set of Custom Capabilities to:\\nmusic,videos,archives,gifts\\n\\nYou could (ADD) new ones to any that already exist:\\n+calendar,forums,tools\\n\\nOr to prevent any changes, (ADD) nothing:\\n+\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level2-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
155 |
-
echo '</form>' . "\n";
|
156 |
-
echo '</td>' . "\n";
|
157 |
-
/**/
|
158 |
-
echo '</tr>' . "\n";
|
159 |
-
echo '<tr>' . "\n";
|
160 |
-
/**/
|
161 |
-
echo '<td colspan="2">' . "\n";
|
162 |
-
echo '<form onsubmit="return false;">' . "\n";
|
163 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level2_buttons_before_shortcode", get_defined_vars ());
|
164 |
-
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
165 |
-
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
166 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
167 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
168 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
169 |
-
echo '<input id="ws-plugin--s2member-level2-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
170 |
-
/**/
|
171 |
-
echo '<div' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
172 |
-
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
173 |
-
echo '<textarea id="ws-plugin--s2member-level2-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
174 |
-
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
175 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
176 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
177 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("2")), $ws_plugin__s2member_temp_s);
|
178 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"])), $ws_plugin__s2member_temp_s);
|
179 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (home_url ("/"))), $ws_plugin__s2member_temp_s);
|
180 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
|
181 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
|
182 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
183 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
|
184 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ())), $ws_plugin__s2member_temp_s);
|
185 |
-
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
186 |
-
echo '</textarea><br />' . "\n";
|
187 |
-
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.<br />' . "\n";
|
188 |
-
echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
|
189 |
-
echo '</div>' . "\n";
|
190 |
-
/**/
|
191 |
-
echo '</form>' . "\n";
|
192 |
-
echo '</td>' . "\n";
|
193 |
-
/**/
|
194 |
-
echo '</tr>' . "\n";
|
195 |
-
echo '</tbody>' . "\n";
|
196 |
-
echo '</table>' . "\n";
|
197 |
-
echo '</div>' . "\n";
|
198 |
-
/**/
|
199 |
-
echo '</div>' . "\n";
|
200 |
-
/**/
|
201 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_level2_buttons", get_defined_vars ());
|
202 |
-
}
|
203 |
-
/**/
|
204 |
-
if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_level3_buttons", true, get_defined_vars ()))
|
205 |
-
{
|
206 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_before_level3_buttons", get_defined_vars ());
|
207 |
-
/**/
|
208 |
-
echo '<div class="ws-menu-page-group" title="PayPal® Buttons For Level #3 Access">' . "\n";
|
209 |
-
/**/
|
210 |
-
echo '<div class="ws-menu-page-section ws-plugin--s2member-level3-buttons-section">' . "\n";
|
211 |
-
echo '<h3>Button Code Generator For Level #3 Access</h3>' . "\n";
|
212 |
-
echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Button Code). These special PayPal® Buttons are customized to work with s2Member seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, s2Member will automatically terminate their Membership privileges. s2Member makes extensive use of the PayPal® IPN service. s2Member receives updates from PayPal® behind-the-scene.</p>' . "\n";
|
213 |
-
echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back & re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n";
|
214 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level3_buttons", get_defined_vars ());
|
215 |
-
/**/
|
216 |
-
echo '<table class="form-table">' . "\n";
|
217 |
-
echo '<tbody>' . "\n";
|
218 |
-
echo '<tr>' . "\n";
|
219 |
-
/**/
|
220 |
-
echo '<th class="ws-menu-page-th-side">' . "\n";
|
221 |
-
echo '<label for="ws-plugin--s2member-level3-shortcode">' . "\n";
|
222 |
-
echo 'Button Code<br />For Level #3:<br /><br />' . "\n";
|
223 |
-
echo '<div id="ws-plugin--s2member-level3-button-prev"></div>' . "\n";
|
224 |
-
echo '</label>' . "\n";
|
225 |
-
echo '</th>' . "\n";
|
226 |
-
/**/
|
227 |
-
echo '<td>' . "\n";
|
228 |
-
echo '<form onsubmit="return false;">' . "\n";
|
229 |
-
echo '<p id="ws-plugin--s2member-level3-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level3-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level3-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> @ $<input type="text" id="ws-plugin--s2member-level3-trial-amount" value="0.00" size="4" /></p>' . "\n";
|
230 |
-
echo '<p><span id="ws-plugin--s2member-level3-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level3-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level3-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
231 |
-
echo '<p>Checkout Page Style <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 enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level3-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level3-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level3\');" class="button-primary" /></p>' . "\n";
|
232 |
-
echo '<p>Description: <input type="text" id="ws-plugin--s2member-level3-desc" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n";
|
233 |
-
echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that come with this purchase. Or, you could tell s2Member to (ADD) Custom Capabilities to any that already exist for a particular Member. Just start your list of Custom Capabilities with a (+) sign.\\n\\nSo instead of setting a Member\\\'s full set of Custom Capabilities to:\\nmusic,videos,archives,gifts\\n\\nYou could (ADD) new ones to any that already exist:\\n+calendar,forums,tools\\n\\nOr to prevent any changes, (ADD) nothing:\\n+\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level3-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
234 |
-
echo '</form>' . "\n";
|
235 |
-
echo '</td>' . "\n";
|
236 |
-
/**/
|
237 |
-
echo '</tr>' . "\n";
|
238 |
-
echo '<tr>' . "\n";
|
239 |
-
/**/
|
240 |
-
echo '<td colspan="2">' . "\n";
|
241 |
-
echo '<form onsubmit="return false;">' . "\n";
|
242 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level3_buttons_before_shortcode", get_defined_vars ());
|
243 |
-
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
244 |
-
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
245 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
246 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
247 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
248 |
-
echo '<input id="ws-plugin--s2member-level3-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
249 |
-
/**/
|
250 |
-
echo '<div' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
251 |
-
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
252 |
-
echo '<textarea id="ws-plugin--s2member-level3-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
253 |
-
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
254 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
255 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
256 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("3")), $ws_plugin__s2member_temp_s);
|
257 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"])), $ws_plugin__s2member_temp_s);
|
258 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (home_url ("/"))), $ws_plugin__s2member_temp_s);
|
259 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
|
260 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
|
261 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
262 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
|
263 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ())), $ws_plugin__s2member_temp_s);
|
264 |
-
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
265 |
-
echo '</textarea><br />' . "\n";
|
266 |
-
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.<br />' . "\n";
|
267 |
-
echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
|
268 |
-
echo '</div>' . "\n";
|
269 |
-
/**/
|
270 |
-
echo '</form>' . "\n";
|
271 |
-
echo '</td>' . "\n";
|
272 |
-
/**/
|
273 |
-
echo '</tr>' . "\n";
|
274 |
-
echo '</tbody>' . "\n";
|
275 |
-
echo '</table>' . "\n";
|
276 |
-
echo '</div>' . "\n";
|
277 |
-
/**/
|
278 |
-
echo '</div>' . "\n";
|
279 |
-
/**/
|
280 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_level3_buttons", get_defined_vars ());
|
281 |
-
}
|
282 |
-
/**/
|
283 |
-
if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_level4_buttons", true, get_defined_vars ()))
|
284 |
-
{
|
285 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_before_level4_buttons", get_defined_vars ());
|
286 |
-
/**/
|
287 |
-
echo '<div class="ws-menu-page-group" title="PayPal® Buttons For Level #4 Access">' . "\n";
|
288 |
-
/**/
|
289 |
-
echo '<div class="ws-menu-page-section ws-plugin--s2member-level4-buttons-section">' . "\n";
|
290 |
-
echo '<h3>Button Code Generator For Level #4 Access</h3>' . "\n";
|
291 |
-
echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Button Code). These special PayPal® Buttons are customized to work with s2Member seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, s2Member will automatically terminate their Membership privileges. s2Member makes extensive use of the PayPal® IPN service. s2Member receives updates from PayPal® behind-the-scene.</p>' . "\n";
|
292 |
-
echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back & re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n";
|
293 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level4_buttons", get_defined_vars ());
|
294 |
-
/**/
|
295 |
-
echo '<table class="form-table">' . "\n";
|
296 |
-
echo '<tbody>' . "\n";
|
297 |
-
echo '<tr>' . "\n";
|
298 |
-
/**/
|
299 |
-
echo '<th class="ws-menu-page-th-side">' . "\n";
|
300 |
-
echo '<label for="ws-plugin--s2member-level4-shortcode">' . "\n";
|
301 |
-
echo 'Button Code<br />For Level #4:<br /><br />' . "\n";
|
302 |
-
echo '<div id="ws-plugin--s2member-level4-button-prev"></div>' . "\n";
|
303 |
-
echo '</label>' . "\n";
|
304 |
-
echo '</th>' . "\n";
|
305 |
-
/**/
|
306 |
-
echo '<td>' . "\n";
|
307 |
-
echo '<form onsubmit="return false;">' . "\n";
|
308 |
-
echo '<p id="ws-plugin--s2member-level4-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level4-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level4-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> @ $<input type="text" id="ws-plugin--s2member-level4-trial-amount" value="0.00" size="4" /></p>' . "\n";
|
309 |
-
echo '<p><span id="ws-plugin--s2member-level4-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level4-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level4-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
310 |
-
echo '<p>Checkout Page Style <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 enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level4-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level4-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level4\');" class="button-primary" /></p>' . "\n";
|
311 |
-
echo '<p>Description: <input type="text" id="ws-plugin--s2member-level4-desc" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n";
|
312 |
-
echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that come with this purchase. Or, you could tell s2Member to (ADD) Custom Capabilities to any that already exist for a particular Member. Just start your list of Custom Capabilities with a (+) sign.\\n\\nSo instead of setting a Member\\\'s full set of Custom Capabilities to:\\nmusic,videos,archives,gifts\\n\\nYou could (ADD) new ones to any that already exist:\\n+calendar,forums,tools\\n\\nOr to prevent any changes, (ADD) nothing:\\n+\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level4-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
313 |
-
echo '</form>' . "\n";
|
314 |
-
echo '</td>' . "\n";
|
315 |
-
/**/
|
316 |
-
echo '</tr>' . "\n";
|
317 |
-
echo '<tr>' . "\n";
|
318 |
-
/**/
|
319 |
-
echo '<td colspan="2">' . "\n";
|
320 |
-
echo '<form onsubmit="return false;">' . "\n";
|
321 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level4_buttons_before_shortcode", get_defined_vars ());
|
322 |
-
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
323 |
-
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
324 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
325 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
326 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
327 |
-
echo '<input id="ws-plugin--s2member-level4-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
328 |
-
/**/
|
329 |
-
echo '<div' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
330 |
-
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
331 |
-
echo '<textarea id="ws-plugin--s2member-level4-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
332 |
-
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
333 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
334 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
335 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("4")), $ws_plugin__s2member_temp_s);
|
336 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"])), $ws_plugin__s2member_temp_s);
|
337 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (home_url ("/"))), $ws_plugin__s2member_temp_s);
|
338 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
|
339 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
|
340 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
341 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
|
342 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ())), $ws_plugin__s2member_temp_s);
|
343 |
-
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
344 |
-
echo '</textarea><br />' . "\n";
|
345 |
-
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.<br />' . "\n";
|
346 |
-
echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
|
347 |
-
echo '</div>' . "\n";
|
348 |
-
/**/
|
349 |
-
echo '</form>' . "\n";
|
350 |
-
echo '</td>' . "\n";
|
351 |
-
/**/
|
352 |
-
echo '</tr>' . "\n";
|
353 |
-
echo '</tbody>' . "\n";
|
354 |
-
echo '</table>' . "\n";
|
355 |
-
echo '</div>' . "\n";
|
356 |
-
/**/
|
357 |
-
echo '</div>' . "\n";
|
358 |
-
/**/
|
359 |
-
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_level4_buttons", get_defined_vars ());
|
360 |
}
|
361 |
/**/
|
362 |
if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_modification_buttons", true, get_defined_vars ()))
|
@@ -367,9 +138,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
367 |
/**/
|
368 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-modification-buttons-section">' . "\n";
|
369 |
echo '<h3>Button Code Generator For Subscription Modifications</h3>' . "\n";
|
370 |
-
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 here. 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";
|
371 |
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";
|
372 |
-
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 )
|
373 |
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.\'); 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";
|
374 |
echo '<p><em><strong>*Integrating Conditionals*</strong> Since each Modification Button is configured for a specific Level, you may want to create multiple Modification Buttons, one for each combination you intend to make available. s2Member\'s API Conditionals can help you display the proper Button to each Customer, based on the status of their existing account. For further details, see: <code>s2Member -> API Scripting</code>.</em></p>' . "\n";
|
375 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_modification_buttons", get_defined_vars ());
|
@@ -387,7 +158,21 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
387 |
/**/
|
388 |
echo '<td>' . "\n";
|
389 |
echo '<form onsubmit="return false;">' . "\n";
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
echo '<p id="ws-plugin--s2member-modification-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-modification-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> @ $<input type="text" id="ws-plugin--s2member-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
|
392 |
echo '<p><span id="ws-plugin--s2member-modification-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-modification-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select><span id="ws-plugin--s2member-modification-20p-rule"><br /><small>* Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details are <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPRecurringPayments#id086530108PM__id08653060UE6" target="_blank" rel="external">documented here</a>.<br />* <strong>Tip</strong> <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a> are NOT subjected to this ridiculous 20% rule.</small></span></p>' . "\n";
|
393 |
echo '<p>Checkout Page Style <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 enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
|
@@ -404,8 +189,8 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
404 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_modification_buttons_before_shortcode", get_defined_vars ());
|
405 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
406 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
407 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("
|
408 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%% /", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["
|
409 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
410 |
$ws_plugin__s2member_temp_s = preg_replace ("/\/]$/", 'modify="1" /]', $ws_plugin__s2member_temp_s); /* Adds modify="1" to the end of the Shortcode. */
|
411 |
echo '<input id="ws-plugin--s2member-modification-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
@@ -417,8 +202,8 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
417 |
$ws_plugin__s2member_temp_s = preg_replace ('/name\="modify" value\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__s2member_temp_s);
|
418 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
419 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
420 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("
|
421 |
-
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%% /", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["
|
422 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (home_url ("/"))), $ws_plugin__s2member_temp_s);
|
423 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
|
424 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
|
@@ -536,7 +321,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
536 |
/**/
|
537 |
echo '<td>' . "\n";
|
538 |
echo '<form onsubmit="return false;">' . "\n";
|
539 |
-
echo '<p>Paid Membership Level#: <select id="ws-plugin--s2member-reg-link-level"
|
|
|
|
|
|
|
540 |
echo '<p>Paid Subscr. ID: <input id="ws-plugin--s2member-reg-link-subscr-id" type="text" value="" size="50" /> <a href="#" onclick="alert(\'The Customer\\\'s Paid Subscr. ID ( aka: Recurring Profile ID, Transaction ID ) must be unique. This value can be obtained from inside your PayPal® account under the History tab. Each paying Customer MUST be associated with a unique Paid Subscr. ID. If the Customer is NOT associated with a Paid Subscr. ID, you will need to generate a unique value for this field on your own. But keep in mind, s2Member will be unable to maintain future communication with the PayPal® IPN ( i.e. Notification ) service if this value does not reflect a real Paid Subscr. ID that exists in your PayPal® History log.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
541 |
echo '<p>Custom String Value: <input id="ws-plugin--s2member-reg-link-custom" type="text" value="' . esc_attr ($_SERVER["HTTP_HOST"]) . '" size="30" /> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\n' . c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a> <input type="button" value="Generate Access Link" onclick="ws_plugin__s2member_paypalRegLinkGenerate();" class="button-primary" /> <img id="ws-plugin--s2member-reg-link-loading" src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
|
542 |
echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-reg-link-ccaps" size="40" maxlength="125" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" /></p>' . "\n";
|
@@ -583,32 +371,32 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
583 |
/**/
|
584 |
echo '<td>' . "\n";
|
585 |
echo '<form onsubmit="return false;">' . "\n";
|
|
|
586 |
echo '<p><select id="ws-plugin--s2member-sp-leading-id">' . "\n";
|
587 |
echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n";
|
|
|
588 |
$ws_plugin__s2member_temp_a_pp = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) ? (array)get_posts ("post_type=any&include=" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) : array ();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
590 |
-
if ($ws_plugin__s2member_temp_o->ID
|
591 |
-
|
592 |
-
if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
|
593 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
|
594 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
|
595 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
|
596 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
597 |
-
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
598 |
/**/
|
599 |
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
600 |
/**/
|
601 |
echo '<p><select id="ws-plugin--s2member-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
|
602 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
|
|
603 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
604 |
-
if ($ws_plugin__s2member_temp_o->ID
|
605 |
-
|
606 |
-
if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
|
607 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
|
608 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
|
609 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
|
610 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
611 |
-
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
612 |
/**/
|
613 |
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
614 |
/**/
|
@@ -677,31 +465,32 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
677 |
/**/
|
678 |
echo '<td>' . "\n";
|
679 |
echo '<form onsubmit="return false;">' . "\n";
|
|
|
680 |
echo '<p><select id="ws-plugin--s2member-sp-link-leading-id">' . "\n";
|
681 |
echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
683 |
-
if ($ws_plugin__s2member_temp_o->ID
|
684 |
-
|
685 |
-
if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
|
686 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
|
687 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
|
688 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
|
689 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
690 |
-
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
691 |
/**/
|
692 |
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
693 |
/**/
|
694 |
echo '<p><select id="ws-plugin--s2member-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n";
|
695 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
|
|
696 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
697 |
-
if ($ws_plugin__s2member_temp_o->ID
|
698 |
-
|
699 |
-
if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
|
700 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
|
701 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
|
702 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
|
703 |
-
if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
|
704 |
-
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
705 |
/**/
|
706 |
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
707 |
/**/
|
@@ -747,7 +536,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
|
747 |
echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
|
748 |
echo '<li><code>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default PayPal® Button, <code>http://...</code> = location of your custom Image.</li>' . "\n";
|
749 |
echo '<li><code>lc=""</code> Optional 2 character Locale Code <em>( i.e. Country Code )</em>. This controls the interface language used at PayPal® during checkout. If unspecified, the language is determined by PayPal® when possible, defaulting to <code>US</code> <em>english</em> when not possible. Not valid when <code>cancel="1"</code>.</li>' . "\n";
|
750 |
-
echo '<li><code>level="1"</code> Membership Level [1-
|
751 |
echo '<li><code>modify="0"</code> Modification directive. Only valid w/ Membership Level Access. Possible values: <code>0</code> = allows Customers to only create a new Subscription, <code>1</code> = allows Customers to modify their current Subscription or sign up for a new one, <code>2</code> = allows Customers to only modify their current Subscription.</li>' . "\n";
|
752 |
echo '<li><code>ns="1"</code> The <em>no_shipping</em> directive. Possible values: <code>0</code> = prompt for an address, but do not require one, <code>1</code> = do not prompt for a shipping address, <code>2</code> = prompt for an address, and require one. Not valid when <code>cancel="1"</code>.</li>' . "\n";
|
753 |
echo '<li><code>output="button"</code> Output Type. Possible values: <code>button</code> = PayPal® Button w/hidden inputs, <code>anchor</code> = PayPal® Button ( <a> anchor tag ) URL w/ ?query string, <code>url</code> = raw URL w/ ?query string.</li>' . "\n";
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
|
21 |
{
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® / PayPal® Buttons</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
41 |
/**/
|
42 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_before_left_sections", get_defined_vars ());
|
43 |
/**/
|
44 |
+
for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) /* Starting with Level #1 here. */
|
45 |
{
|
46 |
+
if (($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_level" . $n . "_buttons") && apply_filters ($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_levelN_buttons, true, get_defined_vars ()))
|
47 |
+
{
|
48 |
+
if (($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_before_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_before_level" . $n . "_buttons"))
|
49 |
+
do_action ($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_before_levelN_buttons, get_defined_vars ());
|
50 |
+
/**/
|
51 |
+
echo '<div class="ws-menu-page-group" title="PayPal® Buttons For Level #' . $n . ' Access">' . "\n";
|
52 |
+
/**/
|
53 |
+
echo '<div class="ws-menu-page-section ws-plugin--s2member-level' . $n . '-buttons-section">' . "\n";
|
54 |
+
echo '<h3>Button Code Generator For Level #' . $n . ' Access</h3>' . "\n";
|
55 |
+
echo '<p>Very simple. All you do is customize the form fields provided, for each Membership Level that you plan to offer. Then press (Generate Button Code). These special PayPal® Buttons are customized to work with s2Member seamlessly. Member accounts will be activated instantly, in an automated fashion. When you, or a Member, cancels their Membership, or fails to make payments on time, s2Member will automatically terminate their Membership privileges. s2Member makes extensive use of the PayPal® IPN service. s2Member receives updates from PayPal® behind-the-scene.</p>' . "\n";
|
56 |
+
echo '<p><em>* Buttons are NOT saved here. This is only a Button Generator. Once you\'ve generated your Button, copy/paste it into your Membership Options Page. If you lose your Button Code, you\'ll need to come back & re-generate a new one. If you\'re in Sandbox Test-Mode, and you\'re NOT using the Shortcode Format, please remember to come back and re-generate your Buttons before you go live.</em></p>' . "\n";
|
57 |
+
/**/
|
58 |
+
if (($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons"))
|
59 |
+
do_action ($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_levelN_buttons, get_defined_vars ());
|
60 |
+
/**/
|
61 |
+
echo '<table class="form-table">' . "\n";
|
62 |
+
echo '<tbody>' . "\n";
|
63 |
+
echo '<tr>' . "\n";
|
64 |
+
/**/
|
65 |
+
echo '<th class="ws-menu-page-th-side">' . "\n";
|
66 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-shortcode">' . "\n";
|
67 |
+
echo 'Button Code<br />For Level #' . $n . ':<br /><br />' . "\n";
|
68 |
+
echo '<div id="ws-plugin--s2member-level' . $n . '-button-prev"></div>' . "\n";
|
69 |
+
echo '</label>' . "\n";
|
70 |
+
echo '</th>' . "\n";
|
71 |
+
/**/
|
72 |
+
echo '<td>' . "\n";
|
73 |
+
echo '<form onsubmit="return false;">' . "\n";
|
74 |
+
echo '<p id="ws-plugin--s2member-level' . $n . '-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level' . $n . '-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-level' . $n . '-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> @ $<input type="text" id="ws-plugin--s2member-level' . $n . '-trial-amount" value="0.00" size="4" /></p>' . "\n";
|
75 |
+
echo '<p><span id="ws-plugin--s2member-level' . $n . '-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level' . $n . '-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level' . $n . '-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select></p>' . "\n";
|
76 |
+
echo '<p>Checkout Page Style <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 enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-level' . $n . '-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level' . $n . '-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level' . $n . '\');" class="button-primary" /></p>' . "\n";
|
77 |
+
echo '<p>Description: <input type="text" id="ws-plugin--s2member-level' . $n . '-desc" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"]) . ' / description and pricing details here." size="73" /></p>' . "\n";
|
78 |
+
echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that come with this purchase. Or, you could tell s2Member to (ADD) Custom Capabilities to any that already exist for a particular Member. Just start your list of Custom Capabilities with a (+) sign.\\n\\nSo instead of setting a Member\\\'s full set of Custom Capabilities to:\\nmusic,videos,archives,gifts\\n\\nYou could (ADD) new ones to any that already exist:\\n+calendar,forums,tools\\n\\nOr to prevent any changes, (ADD) nothing:\\n+\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-level' . $n . '-ccaps" size="40" maxlength="125" /></p>' . "\n";
|
79 |
+
echo '</form>' . "\n";
|
80 |
+
echo '</td>' . "\n";
|
81 |
+
/**/
|
82 |
+
echo '</tr>' . "\n";
|
83 |
+
echo '<tr>' . "\n";
|
84 |
+
/**/
|
85 |
+
echo '<td colspan="2">' . "\n";
|
86 |
+
echo '<form onsubmit="return false;">' . "\n";
|
87 |
+
/**/
|
88 |
+
if (($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_levelN_buttons_before_shortcode = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_level" . $n . "_buttons_before_shortcode"))
|
89 |
+
do_action ($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_levelN_buttons_before_shortcode, get_defined_vars ());
|
90 |
+
/**/
|
91 |
+
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
92 |
+
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
93 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($n)), $ws_plugin__s2member_temp_s);
|
94 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])), $ws_plugin__s2member_temp_s);
|
95 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
96 |
+
echo '<input id="ws-plugin--s2member-level' . $n . '-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
97 |
+
/**/
|
98 |
+
echo '<div' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '><br />' . "\n";
|
99 |
+
echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
|
100 |
+
echo '<textarea id="ws-plugin--s2member-level' . $n . '-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
|
101 |
+
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/paypal-checkout-button.html"));
|
102 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
103 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
104 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($n)), $ws_plugin__s2member_temp_s);
|
105 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])), $ws_plugin__s2member_temp_s);
|
106 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (home_url ("/"))), $ws_plugin__s2member_temp_s);
|
107 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
|
108 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
|
109 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
110 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $ws_plugin__s2member_temp_s);
|
111 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ())), $ws_plugin__s2member_temp_s);
|
112 |
+
echo format_to_edit ($ws_plugin__s2member_temp_s);
|
113 |
+
echo '</textarea><br />' . "\n";
|
114 |
+
echo '↑ Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.<br />' . "\n";
|
115 |
+
echo '↑ <em>This <span class="ws-menu-page-hilite">may contain PHP code too</span>; so be careful if you use this.</em>' . "\n";
|
116 |
+
echo '</div>' . "\n";
|
117 |
+
/**/
|
118 |
+
echo '</form>' . "\n";
|
119 |
+
echo '</td>' . "\n";
|
120 |
+
/**/
|
121 |
+
echo '</tr>' . "\n";
|
122 |
+
echo '</tbody>' . "\n";
|
123 |
+
echo '</table>' . "\n";
|
124 |
+
echo '</div>' . "\n";
|
125 |
+
/**/
|
126 |
+
echo '</div>' . "\n";
|
127 |
+
/**/
|
128 |
+
if (($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_levelN_buttons = "ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_level" . $n . "_buttons"))
|
129 |
+
do_action ($ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_after_levelN_buttons, get_defined_vars ());
|
130 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
/**/
|
133 |
if (apply_filters ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_display_modification_buttons", true, get_defined_vars ()))
|
138 |
/**/
|
139 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-modification-buttons-section">' . "\n";
|
140 |
echo '<h3>Button Code Generator For Subscription Modifications</h3>' . "\n";
|
141 |
+
echo '<p>If you\'d like to give your Members <em>( and/or your Free Subscribers )</em> 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 here. 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";
|
142 |
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";
|
143 |
+
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 <em>( the ones who wish to upgrade )</em> 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 <em>( and anything already associated with that Username )</em>, rather than being forced to re-register after checkout.</em></p>' . "\n";
|
144 |
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.\'); 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";
|
145 |
echo '<p><em><strong>*Integrating Conditionals*</strong> Since each Modification Button is configured for a specific Level, you may want to create multiple Modification Buttons, one for each combination you intend to make available. s2Member\'s API Conditionals can help you display the proper Button to each Customer, based on the status of their existing account. For further details, see: <code>s2Member -> API Scripting</code>.</em></p>' . "\n";
|
146 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_modification_buttons", get_defined_vars ());
|
158 |
/**/
|
159 |
echo '<td>' . "\n";
|
160 |
echo '<form onsubmit="return false;">' . "\n";
|
161 |
+
/**/
|
162 |
+
echo '<p>Modification: <select id="ws-plugin--s2member-modification-level">' . "\n";
|
163 |
+
/**/
|
164 |
+
for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
165 |
+
{
|
166 |
+
echo '<optgroup label="Level #' . $n . '">' . "\n";
|
167 |
+
echo '<option value="upgrade:' . $n . '">↑ Upgrade To Level #' . $n . '</option>' . "\n";
|
168 |
+
echo ($n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? '<option value="downgrade:' . $n . '">↓ Downgrade To Level #' . $n . '</option>' . "\n" : '';
|
169 |
+
echo '</optgroup>' . "\n";
|
170 |
+
/**/
|
171 |
+
echo ($n < $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? '<option disabled="disabled"></option>' . "\n" : '';
|
172 |
+
}
|
173 |
+
/**/
|
174 |
+
echo '</select></p>' . "\n";
|
175 |
+
/**/
|
176 |
echo '<p id="ws-plugin--s2member-modification-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-modification-trial-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.html") . '</select> @ $<input type="text" id="ws-plugin--s2member-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
|
177 |
echo '<p><span id="ws-plugin--s2member-modification-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-modification-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-modification-term">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.html") . '</select><span id="ws-plugin--s2member-modification-20p-rule"><br /><small>* Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details are <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPRecurringPayments#id086530108PM__id08653060UE6" target="_blank" rel="external">documented here</a>.<br />* <strong>Tip</strong> <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a> are NOT subjected to this ridiculous 20% rule.</small></span></p>' . "\n";
|
178 |
echo '<p>Checkout Page Style <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 enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency">' . file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.html") . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
|
189 |
do_action ("ws_plugin__s2member_during_paypal_buttons_page_during_left_sections_during_modification_buttons_before_shortcode", get_defined_vars ());
|
190 |
echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual & HTML Editors )<br />' . "\n";
|
191 |
$ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/paypal-checkout-button-shortcode.html"));
|
192 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
193 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%% /", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
194 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($_SERVER["HTTP_HOST"])), $ws_plugin__s2member_temp_s);
|
195 |
$ws_plugin__s2member_temp_s = preg_replace ("/\/]$/", 'modify="1" /]', $ws_plugin__s2member_temp_s); /* Adds modify="1" to the end of the Shortcode. */
|
196 |
echo '<input id="ws-plugin--s2member-modification-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" />' . "\n";
|
202 |
$ws_plugin__s2member_temp_s = preg_replace ('/name\="modify" value\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__s2member_temp_s);
|
203 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")), $ws_plugin__s2member_temp_s);
|
204 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $ws_plugin__s2member_temp_s);
|
205 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ("1")), $ws_plugin__s2member_temp_s);
|
206 |
+
$ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%% /", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"])), $ws_plugin__s2member_temp_s);
|
207 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (home_url ("/"))), $ws_plugin__s2member_temp_s);
|
208 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_notify=1"))), $ws_plugin__s2member_temp_s);
|
209 |
$ws_plugin__s2member_temp_s = preg_replace ("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_ds (esc_attr (site_url ("/?s2member_paypal_return=1"))), $ws_plugin__s2member_temp_s);
|
321 |
/**/
|
322 |
echo '<td>' . "\n";
|
323 |
echo '<form onsubmit="return false;">' . "\n";
|
324 |
+
echo '<p>Paid Membership Level#: <select id="ws-plugin--s2member-reg-link-level" style="min-width:200px;">' . "\n";
|
325 |
+
for ($n = 1; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
326 |
+
echo '<option value="' . $n . '">s2Member Level #' . $n . '</option>' . "\n";
|
327 |
+
echo '</select></p>' . "\n";
|
328 |
echo '<p>Paid Subscr. ID: <input id="ws-plugin--s2member-reg-link-subscr-id" type="text" value="" size="50" /> <a href="#" onclick="alert(\'The Customer\\\'s Paid Subscr. ID ( aka: Recurring Profile ID, Transaction ID ) must be unique. This value can be obtained from inside your PayPal® account under the History tab. Each paying Customer MUST be associated with a unique Paid Subscr. ID. If the Customer is NOT associated with a Paid Subscr. ID, you will need to generate a unique value for this field on your own. But keep in mind, s2Member will be unable to maintain future communication with the PayPal® IPN ( i.e. Notification ) service if this value does not reflect a real Paid Subscr. ID that exists in your PayPal® History log.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
329 |
echo '<p>Custom String Value: <input id="ws-plugin--s2member-reg-link-custom" type="text" value="' . esc_attr ($_SERVER["HTTP_HOST"]) . '" size="30" /> <a href="#" onclick="alert(\'A Paid Subscription is always associated with a Custom String that is passed through the custom=\\\'\\\'' . c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])) . '\\\'\\\' attribute of your Shortcode. This Custom Value, MUST always start with your domain name. However, you can also pipe delimit additional values after your domain, if you need to.\\n\\nFor example:\n' . c_ws_plugin__s2member_utils_strings::esc_sq (esc_attr ($_SERVER["HTTP_HOST"])) . '|cv1|cv2|cv3\'); return false;" tabindex="-1">[?]</a> <input type="button" value="Generate Access Link" onclick="ws_plugin__s2member_paypalRegLinkGenerate();" class="button-primary" /> <img id="ws-plugin--s2member-reg-link-loading" src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
|
330 |
echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-reg-link-ccaps" size="40" maxlength="125" onkeyup="if(this.value.match(/[^a-z_0-9,]/)) this.value = jQuery.trim (jQuery.trim (this.value).replace (/[ \-]/g, \'_\').replace (/[^A-Z_0-9,]/gi, \'\').toLowerCase ());" /></p>' . "\n";
|
371 |
/**/
|
372 |
echo '<td>' . "\n";
|
373 |
echo '<form onsubmit="return false;">' . "\n";
|
374 |
+
/**/
|
375 |
echo '<p><select id="ws-plugin--s2member-sp-leading-id">' . "\n";
|
376 |
echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n";
|
377 |
+
/**/
|
378 |
$ws_plugin__s2member_temp_a_pp = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) ? (array)get_posts ("post_type=any&include=" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) : array ();
|
379 |
+
/**/
|
380 |
+
$ws_plugin__s2member_temp_a_pp_excludes = array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
|
381 |
+
/**/
|
382 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
383 |
+
$ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
|
384 |
+
/**/
|
385 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
386 |
+
$ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
|
387 |
+
/**/
|
388 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
389 |
+
if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
|
390 |
+
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
/**/
|
392 |
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
393 |
/**/
|
394 |
echo '<p><select id="ws-plugin--s2member-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
|
395 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
396 |
+
/**/
|
397 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
398 |
+
if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
|
399 |
+
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
/**/
|
401 |
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
402 |
/**/
|
465 |
/**/
|
466 |
echo '<td>' . "\n";
|
467 |
echo '<form onsubmit="return false;">' . "\n";
|
468 |
+
/**/
|
469 |
echo '<p><select id="ws-plugin--s2member-sp-link-leading-id">' . "\n";
|
470 |
echo '<option value="">— Select a Leading Post/Page that you\'ve protected —</option>' . "\n";
|
471 |
+
/**/
|
472 |
+
$ws_plugin__s2member_temp_a_pp = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) ? (array)get_posts ("post_type=any&include=" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) : array ();
|
473 |
+
/**/
|
474 |
+
$ws_plugin__s2member_temp_a_pp_excludes = array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
|
475 |
+
/**/
|
476 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
477 |
+
$ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
|
478 |
+
/**/
|
479 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
480 |
+
$ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
|
481 |
+
/**/
|
482 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
483 |
+
if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
|
484 |
+
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
/**/
|
486 |
echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
487 |
/**/
|
488 |
echo '<p><select id="ws-plugin--s2member-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n";
|
489 |
echo '<optgroup label="— Package Additional Posts/Pages that you\'ve protected —">' . "\n";
|
490 |
+
/**/
|
491 |
foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
|
492 |
+
if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
|
493 |
+
echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
/**/
|
495 |
echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
|
496 |
/**/
|
536 |
echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
|
537 |
echo '<li><code>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default PayPal® Button, <code>http://...</code> = location of your custom Image.</li>' . "\n";
|
538 |
echo '<li><code>lc=""</code> Optional 2 character Locale Code <em>( i.e. Country Code )</em>. This controls the interface language used at PayPal® during checkout. If unspecified, the language is determined by PayPal® when possible, defaulting to <code>US</code> <em>english</em> when not possible. Not valid when <code>cancel="1"</code>.</li>' . "\n";
|
539 |
+
echo '<li><code>level="1"</code> Membership Level [1-4] <em>( or, up to the number of configured Levels )</em>. Only valid for Buttons providing paid Membership Level Access.</li>' . "\n";
|
540 |
echo '<li><code>modify="0"</code> Modification directive. Only valid w/ Membership Level Access. Possible values: <code>0</code> = allows Customers to only create a new Subscription, <code>1</code> = allows Customers to modify their current Subscription or sign up for a new one, <code>2</code> = allows Customers to only modify their current Subscription.</li>' . "\n";
|
541 |
echo '<li><code>ns="1"</code> The <em>no_shipping</em> directive. Possible values: <code>0</code> = prompt for an address, but do not require one, <code>1</code> = do not prompt for a shipping address, <code>2</code> = prompt for an address, and require one. Not valid when <code>cancel="1"</code>.</li>' . "\n";
|
542 |
echo '<li><code>output="button"</code> Output Type. Possible values: <code>button</code> = PayPal® Button w/hidden inputs, <code>anchor</code> = PayPal® Button ( <a> anchor tag ) URL w/ ?query string, <code>url</code> = raw URL w/ ?query string.</li>' . "\n";
|
includes/menu-pages/paypal-ops.inc.php
CHANGED
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® PayPal® Options</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
includes/menu-pages/res-ops.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
21 |
{
|
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -62,91 +60,28 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
|
62 |
/**/
|
63 |
echo '<table class="form-table">' . "\n";
|
64 |
echo '<tbody>' . "\n";
|
65 |
-
echo '<tr>' . "\n";
|
66 |
-
/**/
|
67 |
-
echo '<th>' . "\n";
|
68 |
-
echo '<label for="ws-plugin--s2member-level0-posts">' . "\n";
|
69 |
-
echo 'Posts That Require Level #0 Or Higher:' . "\n";
|
70 |
-
echo '</label>' . "\n";
|
71 |
-
echo '</th>' . "\n";
|
72 |
-
/**/
|
73 |
-
echo '</tr>' . "\n";
|
74 |
-
echo '<tr>' . "\n";
|
75 |
-
/**/
|
76 |
-
echo '<td>' . "\n";
|
77 |
-
echo '<input type="text" name="ws_plugin__s2member_level0_posts" id="ws-plugin--s2member-level0-posts" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_posts"]) . '" /><br />' . "\n";
|
78 |
-
echo 'Post IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
79 |
-
echo '</td>' . "\n";
|
80 |
-
/**/
|
81 |
-
echo '</tr>' . "\n";
|
82 |
-
echo '<tr>' . "\n";
|
83 |
-
/**/
|
84 |
-
echo '<th>' . "\n";
|
85 |
-
echo '<label for="ws-plugin--s2member-level1-posts">' . "\n";
|
86 |
-
echo 'Posts That Require Level #1 Or Higher:' . "\n";
|
87 |
-
echo '</label>' . "\n";
|
88 |
-
echo '</th>' . "\n";
|
89 |
-
/**/
|
90 |
-
echo '</tr>' . "\n";
|
91 |
-
echo '<tr>' . "\n";
|
92 |
-
/**/
|
93 |
-
echo '<td>' . "\n";
|
94 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_posts" id="ws-plugin--s2member-level1-posts" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"]) . '" /><br />' . "\n";
|
95 |
-
echo 'Post IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
96 |
-
echo '</td>' . "\n";
|
97 |
-
/**/
|
98 |
-
echo '</tr>' . "\n";
|
99 |
-
echo '<tr>' . "\n";
|
100 |
-
/**/
|
101 |
-
echo '<th>' . "\n";
|
102 |
-
echo '<label for="ws-plugin--s2member-level2-posts">' . "\n";
|
103 |
-
echo 'Posts That Require Level #2 Or Higher:' . "\n";
|
104 |
-
echo '</label>' . "\n";
|
105 |
-
echo '</th>' . "\n";
|
106 |
-
/**/
|
107 |
-
echo '</tr>' . "\n";
|
108 |
-
echo '<tr>' . "\n";
|
109 |
-
/**/
|
110 |
-
echo '<td>' . "\n";
|
111 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_posts" id="ws-plugin--s2member-level2-posts" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"]) . '" /><br />' . "\n";
|
112 |
-
echo 'Post IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
113 |
-
echo '</td>' . "\n";
|
114 |
-
/**/
|
115 |
-
echo '</tr>' . "\n";
|
116 |
-
echo '<tr>' . "\n";
|
117 |
-
/**/
|
118 |
-
echo '<th>' . "\n";
|
119 |
-
echo '<label for="ws-plugin--s2member-level3-posts">' . "\n";
|
120 |
-
echo 'Posts That Require Level #3 Or Higher:' . "\n";
|
121 |
-
echo '</label>' . "\n";
|
122 |
-
echo '</th>' . "\n";
|
123 |
-
/**/
|
124 |
-
echo '</tr>' . "\n";
|
125 |
-
echo '<tr>' . "\n";
|
126 |
-
/**/
|
127 |
-
echo '<td>' . "\n";
|
128 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_posts" id="ws-plugin--s2member-level3-posts" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"]) . '" /><br />' . "\n";
|
129 |
-
echo 'Post IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
130 |
-
echo '</td>' . "\n";
|
131 |
-
/**/
|
132 |
-
echo '</tr>' . "\n";
|
133 |
-
echo '<tr>' . "\n";
|
134 |
-
/**/
|
135 |
-
echo '<th>' . "\n";
|
136 |
-
echo '<label for="ws-plugin--s2member-level4-posts">' . "\n";
|
137 |
-
echo 'Posts That Require Highest Level #4:' . "\n";
|
138 |
-
echo '</label>' . "\n";
|
139 |
-
echo '</th>' . "\n";
|
140 |
-
/**/
|
141 |
-
echo '</tr>' . "\n";
|
142 |
-
echo '<tr>' . "\n";
|
143 |
/**/
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
/**/
|
149 |
-
echo '</tr>' . "\n";
|
150 |
echo '</tbody>' . "\n";
|
151 |
echo '</table>' . "\n";
|
152 |
echo '</div>' . "\n";
|
@@ -170,91 +105,28 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
|
170 |
/**/
|
171 |
echo '<table class="form-table">' . "\n";
|
172 |
echo '<tbody>' . "\n";
|
173 |
-
echo '<tr>' . "\n";
|
174 |
-
/**/
|
175 |
-
echo '<th>' . "\n";
|
176 |
-
echo '<label for="ws-plugin--s2member-level0-pages">' . "\n";
|
177 |
-
echo 'Pages That Require Level #0 Or Higher:' . "\n";
|
178 |
-
echo '</label>' . "\n";
|
179 |
-
echo '</th>' . "\n";
|
180 |
/**/
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
/**/
|
189 |
-
echo '</tr>' . "\n";
|
190 |
-
echo '<tr>' . "\n";
|
191 |
-
/**/
|
192 |
-
echo '<th>' . "\n";
|
193 |
-
echo '<label for="ws-plugin--s2member-level1-pages">' . "\n";
|
194 |
-
echo 'Pages That Require Level #1 Or Higher:' . "\n";
|
195 |
-
echo '</label>' . "\n";
|
196 |
-
echo '</th>' . "\n";
|
197 |
-
/**/
|
198 |
-
echo '</tr>' . "\n";
|
199 |
-
echo '<tr>' . "\n";
|
200 |
-
/**/
|
201 |
-
echo '<td>' . "\n";
|
202 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_pages" id="ws-plugin--s2member-level1-pages" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"]) . '" /><br />' . "\n";
|
203 |
-
echo 'Page IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
204 |
-
echo '</td>' . "\n";
|
205 |
-
/**/
|
206 |
-
echo '</tr>' . "\n";
|
207 |
-
echo '<tr>' . "\n";
|
208 |
-
/**/
|
209 |
-
echo '<th>' . "\n";
|
210 |
-
echo '<label for="ws-plugin--s2member-level2-pages">' . "\n";
|
211 |
-
echo 'Pages That Require Level #2 Or Higher:' . "\n";
|
212 |
-
echo '</label>' . "\n";
|
213 |
-
echo '</th>' . "\n";
|
214 |
-
/**/
|
215 |
-
echo '</tr>' . "\n";
|
216 |
-
echo '<tr>' . "\n";
|
217 |
-
/**/
|
218 |
-
echo '<td>' . "\n";
|
219 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_pages" id="ws-plugin--s2member-level2-pages" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"]) . '" /><br />' . "\n";
|
220 |
-
echo 'Page IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
221 |
-
echo '</td>' . "\n";
|
222 |
-
/**/
|
223 |
-
echo '</tr>' . "\n";
|
224 |
-
echo '<tr>' . "\n";
|
225 |
-
/**/
|
226 |
-
echo '<th>' . "\n";
|
227 |
-
echo '<label for="ws-plugin--s2member-level3-pages">' . "\n";
|
228 |
-
echo 'Pages That Require Level #3 Or Higher:' . "\n";
|
229 |
-
echo '</label>' . "\n";
|
230 |
-
echo '</th>' . "\n";
|
231 |
-
/**/
|
232 |
-
echo '</tr>' . "\n";
|
233 |
-
echo '<tr>' . "\n";
|
234 |
-
/**/
|
235 |
-
echo '<td>' . "\n";
|
236 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_pages" id="ws-plugin--s2member-level3-pages" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"]) . '" /><br />' . "\n";
|
237 |
-
echo 'Page IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
238 |
-
echo '</td>' . "\n";
|
239 |
-
/**/
|
240 |
-
echo '</tr>' . "\n";
|
241 |
-
echo '<tr>' . "\n";
|
242 |
-
/**/
|
243 |
-
echo '<th>' . "\n";
|
244 |
-
echo '<label for="ws-plugin--s2member-level4-pages">' . "\n";
|
245 |
-
echo 'Pages That Require Highest Level #4:' . "\n";
|
246 |
-
echo '</label>' . "\n";
|
247 |
-
echo '</th>' . "\n";
|
248 |
-
/**/
|
249 |
-
echo '</tr>' . "\n";
|
250 |
-
echo '<tr>' . "\n";
|
251 |
-
/**/
|
252 |
-
echo '<td>' . "\n";
|
253 |
-
echo '<input type="text" name="ws_plugin__s2member_level4_pages" id="ws-plugin--s2member-level4-pages" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"]) . '" /><br />' . "\n";
|
254 |
-
echo 'Page IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
255 |
-
echo '</td>' . "\n";
|
256 |
-
/**/
|
257 |
-
echo '</tr>' . "\n";
|
258 |
echo '</tbody>' . "\n";
|
259 |
echo '</table>' . "\n";
|
260 |
echo '</div>' . "\n";
|
@@ -278,91 +150,28 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
|
278 |
/**/
|
279 |
echo '<table class="form-table">' . "\n";
|
280 |
echo '<tbody>' . "\n";
|
281 |
-
echo '<tr>' . "\n";
|
282 |
-
/**/
|
283 |
-
echo '<th>' . "\n";
|
284 |
-
echo '<label for="ws-plugin--s2member-level0-ptags">' . "\n";
|
285 |
-
echo 'Tags That Require Level #0 Or Higher:' . "\n";
|
286 |
-
echo '</label>' . "\n";
|
287 |
-
echo '</th>' . "\n";
|
288 |
-
/**/
|
289 |
-
echo '</tr>' . "\n";
|
290 |
-
echo '<tr>' . "\n";
|
291 |
/**/
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
/**/
|
297 |
-
echo '</tr>' . "\n";
|
298 |
-
echo '<tr>' . "\n";
|
299 |
-
/**/
|
300 |
-
echo '<th>' . "\n";
|
301 |
-
echo '<label for="ws-plugin--s2member-level1-ptags">' . "\n";
|
302 |
-
echo 'Tags That Require Level #1 Or Higher:' . "\n";
|
303 |
-
echo '</label>' . "\n";
|
304 |
-
echo '</th>' . "\n";
|
305 |
-
/**/
|
306 |
-
echo '</tr>' . "\n";
|
307 |
-
echo '<tr>' . "\n";
|
308 |
-
/**/
|
309 |
-
echo '<td>' . "\n";
|
310 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_ptags" id="ws-plugin--s2member-level1-ptags" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"]) . '" /><br />' . "\n";
|
311 |
-
echo 'Tags in comma-delimited format. Example: <code>premium,members only</code> — or you can type: <code>all</code>.' . "\n";
|
312 |
-
echo '</td>' . "\n";
|
313 |
-
/**/
|
314 |
-
echo '</tr>' . "\n";
|
315 |
-
echo '<tr>' . "\n";
|
316 |
-
/**/
|
317 |
-
echo '<th>' . "\n";
|
318 |
-
echo '<label for="ws-plugin--s2member-level2-ptags">' . "\n";
|
319 |
-
echo 'Tags That Require Level #2 Or Higher:' . "\n";
|
320 |
-
echo '</label>' . "\n";
|
321 |
-
echo '</th>' . "\n";
|
322 |
-
/**/
|
323 |
-
echo '</tr>' . "\n";
|
324 |
-
echo '<tr>' . "\n";
|
325 |
-
/**/
|
326 |
-
echo '<td>' . "\n";
|
327 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_ptags" id="ws-plugin--s2member-level2-ptags" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"]) . '" /><br />' . "\n";
|
328 |
-
echo 'Tags in comma-delimited format. Example: <code>premium,members only</code> — or you can type: <code>all</code>.' . "\n";
|
329 |
-
echo '</td>' . "\n";
|
330 |
-
/**/
|
331 |
-
echo '</tr>' . "\n";
|
332 |
-
echo '<tr>' . "\n";
|
333 |
-
/**/
|
334 |
-
echo '<th>' . "\n";
|
335 |
-
echo '<label for="ws-plugin--s2member-level3-ptags">' . "\n";
|
336 |
-
echo 'Tags That Require Level #3 Or Higher:' . "\n";
|
337 |
-
echo '</label>' . "\n";
|
338 |
-
echo '</th>' . "\n";
|
339 |
-
/**/
|
340 |
-
echo '</tr>' . "\n";
|
341 |
-
echo '<tr>' . "\n";
|
342 |
-
/**/
|
343 |
-
echo '<td>' . "\n";
|
344 |
-
echo '<input type="text" name="ws_plugin__s2member_level3_ptags" id="ws-plugin--s2member-level3-ptags" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"]) . '" /><br />' . "\n";
|
345 |
-
echo 'Tags in comma-delimited format. Example: <code>premium,members only</code> — or you can type: <code>all</code>.' . "\n";
|
346 |
-
echo '</td>' . "\n";
|
347 |
-
/**/
|
348 |
-
echo '</tr>' . "\n";
|
349 |
-
echo '<tr>' . "\n";
|
350 |
-
/**/
|
351 |
-
echo '<th>' . "\n";
|
352 |
-
echo '<label for="ws-plugin--s2member-level4-ptags">' . "\n";
|
353 |
-
echo 'Tags That Require Highest Level #4:' . "\n";
|
354 |
-
echo '</label>' . "\n";
|
355 |
-
echo '</th>' . "\n";
|
356 |
-
/**/
|
357 |
-
echo '</tr>' . "\n";
|
358 |
-
echo '<tr>' . "\n";
|
359 |
-
/**/
|
360 |
-
echo '<td>' . "\n";
|
361 |
-
echo '<input type="text" name="ws_plugin__s2member_level4_ptags" id="ws-plugin--s2member-level4-ptags" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ptags"]) . '" /><br />' . "\n";
|
362 |
-
echo 'Tags in comma-delimited format. Example: <code>premium,members only</code> — or you can type: <code>all</code>.' . "\n";
|
363 |
-
echo '</td>' . "\n";
|
364 |
-
/**/
|
365 |
-
echo '</tr>' . "\n";
|
366 |
echo '</tbody>' . "\n";
|
367 |
echo '</table>' . "\n";
|
368 |
echo '</div>' . "\n";
|
@@ -386,91 +195,30 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
|
386 |
/**/
|
387 |
echo '<table class="form-table">' . "\n";
|
388 |
echo '<tbody>' . "\n";
|
389 |
-
echo '<tr>' . "\n";
|
390 |
-
/**/
|
391 |
-
echo '<th>' . "\n";
|
392 |
-
echo '<label for="ws-plugin--s2member-level0-catgs">' . "\n";
|
393 |
-
echo 'Categories That Require Level #0 Or Higher:' . "\n";
|
394 |
-
echo '</label>' . "\n";
|
395 |
-
echo '</th>' . "\n";
|
396 |
-
/**/
|
397 |
-
echo '</tr>' . "\n";
|
398 |
-
echo '<tr>' . "\n";
|
399 |
-
/**/
|
400 |
-
echo '<td>' . "\n";
|
401 |
-
echo '<input type="text" name="ws_plugin__s2member_level0_catgs" id="ws-plugin--s2member-level0-catgs" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_catgs"]) . '" /><br />' . "\n";
|
402 |
-
echo 'Category IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
403 |
-
echo '</td>' . "\n";
|
404 |
-
/**/
|
405 |
-
echo '</tr>' . "\n";
|
406 |
-
echo '<tr>' . "\n";
|
407 |
-
/**/
|
408 |
-
echo '<th>' . "\n";
|
409 |
-
echo '<label for="ws-plugin--s2member-level1-catgs">' . "\n";
|
410 |
-
echo 'Categories That Require Level #1 Or Higher:' . "\n";
|
411 |
-
echo '</label>' . "\n";
|
412 |
-
echo '</th>' . "\n";
|
413 |
-
/**/
|
414 |
-
echo '</tr>' . "\n";
|
415 |
-
echo '<tr>' . "\n";
|
416 |
-
/**/
|
417 |
-
echo '<td>' . "\n";
|
418 |
-
echo '<input type="text" name="ws_plugin__s2member_level1_catgs" id="ws-plugin--s2member-level1-catgs" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"]) . '" /><br />' . "\n";
|
419 |
-
echo 'Category IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
420 |
-
echo '</td>' . "\n";
|
421 |
-
/**/
|
422 |
-
echo '</tr>' . "\n";
|
423 |
-
echo '<tr>' . "\n";
|
424 |
-
/**/
|
425 |
-
echo '<th>' . "\n";
|
426 |
-
echo '<label for="ws-plugin--s2member-level2-catgs">' . "\n";
|
427 |
-
echo 'Categories That Require Level #2 Or Higher:' . "\n";
|
428 |
-
echo '</label>' . "\n";
|
429 |
-
echo '</th>' . "\n";
|
430 |
-
/**/
|
431 |
-
echo '</tr>' . "\n";
|
432 |
-
echo '<tr>' . "\n";
|
433 |
-
/**/
|
434 |
-
echo '<td>' . "\n";
|
435 |
-
echo '<input type="text" name="ws_plugin__s2member_level2_catgs" id="ws-plugin--s2member-level2-catgs" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"]) . '" /><br />' . "\n";
|
436 |
-
echo 'Category IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
437 |
-
echo '</td>' . "\n";
|
438 |
-
/**/
|
439 |
-
echo '</tr>' . "\n";
|
440 |
-
echo '<tr>' . "\n";
|
441 |
-
/**/
|
442 |
-
echo '<th>' . "\n";
|
443 |
-
echo '<label for="ws-plugin--s2member-level3-catgs">' . "\n";
|
444 |
-
echo 'Categories That Require Level #3 Or Higher:' . "\n";
|
445 |
-
echo '</label>' . "\n";
|
446 |
-
echo '</th>' . "\n";
|
447 |
-
/**/
|
448 |
-
echo '</tr>' . "\n";
|
449 |
-
echo '<tr>' . "\n";
|
450 |
/**/
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
|
|
472 |
/**/
|
473 |
-
echo '</tr>' . "\n";
|
474 |
echo '</tbody>' . "\n";
|
475 |
echo '</table>' . "\n";
|
476 |
echo '</div>' . "\n";
|
@@ -495,91 +243,28 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
|
495 |
/**/
|
496 |
echo '<table class="form-table">' . "\n";
|
497 |
echo '<tbody>' . "\n";
|
498 |
-
echo '<tr>' . "\n";
|
499 |
-
/**/
|
500 |
-
echo '<th>' . "\n";
|
501 |
-
echo '<label for="ws-plugin--s2member-level0-ruris">' . "\n";
|
502 |
-
echo 'URIs That Require Level #0 Or Higher:' . "\n";
|
503 |
-
echo '</label>' . "\n";
|
504 |
-
echo '</th>' . "\n";
|
505 |
-
/**/
|
506 |
-
echo '</tr>' . "\n";
|
507 |
-
echo '<tr>' . "\n";
|
508 |
-
/**/
|
509 |
-
echo '<td>' . "\n";
|
510 |
-
echo '<textarea name="ws_plugin__s2member_level0_ruris" id="ws-plugin--s2member-level0-ruris" rows="3" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level0_ruris"]) . '</textarea><br />' . "\n";
|
511 |
-
echo 'URIs and/or word fragments found in URIs. One per line please.' . "\n";
|
512 |
-
echo '</td>' . "\n";
|
513 |
-
/**/
|
514 |
-
echo '</tr>' . "\n";
|
515 |
-
echo '<tr>' . "\n";
|
516 |
/**/
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
525 |
/**/
|
526 |
-
echo '<td>' . "\n";
|
527 |
-
echo '<textarea name="ws_plugin__s2member_level1_ruris" id="ws-plugin--s2member-level1-ruris" rows="3" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ruris"]) . '</textarea><br />' . "\n";
|
528 |
-
echo 'URIs and/or word fragments found in URIs. One per line please.' . "\n";
|
529 |
-
echo '</td>' . "\n";
|
530 |
-
/**/
|
531 |
-
echo '</tr>' . "\n";
|
532 |
-
echo '<tr>' . "\n";
|
533 |
-
/**/
|
534 |
-
echo '<th>' . "\n";
|
535 |
-
echo '<label for="ws-plugin--s2member-level2-ruris">' . "\n";
|
536 |
-
echo 'URIs That Require Level #2 Or Higher:' . "\n";
|
537 |
-
echo '</label>' . "\n";
|
538 |
-
echo '</th>' . "\n";
|
539 |
-
/**/
|
540 |
-
echo '</tr>' . "\n";
|
541 |
-
echo '<tr>' . "\n";
|
542 |
-
/**/
|
543 |
-
echo '<td>' . "\n";
|
544 |
-
echo '<textarea name="ws_plugin__s2member_level2_ruris" id="ws-plugin--s2member-level2-ruris" rows="3" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ruris"]) . '</textarea><br />' . "\n";
|
545 |
-
echo 'URIs and/or word fragments found in URIs. One per line please.' . "\n";
|
546 |
-
echo '</td>' . "\n";
|
547 |
-
/**/
|
548 |
-
echo '</tr>' . "\n";
|
549 |
-
echo '<tr>' . "\n";
|
550 |
-
/**/
|
551 |
-
echo '<th>' . "\n";
|
552 |
-
echo '<label for="ws-plugin--s2member-level3-ruris">' . "\n";
|
553 |
-
echo 'URIs That Require Level #3 Or Higher:' . "\n";
|
554 |
-
echo '</label>' . "\n";
|
555 |
-
echo '</th>' . "\n";
|
556 |
-
/**/
|
557 |
-
echo '</tr>' . "\n";
|
558 |
-
echo '<tr>' . "\n";
|
559 |
-
/**/
|
560 |
-
echo '<td>' . "\n";
|
561 |
-
echo '<textarea name="ws_plugin__s2member_level3_ruris" id="ws-plugin--s2member-level3-ruris" rows="3" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ruris"]) . '</textarea><br />' . "\n";
|
562 |
-
echo 'URIs and/or word fragments found in URIs. One per line please.' . "\n";
|
563 |
-
echo '</td>' . "\n";
|
564 |
-
/**/
|
565 |
-
echo '</tr>' . "\n";
|
566 |
-
echo '<tr>' . "\n";
|
567 |
-
/**/
|
568 |
-
echo '<th>' . "\n";
|
569 |
-
echo '<label for="ws-plugin--s2member-level4-ruris">' . "\n";
|
570 |
-
echo 'URIs That Require Highest Level #4:' . "\n";
|
571 |
-
echo '</label>' . "\n";
|
572 |
-
echo '</th>' . "\n";
|
573 |
-
/**/
|
574 |
-
echo '</tr>' . "\n";
|
575 |
-
echo '<tr>' . "\n";
|
576 |
-
/**/
|
577 |
-
echo '<td>' . "\n";
|
578 |
-
echo '<textarea name="ws_plugin__s2member_level4_ruris" id="ws-plugin--s2member-level4-ruris" rows="3" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ruris"]) . '</textarea><br />' . "\n";
|
579 |
-
echo 'URIs and/or word fragments found in URIs. One per line please.' . "\n";
|
580 |
-
echo '</td>' . "\n";
|
581 |
-
/**/
|
582 |
-
echo '</tr>' . "\n";
|
583 |
echo '</tbody>' . "\n";
|
584 |
echo '</table>' . "\n";
|
585 |
echo '</div>' . "\n";
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit ("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
|
21 |
{
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® Restriction Options</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
60 |
/**/
|
61 |
echo '<table class="form-table">' . "\n";
|
62 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
/**/
|
64 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
65 |
+
{
|
66 |
+
echo '<tr>' . "\n";
|
67 |
+
/**/
|
68 |
+
echo '<th>' . "\n";
|
69 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-posts">' . "\n";
|
70 |
+
echo ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Posts That Require Highest Level #' . $n . ':' . "\n" : 'Posts That Require Level #' . $n . ' Or Higher:' . "\n";
|
71 |
+
echo '</label>' . "\n";
|
72 |
+
echo '</th>' . "\n";
|
73 |
+
/**/
|
74 |
+
echo '</tr>' . "\n";
|
75 |
+
echo '<tr>' . "\n";
|
76 |
+
/**/
|
77 |
+
echo '<td>' . "\n";
|
78 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_posts" id="ws-plugin--s2member-level' . $n . '-posts" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]) . '" /><br />' . "\n";
|
79 |
+
echo 'Post IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
80 |
+
echo '</td>' . "\n";
|
81 |
+
/**/
|
82 |
+
echo '</tr>' . "\n";
|
83 |
+
}
|
84 |
/**/
|
|
|
85 |
echo '</tbody>' . "\n";
|
86 |
echo '</table>' . "\n";
|
87 |
echo '</div>' . "\n";
|
105 |
/**/
|
106 |
echo '<table class="form-table">' . "\n";
|
107 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
/**/
|
109 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
110 |
+
{
|
111 |
+
echo '<tr>' . "\n";
|
112 |
+
/**/
|
113 |
+
echo '<th>' . "\n";
|
114 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-pages">' . "\n";
|
115 |
+
echo ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Pages That Require Highest Level #' . $n . ':' . "\n" : 'Pages That Require Level #' . $n . ' Or Higher:' . "\n";
|
116 |
+
echo '</label>' . "\n";
|
117 |
+
echo '</th>' . "\n";
|
118 |
+
/**/
|
119 |
+
echo '</tr>' . "\n";
|
120 |
+
echo '<tr>' . "\n";
|
121 |
+
/**/
|
122 |
+
echo '<td>' . "\n";
|
123 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_pages" id="ws-plugin--s2member-level' . $n . '-pages" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]) . '" /><br />' . "\n";
|
124 |
+
echo 'Page IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
125 |
+
echo '</td>' . "\n";
|
126 |
+
/**/
|
127 |
+
echo '</tr>' . "\n";
|
128 |
+
}
|
129 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
echo '</tbody>' . "\n";
|
131 |
echo '</table>' . "\n";
|
132 |
echo '</div>' . "\n";
|
150 |
/**/
|
151 |
echo '<table class="form-table">' . "\n";
|
152 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
/**/
|
154 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
155 |
+
{
|
156 |
+
echo '<tr>' . "\n";
|
157 |
+
/**/
|
158 |
+
echo '<th>' . "\n";
|
159 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-ptags">' . "\n";
|
160 |
+
echo ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Tags That Require Highest Level #' . $n . ':' . "\n" : 'Tags That Require Level #' . $n . ' Or Higher:' . "\n";
|
161 |
+
echo '</label>' . "\n";
|
162 |
+
echo '</th>' . "\n";
|
163 |
+
/**/
|
164 |
+
echo '</tr>' . "\n";
|
165 |
+
echo '<tr>' . "\n";
|
166 |
+
/**/
|
167 |
+
echo '<td>' . "\n";
|
168 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_ptags" id="ws-plugin--s2member-level' . $n . '-ptags" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"]) . '" /><br />' . "\n";
|
169 |
+
echo 'Tags in comma-delimited format. Example: ' . (($n === 0) ? '<code>free,subscribers only</code>' : '<code>members,members only</code>') . ' — or you can type: <code>all</code>.' . "\n";
|
170 |
+
echo '</td>' . "\n";
|
171 |
+
/**/
|
172 |
+
echo '</tr>' . "\n";
|
173 |
+
}
|
174 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
echo '</tbody>' . "\n";
|
176 |
echo '</table>' . "\n";
|
177 |
echo '</div>' . "\n";
|
195 |
/**/
|
196 |
echo '<table class="form-table">' . "\n";
|
197 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
/**/
|
199 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
200 |
+
{
|
201 |
+
echo '<tr>' . "\n";
|
202 |
+
/**/
|
203 |
+
echo '<th>' . "\n";
|
204 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-catgs">' . "\n";
|
205 |
+
echo ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Categories That Require Highest Level #' . $n . ':' . "\n" : 'Categories That Require Level #' . $n . ' Or Higher:' . "\n";
|
206 |
+
echo '</label>' . "\n";
|
207 |
+
echo '</th>' . "\n";
|
208 |
+
/**/
|
209 |
+
echo '</tr>' . "\n";
|
210 |
+
echo '<tr>' . "\n";
|
211 |
+
/**/
|
212 |
+
echo '<td>' . "\n";
|
213 |
+
echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_catgs" id="ws-plugin--s2member-level' . $n . '-catgs" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]) . '" /><br />' . "\n";
|
214 |
+
echo 'Category IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
|
215 |
+
echo '</td>' . "\n";
|
216 |
+
/**/
|
217 |
+
echo '</tr>' . "\n";
|
218 |
+
/**/
|
219 |
+
echo '<tr>' . "\n";
|
220 |
+
}
|
221 |
/**/
|
|
|
222 |
echo '</tbody>' . "\n";
|
223 |
echo '</table>' . "\n";
|
224 |
echo '</div>' . "\n";
|
243 |
/**/
|
244 |
echo '<table class="form-table">' . "\n";
|
245 |
echo '<tbody>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
/**/
|
247 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
248 |
+
{
|
249 |
+
echo '<tr>' . "\n";
|
250 |
+
/**/
|
251 |
+
echo '<th>' . "\n";
|
252 |
+
echo '<label for="ws-plugin--s2member-level' . $n . '-ruris">' . "\n";
|
253 |
+
echo ($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'URIs That Require Highest Level #' . $n . ':' . "\n" : 'URIs That Require Level #' . $n . ' Or Higher:' . "\n";
|
254 |
+
echo '</label>' . "\n";
|
255 |
+
echo '</th>' . "\n";
|
256 |
+
/**/
|
257 |
+
echo '</tr>' . "\n";
|
258 |
+
echo '<tr>' . "\n";
|
259 |
+
/**/
|
260 |
+
echo '<td>' . "\n";
|
261 |
+
echo '<textarea name="ws_plugin__s2member_level' . $n . '_ruris" id="ws-plugin--s2member-level' . $n . '-ruris" rows="3" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"]) . '</textarea><br />' . "\n";
|
262 |
+
echo 'URIs and/or word fragments found in URIs. One per line please.' . "\n";
|
263 |
+
echo '</td>' . "\n";
|
264 |
+
/**/
|
265 |
+
echo '</tr>' . "\n";
|
266 |
+
}
|
267 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
echo '</tbody>' . "\n";
|
269 |
echo '</table>' . "\n";
|
270 |
echo '</div>' . "\n";
|
includes/menu-pages/scripting.inc.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
-
exit
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
21 |
{
|
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -64,13 +62,13 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
64 |
{
|
65 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_simple_way", get_defined_vars ());
|
66 |
/**/
|
67 |
-
if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) /* Two versions
|
68 |
{
|
69 |
-
echo '<div class="ws-menu-page-group" title="
|
70 |
/**/
|
71 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
|
72 |
echo '<h3>Simple Conditionals ( via WordPress® Shortcodes )</h3>' . "\n";
|
73 |
-
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>. 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 Member\'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";
|
74 |
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";
|
75 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way_farm", get_defined_vars ());
|
76 |
/**/
|
@@ -112,7 +110,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
112 |
/**/
|
113 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
114 |
/**/
|
115 |
-
echo '<p><em><strong>s2Member supports many <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank" rel="external">Conditional Tags</a> in WordPress®.</strong> Including: <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>is_admin()</code></strong>, <strong><code>is_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_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_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_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>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>.</em></p>' . "\n";
|
116 |
/**/
|
117 |
echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
|
118 |
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";
|
@@ -128,16 +126,21 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
128 |
}
|
129 |
else /* Otherwise, we can display the standardized version of this information. */
|
130 |
{
|
131 |
-
echo '<div class="ws-menu-page-group" title="
|
132 |
/**/
|
133 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
|
134 |
echo '<h3>Simple Conditionals ( via WordPress® Shortcodes )</h3>' . "\n";
|
135 |
-
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 Member\'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";
|
136 |
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";
|
137 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars ());
|
138 |
/**/
|
139 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
140 |
/**/
|
|
|
|
|
|
|
|
|
|
|
141 |
echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
|
142 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-is-user-logged-in.php")) . '</p>' . "\n";
|
143 |
/**/
|
@@ -174,7 +177,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
174 |
/**/
|
175 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
176 |
/**/
|
177 |
-
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_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>, <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_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_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>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>, <strong><code>is_active_sidebar(ID|number)</code></strong>.</em></p>' . "\n";
|
178 |
/**/
|
179 |
echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
|
180 |
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";
|
@@ -196,15 +199,20 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
196 |
{
|
197 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_advanced_way", get_defined_vars ());
|
198 |
/**/
|
199 |
-
echo '<div class="ws-menu-page-group" title="
|
200 |
/**/
|
201 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
|
202 |
echo '<h3>The Advanced Way ( some PHP scripting required )</h3>' . "\n";
|
203 |
-
echo '<p>In an effort to give you even more control over access restrictions, s2Member makes some PHP functions, and also some PHP Constants, available to you from within WordPress®. In this section, we\'ll demonstrate several functions: <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 PHP code samples below. Using PHP, is a very powerful way to build Advanced Conditionals within your content; based on a Member\'s Level, Custom Capabilities, and/or other factors. 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/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ).</p>' . "\n";
|
204 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_way", get_defined_vars ());
|
205 |
/**/
|
206 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
207 |
/**/
|
|
|
|
|
|
|
|
|
|
|
208 |
echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
|
209 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/is-user-logged-in.php")) . '</p>' . "\n";
|
210 |
/**/
|
@@ -259,7 +267,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
259 |
{
|
260 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_queries", get_defined_vars ());
|
261 |
/**/
|
262 |
-
echo '<div class="ws-menu-page-group" title="Advanced Query Conditionals">' . "\n";
|
263 |
/**/
|
264 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
|
265 |
echo '<h3>Advanced Query Conditionals ( some PHP scripting required )</h3>' . "\n";
|
@@ -269,6 +277,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
269 |
/**/
|
270 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
271 |
/**/
|
|
|
|
|
|
|
|
|
|
|
272 |
echo '<p><strong>Example #1:</strong> Pre-filtering custom queries in WordPress®.</strong></p>' . "\n";
|
273 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/custom-queries.php")) . '</p>' . "\n";
|
274 |
/**/
|
@@ -296,11 +309,6 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
296 |
/**/
|
297 |
echo '<p><strong>Example #6:</strong> Checking Post Restrictions, including Custom Post Types.</strong></p>' . "\n";
|
298 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/specific-post-restrictions.php")) . '</p>' . "\n";
|
299 |
-
/**/
|
300 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
301 |
-
/**/
|
302 |
-
echo '<p><strong>Additional examples:</strong> documentation on these function calls.</strong></p>' . "\n";
|
303 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/query-conditional-examples.php")) . '</p>' . "\n";
|
304 |
echo '</div>' . "\n";
|
305 |
/**/
|
306 |
echo '</div>' . "\n";
|
@@ -316,16 +324,23 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
316 |
/**/
|
317 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-capabilities-section">' . "\n";
|
318 |
echo '<h3>Packaging Together Custom Capabilities w/ Membership</h3>' . "\n";
|
319 |
-
echo '<p>Using one of s2Member\'s Payment Button and/or Form Generators, you can add Custom Capabilities in comma-delimited format. s2Member builds upon existing functionality offered by WordPress® Roles/Capabilities
|
|
|
320 |
echo '<p>Custom Capabilities are an extension to a feature that already exists in WordPress®. The <code>current_user_can()</code> function, can be used to test for these additional Capabilities that you allow. Whenever a Member completes the checkout process, after having purchased a Membership from you ( one that included Custom Capabilities ), s2Member will add those Custom Capabilities to the account for that specific Member.</p>' . "\n";
|
321 |
echo '<p>Custom Capabilities are always prepended with <code>access_s2member_ccap_</code>. You fill in the last part, with ONLY lowercase alpha-numerics and/or underscores. For example, let\'s say you want to sell Membership Level #1, as is. But, you also want to sell a slight variation of Membership Level #1, that includes the ability to access the Music & Video sections of your site. So, instead of selling this additional access under a whole new Membership Level, you could just sell a modified version of Membership Level #1. Add the the Custom Capabilities: <code>music,videos</code>. Once a Member has these Capabilities, you can test for these Capabilities using <code>current_user_can("access_s2member_ccap_music")</code> and <code>current_user_can("access_s2member_ccap_videos")</code>.</p>' . "\n";
|
322 |
-
echo '<p>The important thing to realize, is that Custom Capabilities, are just that. They\'re custom. s2Member only deals with the default Capabilities that it uses. If you start using Custom Capabilities, you MUST use Simple or Advanced Conditionals ( <em>i.e. <code>current_user_can</code> logic</em> ) to test for them. Either in your theme files with PHP, or in Posts/Pages using Simple Conditionals ( powered by Shortcodes )
|
323 |
-
echo '<p><
|
324 |
-
echo '<p><
|
325 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_custom_capabilities", get_defined_vars ());
|
326 |
/**/
|
327 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
328 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
echo '<p><strong>Custom Capabilities:</strong> ( music,videos ):</p>' . "\n";
|
330 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-1.php")) . '</p>' . "\n";
|
331 |
/**/
|
@@ -352,6 +367,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
352 |
/**/
|
353 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
354 |
/**/
|
|
|
|
|
|
|
|
|
|
|
355 |
echo '<p><strong>Custom Capabilities:</strong> ( music,videos )</p>' . "\n";
|
356 |
echo '<p>Sub-Directory: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music</code><br />Sub-Directory: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos</code></p>' . "\n";
|
357 |
echo '<p>Protected File: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music/file.mp3</code><br />Protected File: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos/file.avi</code></p>' . "\n";
|
@@ -387,6 +407,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
387 |
/**/
|
388 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
389 |
/**/
|
|
|
|
|
|
|
|
|
|
|
390 |
echo '<p><strong>To drip content using <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>:</strong></p>' . "\n";
|
391 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-paid-registration-days-dripping.php")) . '</p>' . "\n";
|
392 |
/**/
|
@@ -423,16 +448,16 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
423 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
424 |
/**/
|
425 |
echo '<p><strong>Shortcode:</strong> for an Inline Profile Modification Form:<br />' . "\n";
|
426 |
-
echo '<p><input type="text" value="' . format_to_edit ('[s2Member-Profile /]') . '" style="
|
427 |
/**/
|
428 |
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( standard link tag ):</p>' . "\n";
|
429 |
-
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1-ops.php"))) . '" style="
|
430 |
/**/
|
431 |
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( open the link in a popup window ):</p>' . "\n";
|
432 |
-
echo '<p><
|
433 |
/**/
|
434 |
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( embed the Form with an IFRAME tag ):</p>' . "\n";
|
435 |
-
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3-ops.php"))) . '" style="
|
436 |
echo '</div>' . "\n";
|
437 |
/**/
|
438 |
echo '</div>' . "\n";
|
@@ -444,33 +469,33 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
444 |
{
|
445 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_constants", get_defined_vars ());
|
446 |
/**/
|
447 |
-
if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) /* Two versions
|
448 |
{
|
449 |
echo '<div class="ws-menu-page-group" title="s2Get / s2Member API Constants">' . "\n";
|
450 |
/**/
|
451 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-constants-section">' . "\n";
|
452 |
echo '<h3>Using s2Get w/ s2Member API Constants</h3>' . "\n";
|
453 |
-
echo '<p>A Constant, is an identifier ( a name ) for a simple value. Below is a comprehensive list that includes all of the defined Constants available to you. We recommend using some of these Constants in the creation of your Login Welcome Page; which is described in the s2Member General Options Panel.
|
454 |
echo '<p>For example, you might use <code>[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]</code> to display the type of Membership a Customer has.</em></p>' . "\n";
|
455 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_constants_farm", get_defined_vars ());
|
456 |
/**/
|
457 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
458 |
/**/
|
459 |
-
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";
|
460 |
/**/
|
461 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
462 |
/**/
|
463 |
-
|
464 |
-
|
465 |
/**/
|
466 |
-
|
467 |
/**/
|
468 |
-
|
469 |
-
|
470 |
/**/
|
471 |
-
|
472 |
/**/
|
473 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int)
|
474 |
echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
|
475 |
echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 & 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 & 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 & 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.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
|
476 |
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";
|
@@ -501,15 +526,15 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
501 |
/**/
|
502 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
503 |
/**/
|
504 |
-
echo '<p><strong>
|
505 |
/**/
|
506 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
507 |
/**/
|
508 |
-
echo '<p><strong>
|
509 |
/**/
|
510 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
511 |
/**/
|
512 |
-
echo '<p><strong>
|
513 |
/**/
|
514 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
515 |
/**/
|
@@ -533,7 +558,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
533 |
/**/
|
534 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
535 |
/**/
|
536 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address. Empty if browsing anonymously.</p>' . "\n";
|
|
|
|
|
|
|
|
|
537 |
/**/
|
538 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
539 |
/**/
|
@@ -541,34 +570,34 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
541 |
/**/
|
542 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
543 |
/**/
|
544 |
-
#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, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array.
|
545 |
/**/
|
546 |
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
547 |
/**/
|
548 |
-
|
549 |
/**/
|
550 |
-
|
551 |
/**/
|
552 |
-
|
553 |
/**/
|
554 |
-
|
555 |
/**/
|
556 |
-
|
557 |
/**/
|
558 |
-
|
559 |
/**/
|
560 |
-
|
561 |
/**/
|
562 |
-
|
563 |
/**/
|
564 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile.</p>' . "\n";
|
565 |
/**/
|
566 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
567 |
/**/
|
568 |
-
|
569 |
-
|
570 |
/**/
|
571 |
-
|
572 |
/**/
|
573 |
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";
|
574 |
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";
|
@@ -588,70 +617,22 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
588 |
/**/
|
589 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
590 |
/**/
|
591 |
-
echo '<p><strong>
|
592 |
-
/**/
|
593 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
594 |
-
/**/
|
595 |
-
echo '<p><strong>S2MEMBER_LEVEL1_LABEL</strong><br />This is the (string) Label that you created for Membership Level 1.</p>' . "\n";
|
596 |
/**/
|
597 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
598 |
/**/
|
599 |
-
echo '<p><strong>
|
600 |
/**/
|
601 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
602 |
/**/
|
603 |
-
echo '<p><strong>
|
604 |
/**/
|
605 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
606 |
/**/
|
607 |
-
echo '<p><strong>
|
608 |
/**/
|
609 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
610 |
/**/
|
611 |
-
#echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 0.</p>' . "\n";
|
612 |
-
/**/
|
613 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
614 |
-
/**/
|
615 |
-
#echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 1.</p>' . "\n";
|
616 |
-
/**/
|
617 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
618 |
-
/**/
|
619 |
-
#echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 2.</p>' . "\n";
|
620 |
-
/**/
|
621 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
622 |
-
/**/
|
623 |
-
#echo '<p><strong>S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 3.</p>' . "\n";
|
624 |
-
/**/
|
625 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
626 |
-
/**/
|
627 |
-
#echo '<p><strong>S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 4.</p>' . "\n";
|
628 |
-
/**/
|
629 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
630 |
-
/**/
|
631 |
-
#echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 0.</p>' . "\n";
|
632 |
-
/**/
|
633 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
634 |
-
/**/
|
635 |
-
#echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 1.</p>' . "\n";
|
636 |
-
/**/
|
637 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
638 |
-
/**/
|
639 |
-
#echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 2.</p>' . "\n";
|
640 |
-
/**/
|
641 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
642 |
-
/**/
|
643 |
-
#echo '<p><strong>S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 3.</p>' . "\n";
|
644 |
-
/**/
|
645 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
646 |
-
/**/
|
647 |
-
#echo '<p><strong>S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 4.</p>' . "\n";
|
648 |
-
/**/
|
649 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
650 |
-
/**/
|
651 |
-
#echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
|
652 |
-
/**/
|
653 |
-
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
654 |
-
/**/
|
655 |
echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
|
656 |
/**/
|
657 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -668,11 +649,15 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
668 |
/**/
|
669 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
670 |
/**/
|
671 |
-
echo '<p><strong>
|
672 |
/**/
|
673 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
674 |
/**/
|
675 |
-
echo '<p><strong>
|
|
|
|
|
|
|
|
|
676 |
/**/
|
677 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
678 |
/**/
|
@@ -694,9 +679,13 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
694 |
/**/
|
695 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants_farm", get_defined_vars ());
|
696 |
/**/
|
697 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal® Button Codes. 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>"Referencing Customer ID"</code>. Otherwise, it will be
|
698 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal® Button Codes. 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_OR_WP_ID</code>. Otherwise, it will be
|
699 |
-
|
|
|
|
|
|
|
|
|
700 |
/**/
|
701 |
echo '</div>' . "\n";
|
702 |
/**/
|
@@ -708,8 +697,8 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
708 |
/**/
|
709 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-constants-section">' . "\n";
|
710 |
echo '<h3>You Have Access To PHP Constants ( some PHP scripting required )</h3>' . "\n";
|
711 |
-
echo '<p>A Constant, is an identifier ( name ) for a simple value in PHP scripting. Below is a comprehensive list that includes all of the PHP defined Constants available to you. All of these Constants are also available through JavaScript as Global Variables. Example code has been provided in the documentation below. If you\'re a web developer, we suggest using some of these Constants in the creation of your Login Welcome Page; which is described in the s2Member General Options Panel.
|
712 |
-
echo '<p>
|
713 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_constants", get_defined_vars ());
|
714 |
/**/
|
715 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -719,7 +708,12 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
719 |
/**/
|
720 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
721 |
/**/
|
722 |
-
echo '<p><strong>
|
|
|
|
|
|
|
|
|
|
|
723 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/version.php")) . '</p>' . "\n";
|
724 |
/**/
|
725 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -736,7 +730,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
736 |
/**/
|
737 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
738 |
/**/
|
739 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int)
|
740 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-level.php")) . '</p>' . "\n";
|
741 |
echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
|
742 |
echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 & 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 & 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 & 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.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
|
@@ -814,17 +808,22 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
814 |
/**/
|
815 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
816 |
/**/
|
817 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address. Empty if browsing anonymously.</p>' . "\n";
|
818 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-ip.php")) . '</p>' . "\n";
|
819 |
/**/
|
820 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
821 |
/**/
|
|
|
|
|
|
|
|
|
|
|
822 |
echo '<p><strong>S2MEMBER_CURRENT_USER_ID</strong><br />This will always be an (int) containing the current User\'s ID# in WordPress®. However, it will be 0 if not logged in.</p>' . "\n";
|
823 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-id.php")) . '</p>' . "\n";
|
824 |
/**/
|
825 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
826 |
/**/
|
827 |
-
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, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array.
|
828 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-fields.php")) . '</p>' . "\n";
|
829 |
/**/
|
830 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -849,7 +848,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
849 |
/**/
|
850 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
851 |
/**/
|
852 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile.</p>' . "\n";
|
853 |
echo '<p><strong>Code Sample #1</strong> ( standard link ):</p>' . "\n";
|
854 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php")) . '</p>' . "\n";
|
855 |
echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
|
@@ -887,78 +886,18 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
887 |
/**/
|
888 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
889 |
/**/
|
890 |
-
echo '<p><strong>
|
891 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/
|
892 |
-
/**/
|
893 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
894 |
-
/**/
|
895 |
-
echo '<p><strong>S2MEMBER_LEVEL1_LABEL</strong><br />This is the (string) Label that you created for Membership Level 1.</p>' . "\n";
|
896 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level1-label.php")) . '</p>' . "\n";
|
897 |
-
/**/
|
898 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
899 |
-
/**/
|
900 |
-
echo '<p><strong>S2MEMBER_LEVEL2_LABEL</strong><br />This is the (string) Label that you created for Membership Level 2.</p>' . "\n";
|
901 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level2-label.php")) . '</p>' . "\n";
|
902 |
-
/**/
|
903 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
904 |
-
/**/
|
905 |
-
echo '<p><strong>S2MEMBER_LEVEL3_LABEL</strong><br />This is the (string) Label that you created for Membership Level 3.</p>' . "\n";
|
906 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level3-label.php")) . '</p>' . "\n";
|
907 |
-
/**/
|
908 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
909 |
-
/**/
|
910 |
-
echo '<p><strong>S2MEMBER_LEVEL4_LABEL</strong><br />This is the (string) Label that you created for Membership Level 4.</p>' . "\n";
|
911 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level4-label.php")) . '</p>' . "\n";
|
912 |
-
/**/
|
913 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
914 |
-
/**/
|
915 |
-
echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 0.</p>' . "\n";
|
916 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level0-file-downloads-allowed.php")) . '</p>' . "\n";
|
917 |
-
/**/
|
918 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
919 |
-
/**/
|
920 |
-
echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 1.</p>' . "\n";
|
921 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level1-file-downloads-allowed.php")) . '</p>' . "\n";
|
922 |
-
/**/
|
923 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
924 |
-
/**/
|
925 |
-
echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 2.</p>' . "\n";
|
926 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level2-file-downloads-allowed.php")) . '</p>' . "\n";
|
927 |
-
/**/
|
928 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
929 |
-
/**/
|
930 |
-
echo '<p><strong>S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 3.</p>' . "\n";
|
931 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level3-file-downloads-allowed.php")) . '</p>' . "\n";
|
932 |
-
/**/
|
933 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
934 |
-
/**/
|
935 |
-
echo '<p><strong>S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for Level 4.</p>' . "\n";
|
936 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level4-file-downloads-allowed.php")) . '</p>' . "\n";
|
937 |
-
/**/
|
938 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
939 |
-
/**/
|
940 |
-
echo '<p><strong>S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 0.</p>' . "\n";
|
941 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level0-file-downloads-allowed-days.php")) . '</p>' . "\n";
|
942 |
-
/**/
|
943 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
944 |
-
/**/
|
945 |
-
echo '<p><strong>S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 1.</p>' . "\n";
|
946 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level1-file-downloads-allowed-days.php")) . '</p>' . "\n";
|
947 |
-
/**/
|
948 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
949 |
-
/**/
|
950 |
-
echo '<p><strong>S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for Level 2.</p>' . "\n";
|
951 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/level2-file-downloads-allowed-days.php")) . '</p>' . "\n";
|
952 |
/**/
|
953 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
954 |
/**/
|
955 |
-
echo '<p><strong>
|
956 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/
|
957 |
/**/
|
958 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
959 |
/**/
|
960 |
-
echo '<p><strong>
|
961 |
-
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/
|
962 |
/**/
|
963 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
964 |
/**/
|
@@ -987,12 +926,12 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
987 |
/**/
|
988 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
989 |
/**/
|
990 |
-
echo '<p><strong>S2MEMBER_PAYPAL_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal® server
|
991 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-endpoint.php")) . '</p>' . "\n";
|
992 |
/**/
|
993 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
994 |
/**/
|
995 |
-
echo '<p><strong>S2MEMBER_PAYPAL_API_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal® API server
|
996 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-api-endpoint.php")) . '</p>' . "\n";
|
997 |
/**/
|
998 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
@@ -1028,10 +967,15 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
1028 |
/**/
|
1029 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants", get_defined_vars ());
|
1030 |
/**/
|
1031 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal® Button Codes. 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>"Referencing Customer ID"</code>. Otherwise, it will be
|
1032 |
-
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal® Button Codes. 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_OR_WP_ID</code>. Otherwise, it will be
|
1033 |
-
|
1034 |
-
echo '<p><
|
|
|
|
|
|
|
|
|
|
|
1035 |
/**/
|
1036 |
echo '</div>' . "\n";
|
1037 |
/**/
|
@@ -1041,7 +985,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
1041 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_constants", get_defined_vars ());
|
1042 |
}
|
1043 |
/**/
|
1044 |
-
if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_js_globals",
|
1045 |
{
|
1046 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_js_globals", get_defined_vars ());
|
1047 |
/**/
|
@@ -1049,7 +993,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
1049 |
/**/
|
1050 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-js-globals-section">' . "\n";
|
1051 |
echo '<h3>You Also Have Access To JS Globals ( some JavaScript knowledge required )</h3>' . "\n";
|
1052 |
-
echo '<p>Unless noted otherwise, all of the PHP Constants, are also available through JavaScript, as Global Variables ( with the exact same names/types as their PHP counterparts )
|
1053 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_js_globals", get_defined_vars ());
|
1054 |
echo '</div>' . "\n";
|
1055 |
/**/
|
@@ -1066,9 +1010,17 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
1066 |
/**/
|
1067 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-mop-vars-section">' . "\n";
|
1068 |
echo '<h3>Membership Options Page Variables ( some scripting required )</h3>' . "\n";
|
1069 |
-
echo '<p>At the core of s2Member, is it\'s ability to protect content ( i.e. Posts, Pages, Tags, Categories, URI word fragments, etc )
|
1070 |
-
echo '<p>Understanding this, it becomes important for s2Member to provide information about what the User/Member was attempting to access <
|
1071 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_mop_vars", get_defined_vars ());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1072 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/api-mop-vars.php")) . '</p>' . "\n";
|
1073 |
echo '</div>' . "\n";
|
1074 |
/**/
|
@@ -1081,13 +1033,18 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
|
1081 |
{
|
1082 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_hooks", get_defined_vars ());
|
1083 |
/**/
|
1084 |
-
echo '<div class="ws-menu-page-group" title="
|
1085 |
/**/
|
1086 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-hooks-section">' . "\n";
|
1087 |
echo '<h3>WP® Hooks For Theme/Plugin Developers ( scripting required )</h3>' . "\n";
|
1088 |
-
echo '<p>In addition to its API Constants, s2Member also makes several Hooks/Filters available throughout its framework. This makes it possible to build onto ( or even modify ) s2Member in lots of different ways. If you need to add custom processing routines, modify the behavior of existing processing routines, or tinker with things otherwise; you should use API Hooks/Filters. API Hooks & Filters, give you the ability to "hook into", and/or "filter" processing routines, with files/functions of your own; instead of editing the s2Member plugin files directly. If you don\'t use a Hook/Filter, and instead, you edit the plugin files for s2Member, you\'ll have to merge all of your changes every time a new version of s2Member is released. If you create custom processing routines, you could place those routines into a PHP file here: <code>/wp-content/mu-plugins/
|
1089 |
-
echo '<p>
|
1090 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_hooks", get_defined_vars ());
|
|
|
|
|
|
|
|
|
|
|
1091 |
echo '</div>' . "\n";
|
1092 |
/**/
|
1093 |
echo '</div>' . "\n";
|
15 |
* @since 3.0
|
16 |
*/
|
17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
18 |
+
exit("Do not access this file directly.");
|
19 |
/**/
|
20 |
if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
|
21 |
{
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® API / Scripting</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
62 |
{
|
63 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_simple_way", get_defined_vars ());
|
64 |
/**/
|
65 |
+
if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) /* Two versions. */
|
66 |
{
|
67 |
+
echo '<div class="ws-menu-page-group" title="Simple/Shortcode Conditionals">' . "\n";
|
68 |
/**/
|
69 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
|
70 |
echo '<h3>Simple Conditionals ( via WordPress® Shortcodes )</h3>' . "\n";
|
71 |
+
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>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</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>. 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 Member\'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";
|
72 |
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";
|
73 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way_farm", get_defined_vars ());
|
74 |
/**/
|
110 |
/**/
|
111 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
112 |
/**/
|
113 |
+
echo '<p><em><strong>s2Member supports many <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank" rel="external">Conditional Tags</a> in WordPress®.</strong> Including: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</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>is_admin()</code></strong>, <strong><code>is_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_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_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_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>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>.</em></p>' . "\n";
|
114 |
/**/
|
115 |
echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
|
116 |
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";
|
126 |
}
|
127 |
else /* Otherwise, we can display the standardized version of this information. */
|
128 |
{
|
129 |
+
echo '<div class="ws-menu-page-group" title="Simple/Shortcode Conditionals">' . "\n";
|
130 |
/**/
|
131 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-simple-way-section">' . "\n";
|
132 |
echo '<h3>Simple Conditionals ( via WordPress® Shortcodes )</h3>' . "\n";
|
133 |
+
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>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</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 Member\'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";
|
134 |
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";
|
135 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_simple_way", get_defined_vars ());
|
136 |
/**/
|
137 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
138 |
/**/
|
139 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
140 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
141 |
+
/**/
|
142 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
143 |
+
/**/
|
144 |
echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
|
145 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/sc-is-user-logged-in.php")) . '</p>' . "\n";
|
146 |
/**/
|
177 |
/**/
|
178 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
179 |
/**/
|
180 |
+
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_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</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>, <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_blog_admin()</code></strong>, <strong><code>is_user_admin()</code></strong>, <strong><code>is_network_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>is_comments_popup()</code></strong>, <strong><code>in_the_loop()</code></strong>, <strong><code>comments_open()</code></strong>, <strong><code>pings_open()</code></strong>, <strong><code>has_excerpt(ID)</code></strong>, <strong><code>has_post_thumbnail(ID)</code></strong>, <strong><code>is_active_sidebar(ID|number)</code></strong>.</em></p>' . "\n";
|
181 |
/**/
|
182 |
echo '<p><em><strong>Passing arguments into a Simple Conditional:</strong></em></p>' . "\n";
|
183 |
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";
|
199 |
{
|
200 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_advanced_way", get_defined_vars ());
|
201 |
/**/
|
202 |
+
echo '<div class="ws-menu-page-group" title="Advanced/PHP Conditionals">' . "\n";
|
203 |
/**/
|
204 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
|
205 |
echo '<h3>The Advanced Way ( some PHP scripting required )</h3>' . "\n";
|
206 |
+
echo '<p>In an effort to give you even more control over access restrictions, s2Member makes some PHP functions, and also some PHP Constants, available to you from within WordPress®. In this section, we\'ll demonstrate several functions: <strong><code>is_user_logged_in()</code></strong>, <strong><code>is_user_not_logged_in()</code></strong>, <strong><code>user_is(user_id, role)</code></strong>, <strong><code>user_is_not(user_id, role)</code></strong>, <strong><code>user_can(user_id, capability)</code></strong>, <strong><code>user_cannot(user_id, capability)</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 PHP code samples below. Using PHP, is a very powerful way to build Advanced Conditionals within your content; based on a Member\'s Level, Custom Capabilities, and/or other factors. 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/php-execution-plugin/" target="_blank" rel="external">PHP Execution</a> ).</p>' . "\n";
|
207 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_advanced_way", get_defined_vars ());
|
208 |
/**/
|
209 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
210 |
/**/
|
211 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
212 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
213 |
+
/**/
|
214 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
215 |
+
/**/
|
216 |
echo '<p><strong>Example #1:</strong> Full access for anyone that is logged in.</strong></p>' . "\n";
|
217 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/is-user-logged-in.php")) . '</p>' . "\n";
|
218 |
/**/
|
267 |
{
|
268 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_queries", get_defined_vars ());
|
269 |
/**/
|
270 |
+
echo '<div class="ws-menu-page-group" title="Advanced/PHP Query Conditionals">' . "\n";
|
271 |
/**/
|
272 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-advanced-way-section">' . "\n";
|
273 |
echo '<h3>Advanced Query Conditionals ( some PHP scripting required )</h3>' . "\n";
|
277 |
/**/
|
278 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
279 |
/**/
|
280 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
281 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
282 |
+
/**/
|
283 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
284 |
+
/**/
|
285 |
echo '<p><strong>Example #1:</strong> Pre-filtering custom queries in WordPress®.</strong></p>' . "\n";
|
286 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/custom-queries.php")) . '</p>' . "\n";
|
287 |
/**/
|
309 |
/**/
|
310 |
echo '<p><strong>Example #6:</strong> Checking Post Restrictions, including Custom Post Types.</strong></p>' . "\n";
|
311 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/specific-post-restrictions.php")) . '</p>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
312 |
echo '</div>' . "\n";
|
313 |
/**/
|
314 |
echo '</div>' . "\n";
|
324 |
/**/
|
325 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-custom-capabilities-section">' . "\n";
|
326 |
echo '<h3>Packaging Together Custom Capabilities w/ Membership</h3>' . "\n";
|
327 |
+
echo '<p>Using one of s2Member\'s Payment Button and/or Form Generators, you can add Custom Capabilities in comma-delimited format. s2Member builds upon existing functionality offered by <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank" rel="external">WordPress® Roles/Capabilities</a>. s2Member supports Free Subscribers <em>( at Level #0 )</em>, and several Primary Roles created by the s2Member plugin <em>( i.e. s2Member Levels 1-4, or up to the number of configured Levels )</em>. Each s2Member Level <em>( aka: s2Member Role )</em> provides the Capability <code>current_user_can("access_s2member_level0"), 1, 2, 3, 4</code>, where <code>access_s2member_level[0-4]</code> is the Capability associated with each Role; and Membership Levels provide incremental access <em>( i.e. Level #4 Members can also access content at Levels 0, 1, 2, and 3 beneath them )</em>. In short, these Level-based permissions are the default Capabilities that come with each Membership Level being sold on your site.</p>' . "\n";
|
328 |
+
echo '<p>Now, if you\'d like to package together some variations of each Membership Level that you\'re selling, you can! All you do is add <strong>Custom Capabilities</strong> whenever you create your Payment Button and/or Form Shortcode ( <em>there is a field in the Button & Form Generators where you can enter Custom Capabilities</em> ). You can sell Membership Packages that come with Custom Capabilities, and even with custom prices.</p>' . "\n";
|
329 |
echo '<p>Custom Capabilities are an extension to a feature that already exists in WordPress®. The <code>current_user_can()</code> function, can be used to test for these additional Capabilities that you allow. Whenever a Member completes the checkout process, after having purchased a Membership from you ( one that included Custom Capabilities ), s2Member will add those Custom Capabilities to the account for that specific Member.</p>' . "\n";
|
330 |
echo '<p>Custom Capabilities are always prepended with <code>access_s2member_ccap_</code>. You fill in the last part, with ONLY lowercase alpha-numerics and/or underscores. For example, let\'s say you want to sell Membership Level #1, as is. But, you also want to sell a slight variation of Membership Level #1, that includes the ability to access the Music & Video sections of your site. So, instead of selling this additional access under a whole new Membership Level, you could just sell a modified version of Membership Level #1. Add the the Custom Capabilities: <code>music,videos</code>. Once a Member has these Capabilities, you can test for these Capabilities using <code>current_user_can("access_s2member_ccap_music")</code> and <code>current_user_can("access_s2member_ccap_videos")</code>.</p>' . "\n";
|
331 |
+
echo '<p>The important thing to realize, is that Custom Capabilities, are just that. They\'re custom. s2Member only deals with the default Capabilities that it uses. If you start using Custom Capabilities, you MUST use Simple or Advanced Conditionals ( <em>i.e. <code>current_user_can()</code> logic</em> ) to test for them. Either in your theme files with PHP, or in Posts/Pages using Simple Conditionals <em>( powered by Shortcodes )</em>.</p>' . "\n";
|
332 |
+
echo '<p><strong>*New*</strong> Starting with s2Member v3.2+, you can now tell s2Member to require certain Custom Capabilities on a per Post/Page basis. So now, s2Member <em>( if you prefer )</em> CAN handle Custom Capabilities for you automatically! Whenever you edit a Post/Page, you can tell s2Member <em>( i.e. there is a Meta Box for s2Member in your Post/Page editing station )</em>... you can tell s2Member to require certain Custom Capabilities that you type in, using comma-delimited format. In other words, you will need to type in some of the trigger words that you used whenever you created your Payment Buttons/Forms. This way paying Members will have the Custom Capabilities to view different kinds of content that you offer.</p>' . "\n";
|
333 |
+
echo '<p><strong>*New*</strong> By default, a Checkout Button or Form generated by s2Member is designed to set and/or reset a Member\'s Custom Capabilities to the ones you specify in the Button/Form Code. However, starting with s2Member v3.5+, you can tell s2Member to (ADD) additional Custom Capabilities to any that already exist for a particular Member. This is accomplished on a per Form/Button basis by preceding your comma-delimited list of Custom Capabilities with a (+) sign. For further details on this topic, click the <a href="#" onclick="alert(\'*ADVANCED TIP: You can specifiy a comma-delimited list of Custom Capabilities that come with a purchase. Or, you could tell s2Member to (ADD) Custom Capabilities to any that already exist for a particular Member. Just start your list of Custom Capabilities with a (+) sign.\\n\\nSo instead of setting a Member\\\'s full set of Custom Capabilities to:\\nmusic,videos,archives,gifts\\n\\nYou could (ADD) new ones to any that already exist:\\n+calendar,forums,tools\\n\\nOr to prevent any changes, (ADD) nothing:\\n+\'); return false;" tabindex="-1">[?]</a> icon next to the Custom Capabilities field in any Button/Form Generator supplied by s2Member.</p>' . "\n";
|
334 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_custom_capabilities", get_defined_vars ());
|
335 |
/**/
|
336 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
337 |
/**/
|
338 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
339 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.<br />' . "\n";
|
340 |
+
echo '<strong>See Also:</strong> <a href="http://wordpress.org/extend/plugins/user-role-editor/" target="_blank" rel="external">Plugins -> User Role Editor</a> <em>( may come in handy for some )</em>.</p>' . "\n";
|
341 |
+
/**/
|
342 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
343 |
+
/**/
|
344 |
echo '<p><strong>Custom Capabilities:</strong> ( music,videos ):</p>' . "\n";
|
345 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-can-ccaps-1.php")) . '</p>' . "\n";
|
346 |
/**/
|
367 |
/**/
|
368 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
369 |
/**/
|
370 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
371 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
372 |
+
/**/
|
373 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
374 |
+
/**/
|
375 |
echo '<p><strong>Custom Capabilities:</strong> ( music,videos )</p>' . "\n";
|
376 |
echo '<p>Sub-Directory: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music</code><br />Sub-Directory: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos</code></p>' . "\n";
|
377 |
echo '<p>Protected File: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-music/file.mp3</code><br />Protected File: <code>/' . esc_html (c_ws_plugin__s2member_utils_dirs::basename_dirs ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) . '/access-s2member-ccap-videos/file.avi</code></p>' . "\n";
|
407 |
/**/
|
408 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
409 |
/**/
|
410 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
411 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
412 |
+
/**/
|
413 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
414 |
+
/**/
|
415 |
echo '<p><strong>To drip content using <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>:</strong></p>' . "\n";
|
416 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-paid-registration-days-dripping.php")) . '</p>' . "\n";
|
417 |
/**/
|
448 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
449 |
/**/
|
450 |
echo '<p><strong>Shortcode:</strong> for an Inline Profile Modification Form:<br />' . "\n";
|
451 |
+
echo '<p><input type="text" value="' . format_to_edit ('[s2Member-Profile /]') . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
|
452 |
/**/
|
453 |
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( standard link tag ):</p>' . "\n";
|
454 |
+
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1-ops.php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
|
455 |
/**/
|
456 |
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( open the link in a popup window ):</p>' . "\n";
|
457 |
+
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
|
458 |
/**/
|
459 |
echo '<p style="margin-top:20px;"><strong>Stand-Alone / Code Sample</strong> ( embed the Form with an IFRAME tag ):</p>' . "\n";
|
460 |
+
echo '<p><input type="text" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-3-ops.php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
|
461 |
echo '</div>' . "\n";
|
462 |
/**/
|
463 |
echo '</div>' . "\n";
|
469 |
{
|
470 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_constants", get_defined_vars ());
|
471 |
/**/
|
472 |
+
if (is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) /* Two versions. */
|
473 |
{
|
474 |
echo '<div class="ws-menu-page-group" title="s2Get / s2Member API Constants">' . "\n";
|
475 |
/**/
|
476 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-constants-section">' . "\n";
|
477 |
echo '<h3>Using s2Get w/ s2Member API Constants</h3>' . "\n";
|
478 |
+
echo '<p>A Constant, is an identifier ( a name ) for a simple value. Below is a comprehensive list that includes all of the defined Constants available to you. We recommend using some of these Constants in the creation of your Login Welcome Page; which is described in the s2Member General Options Panel. These are NOT required, but you can get pretty creative with your Login Welcome Page if you know how to use the <code>[s2Get constant="" /]</code> Shortcode for WordPress®.</p>' . "\n";
|
479 |
echo '<p>For example, you might use <code>[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]</code> to display the type of Membership a Customer has.</em></p>' . "\n";
|
480 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_constants_farm", get_defined_vars ());
|
481 |
/**/
|
482 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
483 |
/**/
|
484 |
+
echo '<p><strong>S2MEMBER_VERSION</strong><br />This will always be a (string) with the current s2Member version. Available since s2Member 3.0. Dated versions began with s2Member v110604.</p>' . "\n";
|
485 |
/**/
|
486 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
487 |
/**/
|
488 |
+
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";
|
489 |
+
echo '<p><em>See: <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
|
490 |
/**/
|
491 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
492 |
/**/
|
493 |
+
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";
|
494 |
+
echo '<p><em>See: <code>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</code> below for a full explanation.</em></p>' . "\n";
|
495 |
/**/
|
496 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
497 |
/**/
|
498 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) <code>-1</code> thru <code>4</code> <em>( or, up to the total number Membership Levels you\'ve configured )</em>. <code>-1</code> if not logged in. <code>0</code> if logged in as a Free Subscriber.</p>' . "\n";
|
499 |
echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
|
500 |
echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 & 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 & 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 & 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.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
|
501 |
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";
|
526 |
/**/
|
527 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
528 |
/**/
|
529 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>( i.e. if they\'re still a Free Subscriber )</em>. This holds the recorded time at which the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. This value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once this value is recorded, it never changes under any circumstance. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_REGISTRATION_TIME</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
|
530 |
/**/
|
531 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
532 |
/**/
|
533 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</strong><br />This will always be an (int); in the form of a Unix timestamp. However, this will be 0 if they\'re not logged in; or if they\'ve never paid you at all <em>( i.e. if they\'re still a Free Subscriber )</em>. This is the number of days that have passed since the Member originally registered their Username (or upgraded for) any type of "paid" access to your site. The underlying timestamp behind this value is preserved for the lifetime of their account, even if they upgrade, and even if they\'re demoted at some point. Once the underlying timestamp behind this value is recorded, it never changes under any circumstance. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
|
534 |
/**/
|
535 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
536 |
/**/
|
537 |
+
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 User originally registered their Username for access to your site; for free or otherwise. <strong>* Note:</strong> this is NOT the same as <code>S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS</code>, which could be used as an alternative, depending on your intended usage.</p>' . "\n";
|
538 |
/**/
|
539 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
540 |
/**/
|
558 |
/**/
|
559 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
560 |
/**/
|
561 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address, even when/if NOT logged-in. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if browsing anonymously.</p>' . "\n";
|
562 |
+
/**/
|
563 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
564 |
+
/**/
|
565 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_IP</strong><br />This is a (string) containing the IP Address the current User had at the time they registered. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if not logged in.</p>' . "\n";
|
566 |
/**/
|
567 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
568 |
/**/
|
570 |
/**/
|
571 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
572 |
/**/
|
573 |
+
#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, reg_ip, email, login, first_name, last_name, display_name, subscr_id, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. You can do <code>print_r(json_decode(S2MEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
|
574 |
/**/
|
575 |
#echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
576 |
/**/
|
577 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'re allowed to download. 0 means no access.</p>' . "\n";
|
578 |
/**/
|
579 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
580 |
/**/
|
581 |
+
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";
|
582 |
/**/
|
583 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
584 |
/**/
|
585 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY</strong><br />This will always be an (int) value >= 0. This indicates how many unique files they\'ve downloaded in the current period.</p>' . "\n";
|
586 |
/**/
|
587 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
588 |
/**/
|
589 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS</strong><br />This will always be an (int) value >= 0. This indicates how many total days make up the current period. 0 means no access.</p>' . "\n";
|
590 |
/**/
|
591 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
592 |
/**/
|
593 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile. In addition to this Stand-Alone version, s2Member also makes a Shortcode available which produces an Inline Profile Editing Form. Use <code>[s2Member-Profile /]</code> in any Post/Page, or even in a Text Widget if you like.</p>' . "\n";
|
594 |
/**/
|
595 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
596 |
/**/
|
597 |
+
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";
|
598 |
+
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";
|
599 |
/**/
|
600 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
601 |
/**/
|
602 |
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";
|
603 |
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";
|
617 |
/**/
|
618 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
619 |
/**/
|
620 |
+
echo '<p><strong>S2MEMBER_LEVELn_LABEL</strong><br />This is the (string) Label that you configured for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
|
|
|
|
|
|
|
|
|
621 |
/**/
|
622 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
623 |
/**/
|
624 |
+
echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
|
625 |
/**/
|
626 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
627 |
/**/
|
628 |
+
echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
|
629 |
/**/
|
630 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
631 |
/**/
|
632 |
+
echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
|
633 |
/**/
|
634 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
635 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
636 |
echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
|
637 |
/**/
|
638 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
649 |
/**/
|
650 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
651 |
/**/
|
652 |
+
echo '<p><strong>S2MEMBER_PAYPAL_BUSINESS</strong><br />This is the Email Address that identifies your PayPal® Business.</p>' . "\n";
|
653 |
/**/
|
654 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
655 |
/**/
|
656 |
+
echo '<p><strong>S2MEMBER_PAYPAL_ENDPOINT</strong><br />PayPal® Endpoint Domain <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
|
657 |
+
/**/
|
658 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
659 |
+
/**/
|
660 |
+
echo '<p><strong>S2MEMBER_PAYPAL_API_ENDPOINT</strong><br />PayPal® API Endpoint Domain <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
|
661 |
/**/
|
662 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
663 |
/**/
|
679 |
/**/
|
680 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants_farm", get_defined_vars ());
|
681 |
/**/
|
682 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal® Button Codes. 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>"Referencing Customer ID"</code>. Otherwise, it will be set to a default value of: <code>"Originating Domain"</code>.</p>' . "\n";
|
683 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal® Button Codes. 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_OR_WP_ID</code>. Otherwise, it will be set to a default value of <code>$_SERVER["HTTP_HOST"]</code> <em>( the originating domain name )</em>.</p>' . "\n";
|
684 |
+
/**/
|
685 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1</strong> ... This auto-fills the <code>on1</code> value in PayPal® Button Codes. This always contains the string: <code>"Customer IP Address"</code>.</p>' . "\n";
|
686 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1</strong> ... This auto-fills the <code>os1</code> value in PayPal® Button Codes. This always contains the value of <code>$_SERVER["REMOTE_ADDR"]</code> <em>( the Customer\'s IP address )</em>.</p>' . "\n";
|
687 |
+
/**/
|
688 |
+
echo '<p><em>These four Constants above are special. They\'re 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. Specifically, these three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal® Buttons, 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 Generator pops them in.</em></p>' . "\n";
|
689 |
/**/
|
690 |
echo '</div>' . "\n";
|
691 |
/**/
|
697 |
/**/
|
698 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-constants-section">' . "\n";
|
699 |
echo '<h3>You Have Access To PHP Constants ( some PHP scripting required )</h3>' . "\n";
|
700 |
+
echo '<p>A Constant, is an identifier <em>( i.e. a name )</em> for a simple value in PHP scripting. Below is a comprehensive list that includes all of the PHP defined Constants available to you. All of these Constants are also available through JavaScript as Global Variables. Example code has been provided in the documentation below. If you\'re a web developer, we suggest using some of these Constants in the creation of your Login Welcome Page; which is described in the s2Member General Options Panel. These are NOT required, but you can get pretty creative with the Login Welcome Page, if you know a little PHP.</p>' . "\n";
|
701 |
+
echo '<p>If you don\'t know any PHP, you can use the <code>[s2Get constant="NAME_OF_CONSTANT" /]</code> Shortcode for WordPress®. For example, you might use <code>[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]</code> to display the type of Membership a Customer has. The <code>[s2Get constant="" /]</code> Shortcode will work for any of the API Constants documented below.</p>' . "\n";
|
702 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_constants", get_defined_vars ());
|
703 |
/**/
|
704 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
708 |
/**/
|
709 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
710 |
/**/
|
711 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
712 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
713 |
+
/**/
|
714 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
715 |
+
/**/
|
716 |
+
echo '<p><strong>S2MEMBER_VERSION</strong><br />This will always be a (string) with the current s2Member version. Available since s2Member 3.0. Dated versions began with s2Member v110604.</p>' . "\n";
|
717 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/version.php")) . '</p>' . "\n";
|
718 |
/**/
|
719 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
730 |
/**/
|
731 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
732 |
/**/
|
733 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_ACCESS_LEVEL</strong><br />This will always be (int) <code>-1</code> thru <code>4</code> <em>( or, up to the total number Membership Levels you\'ve configured )</em>. <code>-1</code> if not logged in. <code>0</code> if logged in as a Free Subscriber.</p>' . "\n";
|
734 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-access-level.php")) . '</p>' . "\n";
|
735 |
echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
|
736 |
echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 & 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 & 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 & 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.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
|
808 |
/**/
|
809 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
810 |
/**/
|
811 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_IP</strong><br />This will always be a (string) containing the current User\'s IP Address, even when/if NOT logged in. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if browsing anonymously.</p>' . "\n";
|
812 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-ip.php")) . '</p>' . "\n";
|
813 |
/**/
|
814 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
815 |
/**/
|
816 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_REGISTRATION_IP</strong><br />This will always be a (string) containing the current User\'s original IP Address during registration. Taken from <code>$_SERVER["REMOTE_ADDR"]</code>. Empty if not logged in.</p>' . "\n";
|
817 |
+
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-registration-ip.php")) . '</p>' . "\n";
|
818 |
+
/**/
|
819 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
820 |
+
/**/
|
821 |
echo '<p><strong>S2MEMBER_CURRENT_USER_ID</strong><br />This will always be an (int) containing the current User\'s ID# in WordPress®. However, it will be 0 if not logged in.</p>' . "\n";
|
822 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-id.php")) . '</p>' . "\n";
|
823 |
/**/
|
824 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
825 |
/**/
|
826 |
+
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, reg_ip, email, login, first_name, last_name, display_name, subscr_id, subscr_or_wp_id, subscr_gateway, custom</code>. If you\'ve configured additional Custom Fields, those Custom Fields will also be added to this array. You can do <code>print_r(json_decode(S2MEMBER_CURRENT_USER_FIELDS, true));</code> to get a full list for testing.</p>' . "\n";
|
827 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-fields.php")) . '</p>' . "\n";
|
828 |
/**/
|
829 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
848 |
/**/
|
849 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
850 |
/**/
|
851 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL</strong><br />This is a Stand-Alone URL where a User can modify their Profile. In addition to this Stand-Alone version, s2Member also makes a Shortcode available which produces an Inline Profile Editing Form. Use <code>[s2Member-Profile /]</code> in any Post/Page, or even in a Text Widget if you like.</p>' . "\n";
|
852 |
echo '<p><strong>Code Sample #1</strong> ( standard link ):</p>' . "\n";
|
853 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-1.php")) . '</p>' . "\n";
|
854 |
echo '<p><strong>Code Sample #2</strong> ( open the link in a popup window ):</p>' . "\n";
|
886 |
/**/
|
887 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
888 |
/**/
|
889 |
+
echo '<p><strong>S2MEMBER_LEVELn_LABEL</strong><br />This is the (string) Label that you created for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #..</p>' . "\n";
|
890 |
+
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/leveln-label.php")) . '</p>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
891 |
/**/
|
892 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
893 |
/**/
|
894 |
+
echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED</strong><br />This is the (int) allowed downloads for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
|
895 |
+
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/leveln-file-downloads-allowed.php")) . '</p>' . "\n";
|
896 |
/**/
|
897 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
898 |
/**/
|
899 |
+
echo '<p><strong>S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS</strong><br />This is the (int) allowed download days for a particular Membership Level #. Replace <code>n</code> with a numeric Membership Level #.</p>' . "\n";
|
900 |
+
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/leveln-file-downloads-allowed-days.php")) . '</p>' . "\n";
|
901 |
/**/
|
902 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
903 |
/**/
|
926 |
/**/
|
927 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
928 |
/**/
|
929 |
+
echo '<p><strong>S2MEMBER_PAYPAL_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal® server <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
|
930 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-endpoint.php")) . '</p>' . "\n";
|
931 |
/**/
|
932 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
933 |
/**/
|
934 |
+
echo '<p><strong>S2MEMBER_PAYPAL_API_ENDPOINT</strong><br />This is the Endpoint Domain to the PayPal® API server <em>( changes when Sandbox Mode is enabled )</em>.</p>' . "\n";
|
935 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/paypal-api-endpoint.php")) . '</p>' . "\n";
|
936 |
/**/
|
937 |
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
967 |
/**/
|
968 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_list_of_api_constants", get_defined_vars ());
|
969 |
/**/
|
970 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0</strong> ... This auto-fills the <code>on0</code> value in PayPal® Button Codes. 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>"Referencing Customer ID"</code>. Otherwise, it will be set to a default value of: <code>"Originating Domain"</code>.</p>' . "\n";
|
971 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0</strong> ... This auto-fills the <code>os0</code> value in PayPal® Button Codes. 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_OR_WP_ID</code>. Otherwise, it will be set to a default value of <code>$_SERVER["HTTP_HOST"]</code> <em>( the originating domain name )</em>.</p>' . "\n";
|
972 |
+
/**/
|
973 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1</strong> ... This auto-fills the <code>on1</code> value in PayPal® Button Codes. This always contains the string: <code>"Customer IP Address"</code>.</p>' . "\n";
|
974 |
+
echo '<p><strong>S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1</strong> ... This auto-fills the <code>os1</code> value in PayPal® Button Codes. This always contains the value of <code>$_SERVER["REMOTE_ADDR"]</code> <em>( the Customer\'s IP address )</em>.</p>' . "\n";
|
975 |
+
/**/
|
976 |
+
echo '<p><em>These four 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. Specifically, these three Button Code parameters: <code>on0, os0, modify</code>, work together in harmony. If you\'re using the Shortcode Format for PayPal® Buttons, 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 Generator pops them in.</em></p>' . "\n";
|
977 |
+
/**/
|
978 |
+
echo '<p><em>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/current-user-value-for-pp-on0-os0-on1-os1.php")) . '</em></p>' . "\n";
|
979 |
/**/
|
980 |
echo '</div>' . "\n";
|
981 |
/**/
|
985 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_after_api_constants", get_defined_vars ());
|
986 |
}
|
987 |
/**/
|
988 |
+
if (apply_filters ("ws_plugin__s2member_during_scripting_page_during_left_sections_display_api_js_globals", true, get_defined_vars ()))
|
989 |
{
|
990 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_js_globals", get_defined_vars ());
|
991 |
/**/
|
993 |
/**/
|
994 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-js-globals-section">' . "\n";
|
995 |
echo '<h3>You Also Have Access To JS Globals ( some JavaScript knowledge required )</h3>' . "\n";
|
996 |
+
echo '<p>Unless noted otherwise, all of the PHP Constants, are also available through JavaScript, as Global Variables <em>( with the exact same names/types as their PHP counterparts )</em>. s2Member automatically loads it\'s compressed JavaScript API into your theme for WordPress®. s2Member is very intelligent about the way it loads <em>( and maintains )</em> it\'s JavaScript API. You can rely on the JavaScript Globals, the same way you rely on PHP Constants. The only exceptions are related to security. Variables that include private server-side details, like Identity Tokens and other API service credentials, will be excluded automatically.</p>' . "\n";
|
997 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_js_globals", get_defined_vars ());
|
998 |
echo '</div>' . "\n";
|
999 |
/**/
|
1010 |
/**/
|
1011 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-mop-vars-section">' . "\n";
|
1012 |
echo '<h3>Membership Options Page Variables ( some scripting required )</h3>' . "\n";
|
1013 |
+
echo '<p>At the core of s2Member, is it\'s ability to protect content <em>( i.e. Posts, Pages, Tags, Categories, URI word fragments, etc )</em>. Whenever a public User, or even an existing Member attempts to access an area of your site that is unavailable to them; either because they are not logged-in, not a paying Member at all; or maybe they are logged-in, but they don\'t have access to content you\'ve protected at a higher Membership Level; s2Member will always redirect these unauthenticated requests to your Membership Options Page.</p>' . "\n";
|
1014 |
+
echo '<p>So your Membership Options Page is a key element of your site. It serves as the focal point of your s2Member installation. Understanding this, you can see it becomes important for s2Member to provide information about what the User/Member was attempting to access <em>( e.g. before they were redirected to the Membership Options Page )</em>. This is where s2Member\'s MOP Vars come in <em>( i.e. Membership Options Page Variables )</em>. Whenever s2Member redirects a User/Member to your Membership Options Page, it will include these important MOP Variables in the query string of the URL. These Variables can be used to provide more informative messages; or even to provide a different set of Membership Options <em>( i.e. Payment Buttons )</em>, based on what a User/Member was attempting to access.</p>' . "\n";
|
1015 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_mop_vars", get_defined_vars ());
|
1016 |
+
/**/
|
1017 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1018 |
+
/**/
|
1019 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
1020 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
1021 |
+
/**/
|
1022 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1023 |
+
/**/
|
1024 |
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/api-mop-vars.php")) . '</p>' . "\n";
|
1025 |
echo '</div>' . "\n";
|
1026 |
/**/
|
1033 |
{
|
1034 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_before_api_hooks", get_defined_vars ());
|
1035 |
/**/
|
1036 |
+
echo '<div class="ws-menu-page-group" title="Hooks/Filters ( For Developers )">' . "\n";
|
1037 |
/**/
|
1038 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-hooks-section">' . "\n";
|
1039 |
echo '<h3>WP® Hooks For Theme/Plugin Developers ( scripting required )</h3>' . "\n";
|
1040 |
+
echo '<p>In addition to its API Constants, s2Member also makes several Hooks/Filters available throughout its framework. This makes it possible to build onto ( or even modify ) s2Member in lots of different ways. If you need to add custom processing routines, modify the behavior of existing processing routines, or tinker with things otherwise; you should use API Hooks/Filters. API Hooks & Filters, give you the ability to "hook into", and/or "filter" processing routines, with files/functions of your own; instead of editing the s2Member plugin files directly. If you don\'t use a Hook/Filter, and instead, you edit the plugin files for s2Member, you\'ll have to merge all of your changes every time a new version of s2Member is released. If you create custom processing routines, you could place those routines into a PHP file here: <code>/wp-content/mu-plugins/s2-hacks.php</code>. If you don\'t have an <code>/mu-plugins/</code> directory, please create one. These are (mu) MUST USE plugins, which are loaded into WordPress® automatically; that\'s what you want!</p>' . "\n";
|
1041 |
+
echo '<p><strong>Attn Developers:</strong> There are simply too many Hooks/Filters spread throughout s2Member\'s framework <em>( over 1000 total )</em>. Rather than documenting each Hook/Filter, it is easier to browse through the files inside: <code>/s2member/includes/classes/</code>. Inspecting Hooks/Filters in this way, also leads you to a better understanding of how they work. One way to save time, is to run a search for <code>do_action</code> and/or <code>apply_filters</code>. If you\'re new to the concept of Hooks/Filters for WordPress/s2Member, we suggest <a href="http://www.primothemes.com/forums/viewforum.php?f=40#src_doc_overview_description" target="_blank" rel="external">this article</a> as a primer. The <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a> also contains information about all Hooks/Filters that come with s2Member.</p>' . "\n";
|
1042 |
do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_hooks", get_defined_vars ());
|
1043 |
+
/**/
|
1044 |
+
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
1045 |
+
/**/
|
1046 |
+
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
|
1047 |
+
echo '<strong>See Also:</strong> <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9012" target="_blank" rel="external">s2Member Codex -> API Constants</a>, and <a href="http://www.primothemes.com/forums/viewtopic.php?f=40&t=9017" target="_blank" rel="external">s2Member Codex -> API Functions</a>.</p>' . "\n";
|
1048 |
echo '</div>' . "\n";
|
1049 |
/**/
|
1050 |
echo '</div>' . "\n";
|
includes/menu-pages/start.inc.php
CHANGED
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_start"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
@@ -89,7 +87,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_start"))
|
|
89 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-reg-form-section">' . "\n";
|
90 |
echo '<h3>Your Login/Registration Form ( already built-in )</h3>' . "\n";
|
91 |
echo '<p>s2Member uses the existing WordPress® Login/Registration system. This is the same Login/Registration Form that you use to access your WP® Dashboard. However, with s2Member installed, your Login/Registration Forms can be customized <em>( re-branded )</em>. <em>See: <code>s2Member -> General Options -> Login/Registration Design</code>.</em> You can make the default Login/Registration Forms match your WordPress® theme design; by changing the background color/image, your logo image, add Custom Fields, and more<em>!</em></p>' . "\n";
|
92 |
-
echo '<p>Since s2Member uses the default Login/Registration system for WordPress®, s2Member is also compatible with themes, and other plugins ( such as BuddyPress )
|
93 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_log_reg_form", get_defined_vars ());
|
94 |
echo '</div>' . "\n";
|
95 |
/**/
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® / Quick-Start Guide</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
87 |
echo '<div class="ws-menu-page-section ws-plugin--s2member-login-reg-form-section">' . "\n";
|
88 |
echo '<h3>Your Login/Registration Form ( already built-in )</h3>' . "\n";
|
89 |
echo '<p>s2Member uses the existing WordPress® Login/Registration system. This is the same Login/Registration Form that you use to access your WP® Dashboard. However, with s2Member installed, your Login/Registration Forms can be customized <em>( re-branded )</em>. <em>See: <code>s2Member -> General Options -> Login/Registration Design</code>.</em> You can make the default Login/Registration Forms match your WordPress® theme design; by changing the background color/image, your logo image, add Custom Fields, and more<em>!</em></p>' . "\n";
|
90 |
+
echo '<p>Since s2Member uses the default Login/Registration system for WordPress®, s2Member is also compatible with themes, and other plugins <em>( such as BuddyPress )</em>. If your theme has a login form built-in already, chances are, it\'s perfectly compatible with s2Member. There are also many plugins available that are designed to place login forms into your Sidebar; and many of those are also compatible with s2Member\'s integration.</p>' . "\n";
|
91 |
do_action ("ws_plugin__s2member_during_start_page_during_left_sections_during_log_reg_form", get_defined_vars ());
|
92 |
echo '</div>' . "\n";
|
93 |
/**/
|
includes/menu-pages/trk-ops.inc.php
CHANGED
@@ -32,9 +32,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
|
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
-
echo '<h2
|
36 |
-
/**/
|
37 |
-
echo '<div class="ws-menu-page-hr"></div>' . "\n";
|
38 |
/**/
|
39 |
echo '<table class="ws-menu-page-table">' . "\n";
|
40 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
32 |
echo '<div class="wrap ws-menu-page">' . "\n";
|
33 |
/**/
|
34 |
echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
|
35 |
+
echo '<h2>s2Member® API / Tracking</h2>' . "\n";
|
|
|
|
|
36 |
/**/
|
37 |
echo '<table class="ws-menu-page-table">' . "\n";
|
38 |
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
|
includes/syscon.inc.php
CHANGED
@@ -28,7 +28,18 @@ content_url (preg_replace ("/^(.*?)\/" . preg_quote (basename (WP_CONTENT_DIR),
|
|
28 |
/*
|
29 |
Configure the number of Membership Levels being used with s2Member. This is NOT ready ( yet ). Some areas of s2Member are still hard-coded at 4 Levels + Subscribers.
|
30 |
*/
|
31 |
-
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
/*
|
33 |
Configure the directory for files protected by s2Member.
|
34 |
*/
|
@@ -58,6 +69,10 @@ Configure checksum time for the syscon.inc.php file.
|
|
58 |
*/
|
59 |
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["checksum"] = filemtime (__FILE__);
|
60 |
/*
|
|
|
|
|
|
|
|
|
61 |
Configure & validate all of the s2Member options; and set their defaults.
|
62 |
*/
|
63 |
if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"))
|
@@ -76,191 +91,169 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
|
|
76 |
*/
|
77 |
function ws_plugin__s2member_configure_options_and_their_defaults ($options = FALSE)
|
78 |
{
|
79 |
-
global $current_site, $current_blog;
|
80 |
-
/**/
|
81 |
-
$default_options =
|
82 |
-
|
83 |
-
|
84 |
-
"
|
85 |
-
/**/
|
86 |
-
"
|
87 |
-
|
88 |
-
"
|
89 |
-
|
90 |
-
"
|
91 |
-
|
92 |
-
"
|
93 |
-
|
94 |
-
"
|
95 |
-
/**/
|
96 |
-
"
|
97 |
-
|
98 |
-
"
|
99 |
-
"
|
100 |
-
"
|
101 |
-
"
|
102 |
-
"
|
103 |
-
"
|
104 |
-
"
|
105 |
-
"
|
106 |
-
|
107 |
-
|
108 |
-
"
|
109 |
-
"
|
110 |
-
|
111 |
-
"
|
112 |
-
"
|
113 |
-
"
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
"
|
118 |
-
"
|
119 |
-
|
120 |
-
|
121 |
-
"
|
122 |
-
"
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
"
|
127 |
-
|
128 |
-
|
129 |
-
"
|
130 |
-
"
|
131 |
-
|
132 |
-
|
133 |
-
"
|
134 |
-
|
135 |
-
"
|
136 |
-
"
|
137 |
-
|
138 |
-
|
139 |
-
"
|
140 |
-
|
141 |
-
|
142 |
-
"
|
143 |
-
/**/
|
144 |
-
"
|
145 |
-
"
|
146 |
-
/**/
|
147 |
-
"
|
148 |
-
"
|
149 |
-
"
|
150 |
-
|
151 |
-
"
|
152 |
-
"
|
153 |
-
"
|
154 |
-
|
155 |
-
"
|
156 |
-
"
|
157 |
-
"
|
158 |
-
|
159 |
-
|
160 |
-
"
|
161 |
-
"
|
162 |
-
"
|
163 |
-
|
164 |
-
|
165 |
-
"
|
166 |
-
|
167 |
-
"
|
168 |
-
|
169 |
-
"
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
"
|
178 |
-
|
179 |
-
"
|
180 |
-
"
|
181 |
-
"
|
182 |
-
"
|
183 |
-
"
|
184 |
-
"
|
185 |
-
"
|
186 |
-
|
187 |
-
"
|
188 |
-
|
189 |
-
"
|
190 |
-
"
|
191 |
-
"
|
192 |
-
"
|
193 |
-
"
|
194 |
-
"
|
195 |
-
"
|
196 |
-
|
197 |
-
"
|
198 |
-
|
199 |
-
|
200 |
-
"
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
/**/
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
"
|
209 |
-
"
|
210 |
-
|
211 |
-
"
|
212 |
-
|
213 |
-
"
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
"
|
231 |
-
/**/
|
232 |
-
"
|
233 |
-
"
|
234 |
-
"
|
235 |
-
"
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
"level4_ptags" => "", /* Comma-delimited list of Post/Page Tags to protect. */
|
243 |
-
/**/
|
244 |
-
"level0_posts" => "", /* Comma-delimited list of Post IDs to protect. */
|
245 |
-
"level1_posts" => "", /* Comma-delimited list of Post IDs to protect. */
|
246 |
-
"level2_posts" => "", /* Comma-delimited list of Post IDs to protect. */
|
247 |
-
"level3_posts" => "", /* Comma-delimited list of Post IDs to protect. */
|
248 |
-
"level4_posts" => "", /* Comma-delimited list of Post IDs to protect. */
|
249 |
-
/**/
|
250 |
-
"level0_pages" => "", /* Comma-delimited list of Page IDs to protect. */
|
251 |
-
"level1_pages" => "", /* Comma-delimited list of Page IDs to protect. */
|
252 |
-
"level2_pages" => "", /* Comma-delimited list of Page IDs to protect. */
|
253 |
-
"level3_pages" => "", /* Comma-delimited list of Page IDs to protect. */
|
254 |
-
"level4_pages" => "", /* Comma-delimited list of Page IDs to protect. */
|
255 |
-
/**/
|
256 |
-
"specific_ids" => "", /* Comma-delimited list of Specific Post/Page IDs. */
|
257 |
-
/**/
|
258 |
-
"triggers_immediate_eot" => "refunds,reversals", /* Immediate EOT? */
|
259 |
-
"membership_eot_behavior" => "demote", /* Demote or delete Members? */
|
260 |
-
"eot_time_ext_behavior" => "extend", /* Auto-extend? ( extend|reset ). */
|
261 |
-
"auto_eot_system_enabled" => "1", /* 0|1|2. 1 = WP-Cron, 2 = Cron tab. */
|
262 |
-
/**/
|
263 |
-
"wp_footer_code" => "")); /* Possible footer code. */
|
264 |
/*
|
265 |
Disable de-activation routines ( by default ) on a Multisite Blog Farm installation; excluding the Main Site.
|
266 |
*/
|
@@ -334,6 +327,9 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
|
|
334 |
else if (preg_match ("/^custom_reg_(names|password|opt_in|auto_opt_out_transitions)$/", $key) && (!is_string ($value) || !is_numeric ($value)))
|
335 |
$value = $default_options[$key];
|
336 |
/**/
|
|
|
|
|
|
|
337 |
else if ($key === "custom_reg_opt_in_label" && (!is_string ($value) || !strlen ($value)))
|
338 |
$value = $default_options[$key];
|
339 |
/**/
|
@@ -358,7 +354,7 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
|
|
358 |
else if ($key === "mms_registration_grants" && (!is_string ($value) || !preg_match ("/^(none|user|all)$/", $value)))
|
359 |
$value = $default_options[$key];
|
360 |
/**/
|
361 |
-
else if (preg_match ("/^mms_registration_blogs_level[0-
|
362 |
$value = $default_options[$key];
|
363 |
/**/
|
364 |
else if ($key === "force_admin_lockouts" && (!is_string ($value) || !is_numeric ($value)))
|
@@ -388,6 +384,12 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
|
|
388 |
else if (preg_match ("/^reg_email_from_(name|email)$/", $key) && (!is_string ($value) || !strlen ($value)))
|
389 |
$value = $default_options[$key];
|
390 |
/**/
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
else if ($key === "paypal_sandbox" && (!is_string ($value) || !is_numeric ($value)))
|
392 |
$value = $default_options[$key];
|
393 |
/**/
|
@@ -409,10 +411,10 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
|
|
409 |
else if ($key === "mailchimp_api_key" && (!is_string ($value) || !strlen ($value)))
|
410 |
$value = $default_options[$key];
|
411 |
/**/
|
412 |
-
else if (preg_match ("/^level[0-
|
413 |
$value = $default_options[$key];
|
414 |
/**/
|
415 |
-
else if (preg_match ("/^level[0-
|
416 |
$value = $default_options[$key];
|
417 |
/**/
|
418 |
else if (preg_match ("/^(signup|registration|payment|modification|cancellation|eot_del|ref_rev|sp_sale|sp_ref_rev)_notification_urls$/", $key) && (!is_string ($value) || !strlen ($value)))
|
@@ -421,16 +423,16 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
|
|
421 |
else if (preg_match ("/^(signup|registration|payment|modification|cancellation|eot_del|ref_rev|sp_sale|sp_ref_rev)_notification_recipients$/", $key) && (!is_string ($value) || !strlen ($value)))
|
422 |
$value = $default_options[$key];
|
423 |
/**/
|
424 |
-
else if (preg_match ("/^level[0-
|
425 |
$value = $default_options[$key];
|
426 |
/**/
|
427 |
else if ($key === "apply_label_translations" && (!is_string ($value) || !is_numeric ($value)))
|
428 |
$value = $default_options[$key];
|
429 |
/**/
|
430 |
-
else if (preg_match ("/^level[0-
|
431 |
$value = $default_options[$key];
|
432 |
/**/
|
433 |
-
else if (preg_match ("/^level[0-
|
434 |
$value = $default_options[$key];
|
435 |
/**/
|
436 |
else if ($key === "file_download_limit_exceeded_page" && (!is_string ($value) || !is_numeric ($value)))
|
@@ -442,19 +444,19 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
|
|
442 |
else if (preg_match ("/^amazon_s3_files_(bucket|access_key|secret_key)$/", $key) && (!is_string ($value) || !strlen ($value)))
|
443 |
$value = $default_options[$key];
|
444 |
/**/
|
445 |
-
else if (preg_match ("/^level[0-
|
446 |
$value = $default_options[$key];
|
447 |
/**/
|
448 |
-
else if (preg_match ("/^level[0-
|
449 |
$value = $default_options[$key];
|
450 |
/**/
|
451 |
-
else if (preg_match ("/^level[0-
|
452 |
$value = $default_options[$key];
|
453 |
/**/
|
454 |
-
else if (preg_match ("/^level[0-
|
455 |
$value = $default_options[$key];
|
456 |
/**/
|
457 |
-
else if (preg_match ("/^level[0-
|
458 |
$value = $default_options[$key];
|
459 |
/**/
|
460 |
else if ($key === "specific_ids" && (!is_string ($value) || !($value = trim (preg_replace ("/[^0-9,]/", "", $value), ","))))
|
28 |
/*
|
29 |
Configure the number of Membership Levels being used with s2Member. This is NOT ready ( yet ). Some areas of s2Member are still hard-coded at 4 Levels + Subscribers.
|
30 |
*/
|
31 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"] = 4; /* Hard coded in at 4 Levels. This can only be extended when/if s2Member Pro is installed. */
|
32 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["min_levels"] = 1; /* A lower limit to protect the integrity of the s2Member software application. */
|
33 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["max_levels"] = apply_filters ("ws_plugin__s2member_max_levels", 100); /* Filterable. */
|
34 |
+
/*
|
35 |
+
Configure regular expression matches for Membership Access Item Numbers ( including those with only Custom Capabilities ).
|
36 |
+
*/
|
37 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_item_number_regex"] = "/^([1-9][0-9]*)(?:(?:\:(\+?[a-z_0-9,]+|\+)?)?(?:\:([0-9]+ [A-Z])?)?)?$/";
|
38 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["membership_ccaps_only_item_number_regex"] = "/^(\*)(?:(?:\:(\+?[a-z_0-9,]+|\+)?)?(?:\:([0-9]+ [A-Z])?)?)?$/";
|
39 |
+
/*
|
40 |
+
Configure regular expression match for Specific Post/Page Access Item Numbers ( all elements required here ).
|
41 |
+
*/
|
42 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["sp_access_item_number_regex"] = "/^(sp)(?:(?:\:([1-9][0-9,]*))(?:\:([1-9][0-9]*)))$/";
|
43 |
/*
|
44 |
Configure the directory for files protected by s2Member.
|
45 |
*/
|
69 |
*/
|
70 |
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["checksum"] = filemtime (__FILE__);
|
71 |
/*
|
72 |
+
Configure an array of pluggable functions handled by s2Member.
|
73 |
+
*/
|
74 |
+
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["pluggables"] = array ();
|
75 |
+
/*
|
76 |
Configure & validate all of the s2Member options; and set their defaults.
|
77 |
*/
|
78 |
if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"))
|
91 |
*/
|
92 |
function ws_plugin__s2member_configure_options_and_their_defaults ($options = FALSE)
|
93 |
{
|
94 |
+
global $current_site, $current_blog;
|
95 |
+
/**/
|
96 |
+
$default_options["options_checksum"] = "";
|
97 |
+
$default_options["options_version"] = "1.0";
|
98 |
+
/**/
|
99 |
+
$default_options["gateway_debug_logs"] = "0";
|
100 |
+
/**/
|
101 |
+
$default_options["sec_encryption_key"] = "";
|
102 |
+
$default_options["sec_encryption_key_history"] = array ();
|
103 |
+
$default_options["s_badge_status_enabled"] = "0";
|
104 |
+
/**/
|
105 |
+
$default_options["max_ip_restriction"] = "5";
|
106 |
+
$default_options["max_ip_restriction_time"] = "3600";
|
107 |
+
$default_options["max_failed_login_attempts"] = "5";
|
108 |
+
/**/
|
109 |
+
$default_options["run_deactivation_routines"] = "1";
|
110 |
+
/**/
|
111 |
+
$default_options["custom_reg_fields"] = "";
|
112 |
+
$default_options["custom_reg_names"] = "1";
|
113 |
+
$default_options["custom_reg_display_name"] = "full";
|
114 |
+
$default_options["custom_reg_password"] = "0";
|
115 |
+
$default_options["custom_reg_opt_in"] = "1";
|
116 |
+
$default_options["custom_reg_opt_in_label"] = "Yes, I want to receive updates via email.";
|
117 |
+
$default_options["custom_reg_auto_opt_outs"] = array ();
|
118 |
+
$default_options["custom_reg_auto_opt_out_transitions"] = "0";
|
119 |
+
$default_options["custom_reg_fields_4bp"] = array ();
|
120 |
+
$default_options["custom_reg_force_personal_emails"] = "";
|
121 |
+
/**/
|
122 |
+
$default_options["allow_subscribers_in"] = "0";
|
123 |
+
$default_options["force_admin_lockouts"] = "0";
|
124 |
+
$default_options["filter_wp_query"] = "none";
|
125 |
+
/**/
|
126 |
+
$default_options["mms_auto_patch"] = "1";
|
127 |
+
$default_options["mms_registration_file"] = "wp-login";
|
128 |
+
$default_options["mms_registration_grants"] = "none";
|
129 |
+
for ($n = 0, $v = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++, $v = $v + 5)
|
130 |
+
$default_options["mms_registration_blogs_level" . $n] = (string)$v;
|
131 |
+
/**/
|
132 |
+
$default_options["login_welcome_page"] = "";
|
133 |
+
$default_options["login_redirection_override"] = "";
|
134 |
+
$default_options["membership_options_page"] = "";
|
135 |
+
/**/
|
136 |
+
$default_options["login_reg_background_color"] = "FFFFFF";
|
137 |
+
$default_options["login_reg_background_image"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/bg.png";
|
138 |
+
$default_options["login_reg_background_image_repeat"] = "repeat";
|
139 |
+
/**/
|
140 |
+
$default_options["login_reg_background_text_color"] = "000000";
|
141 |
+
$default_options["login_reg_background_text_shadow_color"] = "EEEEEE";
|
142 |
+
$default_options["login_reg_background_box_shadow_color"] = "EEEEEE";
|
143 |
+
/**/
|
144 |
+
$default_options["login_reg_logo_src"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/logo.png";
|
145 |
+
$default_options["login_reg_logo_src_width"] = "550";
|
146 |
+
$default_options["login_reg_logo_src_height"] = "100";
|
147 |
+
$default_options["login_reg_logo_url"] = home_url ("/");
|
148 |
+
$default_options["login_reg_logo_title"] = get_bloginfo ("name");
|
149 |
+
/**/
|
150 |
+
$default_options["login_reg_font_size"] = "12px";
|
151 |
+
$default_options["login_reg_font_family"] = "'Verdana', 'Arial', sans-serif";
|
152 |
+
$default_options["login_reg_font_field_size"] = "18px";
|
153 |
+
/**/
|
154 |
+
$default_options["login_reg_footer_design"] = "";
|
155 |
+
/**/
|
156 |
+
$default_options["reg_email_from_name"] = get_bloginfo ("name");
|
157 |
+
$default_options["reg_email_from_email"] = get_bloginfo ("admin_email");
|
158 |
+
/**/
|
159 |
+
$default_options["new_user_email_subject"] = "[" . get_bloginfo ("name") . "] Username/Password";
|
160 |
+
$default_options["new_user_email_message"] = "[" . get_bloginfo ("name") . "] Username/Password\n\nUsername: %%user_login%%\nPassword: %%user_pass%%\n%%wp_login_url%%";
|
161 |
+
/**/
|
162 |
+
$default_options["new_user_admin_email_recipients"] = get_bloginfo ("admin_email");
|
163 |
+
$default_options["new_user_admin_email_subject"] = "[" . get_bloginfo ("name") . "] New User Registration";
|
164 |
+
$default_options["new_user_admin_email_message"] = "[" . get_bloginfo ("name") . "] New User Registration\n\nUsername: %%user_login%%\nEmail: %%user_email%%";
|
165 |
+
/**/
|
166 |
+
$default_options["paypal_sandbox"] = "0";
|
167 |
+
$default_options["paypal_business"] = "";
|
168 |
+
$default_options["paypal_api_username"] = "";
|
169 |
+
$default_options["paypal_api_password"] = "";
|
170 |
+
$default_options["paypal_api_signature"] = "";
|
171 |
+
$default_options["paypal_identity_token"] = "";
|
172 |
+
$default_options["paypal_btn_encryption"] = "0";
|
173 |
+
/**/
|
174 |
+
$default_options["signup_tracking_codes"] = "";
|
175 |
+
$default_options["signup_email_recipients"] = '"%%full_name%%" <%%payer_email%%>';
|
176 |
+
$default_options["signup_email_subject"] = "Congratulations! ( your membership has been approved )";
|
177 |
+
$default_options["signup_email_message"] = "Thanks %%first_name%%! Your membership has been approved.\n\nIf you haven't already done so, the next step is to Register a Username.\n\nComplete your registration here:\n%%registration_url%%\n\nIf you have any trouble, please feel free to contact us.\n\nBest Regards,\n" . get_bloginfo ("name");
|
178 |
+
/**/
|
179 |
+
$default_options["sp_tracking_codes"] = "";
|
180 |
+
$default_options["sp_email_recipients"] = '"%%full_name%%" <%%payer_email%%>';
|
181 |
+
$default_options["sp_email_subject"] = "Thank You! ( instructions for access )";
|
182 |
+
$default_options["sp_email_message"] = "Thanks %%first_name%%!\n\n%%item_name%%\n\nYour order can be retrieved here:\n%%sp_access_url%%\n( link expires in %%sp_access_exp%% )\n\nIf you have any trouble, please feel free to contact us.\n\nBest Regards,\n" . get_bloginfo ("name");
|
183 |
+
/**/
|
184 |
+
$default_options["mailchimp_api_key"] = "";
|
185 |
+
/**/
|
186 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
187 |
+
$default_options["level" . $n . "_mailchimp_list_ids"] = "";
|
188 |
+
/**/
|
189 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
190 |
+
$default_options["level" . $n . "_aweber_list_ids"] = "";
|
191 |
+
/**/
|
192 |
+
$default_options["signup_notification_urls"] = "";
|
193 |
+
$default_options["registration_notification_urls"] = "";
|
194 |
+
$default_options["payment_notification_urls"] = "";
|
195 |
+
$default_options["modification_notification_urls"] = "";
|
196 |
+
$default_options["cancellation_notification_urls"] = "";
|
197 |
+
$default_options["eot_del_notification_urls"] = "";
|
198 |
+
$default_options["ref_rev_notification_urls"] = "";
|
199 |
+
$default_options["sp_sale_notification_urls"] = "";
|
200 |
+
$default_options["sp_ref_rev_notification_urls"] = "";
|
201 |
+
/**/
|
202 |
+
$default_options["signup_notification_recipients"] = "";
|
203 |
+
$default_options["registration_notification_recipients"] = "";
|
204 |
+
$default_options["payment_notification_recipients"] = "";
|
205 |
+
$default_options["modification_notification_recipients"] = "";
|
206 |
+
$default_options["cancellation_notification_recipients"] = "";
|
207 |
+
$default_options["eot_del_notification_recipients"] = "";
|
208 |
+
$default_options["ref_rev_notification_recipients"] = "";
|
209 |
+
$default_options["sp_sale_notification_recipients"] = "";
|
210 |
+
$default_options["sp_ref_rev_notification_recipients"] = "";
|
211 |
+
/**/
|
212 |
+
for ($n = 0, $l = array ("Free Subscriber", "Bronze Member", "Silver Member", "Gold Member", "Platinum Member"); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
213 |
+
$default_options["level" . $n . "_label"] = (!empty ($l[$n])) ? $l[$n] : "Level " . $n . " Member";
|
214 |
+
/**/
|
215 |
+
$default_options["apply_label_translations"] = "0";
|
216 |
+
/**/
|
217 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
218 |
+
$default_options["level" . $n . "_file_downloads_allowed"] = "";
|
219 |
+
/**/
|
220 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
221 |
+
$default_options["level" . $n . "_file_downloads_allowed_days"] = "";
|
222 |
+
/**/
|
223 |
+
$default_options["file_download_limit_exceeded_page"] = "";
|
224 |
+
$default_options["file_download_inline_extensions"] = "";
|
225 |
+
/**/
|
226 |
+
$default_options["amazon_s3_files_bucket"] = "";
|
227 |
+
$default_options["amazon_s3_files_access_key"] = "";
|
228 |
+
$default_options["amazon_s3_files_secret_key"] = "";
|
229 |
+
/**/
|
230 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
231 |
+
$default_options["level" . $n . "_ruris"] = "";
|
232 |
+
/**/
|
233 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
234 |
+
$default_options["level" . $n . "_catgs"] = "";
|
235 |
+
/**/
|
236 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
237 |
+
$default_options["level" . $n . "_ptags"] = "";
|
238 |
+
/**/
|
239 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
240 |
+
$default_options["level" . $n . "_posts"] = "";
|
241 |
+
/**/
|
242 |
+
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
|
243 |
+
$default_options["level" . $n . "_pages"] = "";
|
244 |
+
/**/
|
245 |
+
$default_options["specific_ids"] = "";
|
246 |
+
/**/
|
247 |
+
$default_options["triggers_immediate_eot"] = "refunds,reversals";
|
248 |
+
$default_options["membership_eot_behavior"] = "demote";
|
249 |
+
$default_options["eot_time_ext_behavior"] = "extend";
|
250 |
+
$default_options["auto_eot_system_enabled"] = "1";
|
251 |
+
/**/
|
252 |
+
$default_options["wp_footer_code"] = "";
|
253 |
+
/**/
|
254 |
+
$default_options = apply_filters ("ws_plugin__s2member_default_options", $default_options);
|
255 |
+
/**/
|
256 |
+
unset ($n, $v, $l); /* Unset/cleanup these working variables from the routines above. */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
/*
|
258 |
Disable de-activation routines ( by default ) on a Multisite Blog Farm installation; excluding the Main Site.
|
259 |
*/
|
327 |
else if (preg_match ("/^custom_reg_(names|password|opt_in|auto_opt_out_transitions)$/", $key) && (!is_string ($value) || !is_numeric ($value)))
|
328 |
$value = $default_options[$key];
|
329 |
/**/
|
330 |
+
else if ($key === "custom_reg_display_name" && (!is_string ($value) || !preg_match ("/^(full|first|last|login|0)$/", $value)))
|
331 |
+
$value = $default_options[$key];
|
332 |
+
/**/
|
333 |
else if ($key === "custom_reg_opt_in_label" && (!is_string ($value) || !strlen ($value)))
|
334 |
$value = $default_options[$key];
|
335 |
/**/
|
354 |
else if ($key === "mms_registration_grants" && (!is_string ($value) || !preg_match ("/^(none|user|all)$/", $value)))
|
355 |
$value = $default_options[$key];
|
356 |
/**/
|
357 |
+
else if (preg_match ("/^mms_registration_blogs_level[0-9]+$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
|
358 |
$value = $default_options[$key];
|
359 |
/**/
|
360 |
else if ($key === "force_admin_lockouts" && (!is_string ($value) || !is_numeric ($value)))
|
384 |
else if (preg_match ("/^reg_email_from_(name|email)$/", $key) && (!is_string ($value) || !strlen ($value)))
|
385 |
$value = $default_options[$key];
|
386 |
/**/
|
387 |
+
else if (preg_match ("/^new_user_email_(subject|message)$/", $key) && (!is_string ($value) || !strlen ($value)))
|
388 |
+
$value = $default_options[$key];
|
389 |
+
/**/
|
390 |
+
else if (preg_match ("/^new_user_admin_email_(recipients|subject|message)$/", $key) && (!is_string ($value) || !strlen ($value)))
|
391 |
+
$value = $default_options[$key];
|
392 |
+
/**/
|
393 |
else if ($key === "paypal_sandbox" && (!is_string ($value) || !is_numeric ($value)))
|
394 |
$value = $default_options[$key];
|
395 |
/**/
|
411 |
else if ($key === "mailchimp_api_key" && (!is_string ($value) || !strlen ($value)))
|
412 |
$value = $default_options[$key];
|
413 |
/**/
|
414 |
+
else if (preg_match ("/^level[0-9]+_mailchimp_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/[\r\n\t]+/", "", $value))))
|
415 |
$value = $default_options[$key];
|
416 |
/**/
|
417 |
+
else if (preg_match ("/^level[0-9]+_aweber_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/\s+/", "", $value))))
|
418 |
$value = $default_options[$key];
|
419 |
/**/
|
420 |
else if (preg_match ("/^(signup|registration|payment|modification|cancellation|eot_del|ref_rev|sp_sale|sp_ref_rev)_notification_urls$/", $key) && (!is_string ($value) || !strlen ($value)))
|
423 |
else if (preg_match ("/^(signup|registration|payment|modification|cancellation|eot_del|ref_rev|sp_sale|sp_ref_rev)_notification_recipients$/", $key) && (!is_string ($value) || !strlen ($value)))
|
424 |
$value = $default_options[$key];
|
425 |
/**/
|
426 |
+
else if (preg_match ("/^level[0-9]+_label$/", $key) && (!is_string ($value) || !strlen ($value)))
|
427 |
$value = $default_options[$key];
|
428 |
/**/
|
429 |
else if ($key === "apply_label_translations" && (!is_string ($value) || !is_numeric ($value)))
|
430 |
$value = $default_options[$key];
|
431 |
/**/
|
432 |
+
else if (preg_match ("/^level[0-9]+_file_downloads_allowed$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
|
433 |
$value = $default_options[$key];
|
434 |
/**/
|
435 |
+
else if (preg_match ("/^level[0-9]+_file_downloads_allowed_days$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
|
436 |
$value = $default_options[$key];
|
437 |
/**/
|
438 |
else if ($key === "file_download_limit_exceeded_page" && (!is_string ($value) || !is_numeric ($value)))
|
444 |
else if (preg_match ("/^amazon_s3_files_(bucket|access_key|secret_key)$/", $key) && (!is_string ($value) || !strlen ($value)))
|
445 |
$value = $default_options[$key];
|
446 |
/**/
|
447 |
+
else if (preg_match ("/^level[0-9]+_ruris$/", $key) && (!is_string ($value) || !strlen ($value)))
|
448 |
$value = $default_options[$key];
|
449 |
/**/
|
450 |
+
else if (preg_match ("/^level[0-9]+_catgs$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
|
451 |
$value = $default_options[$key];
|
452 |
/**/
|
453 |
+
else if (preg_match ("/^level[0-9]+_ptags$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/( +)/", " ", trim (preg_replace ("/( *),( *)/", ",", $value))), ",")))))
|
454 |
$value = $default_options[$key];
|
455 |
/**/
|
456 |
+
else if (preg_match ("/^level[0-9]+_posts$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
|
457 |
$value = $default_options[$key];
|
458 |
/**/
|
459 |
+
else if (preg_match ("/^level[0-9]+_pages$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
|
460 |
$value = $default_options[$key];
|
461 |
/**/
|
462 |
else if ($key === "specific_ids" && (!is_string ($value) || !($value = trim (preg_replace ("/[^0-9,]/", "", $value), ","))))
|
includes/templates/options/paypal-membership-modification-levels.html
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<optgroup label="Level #1">
|
2 |
-
<option value="upgrade:1">↑ Upgrade To Level #1</option>
|
3 |
-
<option value="downgrade:1">↓ Downgrade To Level #1</option>
|
4 |
-
</optgroup>
|
5 |
-
|
6 |
-
<option disabled="disabled"></option>
|
7 |
-
|
8 |
-
<optgroup label="Level #2">
|
9 |
-
<option value="upgrade:2" selected="selected">↑ Upgrade To Level #2</option>
|
10 |
-
<option value="downgrade:2">↓ Downgrade To Level #2</option>
|
11 |
-
</optgroup>
|
12 |
-
|
13 |
-
<option disabled="disabled"></option>
|
14 |
-
|
15 |
-
<optgroup label="Level #3">
|
16 |
-
<option value="upgrade:3">↑ Upgrade To Level #3</option>
|
17 |
-
<option value="downgrade:3">↓ Downgrade To Level #3</option>
|
18 |
-
</optgroup>
|
19 |
-
|
20 |
-
<option disabled="disabled"></option>
|
21 |
-
|
22 |
-
<optgroup label="Level #4">
|
23 |
-
<option value="upgrade:4">↑ Upgrade To Level #4</option>
|
24 |
-
</optgroup>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
=== s2Member® ( Membership w/ PayPal® ) ===
|
2 |
|
3 |
-
Version:
|
4 |
-
Stable tag:
|
5 |
Framework: WS-P-110523
|
6 |
|
7 |
SSL Compatible: yes
|
@@ -19,7 +19,7 @@ ClickBank® Compatible: w/ s2Member Pro
|
|
19 |
AliPay® Compatible: w/ s2Member Pro
|
20 |
ccBill® Compatible: w/ s2Member Pro
|
21 |
|
22 |
-
Tested up to: 3.
|
23 |
Requires at least: 3.1
|
24 |
Requires: WordPress® 3.1+, PHP 5.2.3+
|
25 |
|
@@ -53,22 +53,16 @@ s2Member® (Membership w/ PayPal®). Powerful (free) membership capabilities. Pr
|
|
53 |
= Upgrading to the latest version? =
|
54 |
Please visit [this page](http://www.primothemes.com/forums/viewtopic.php?f=36&t=247) for [easy upgrade instructions](http://www.primothemes.com/forums/viewtopic.php?f=36&t=247).
|
55 |
|
56 |
-
= Auto-installing through WordPress® ( memory errors? ) =
|
57 |
-
This depends on your hosting provider and/or server configuration. Some web hosting companies impose very low limits on the amount of memory available to WordPress® during the execution of a single script. Since s2Member is a larger plugin, WordPress® may exceed conservative limits set forth by shared hosting companies. Don't feel bad, it's a very common problem. The solution is to install manually, using the instructions above. Memory limits only affect the WordPress® auto-installation routine, not the actual functionality of WordPress® or s2Member.
|
58 |
-
|
59 |
= Is s2Member compatible with Multisite Networking ? =
|
60 |
Yes. s2Member, and also s2Member Pro, are BOTH compatible with Multisite Networking enabled. After you enable Multisite Networking, install the s2Member plugin. Then navigate to `s2Member -> Multisite ( Config )` in the Dashboard on your ( Main Site ).
|
61 |
|
62 |
-
= What about Multisite Networking ( WPMU ), used on a Blog Farm? =
|
63 |
-
Yes, preliminary ( experimental ) support for Multisite Blog Farms has also been implemented. If you're running a Multisite Blog Farm ( i.e. you offer Blogs ), please contact s2Member.com for further details. With Multisite Networking enabled, your site could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( Network wide ), each of your Blog Owners could offer Membership too, using a single installation of the s2Member plugin ( which is a great selling point ). We refer to this as a Multisite Blog Farm. You can get started now, by turning on [Multisite Networking](http://codex.wordpress.org/Create_A_Network) inside your installation of WordPress®. Then, install the s2Member plugin ( Network wide ). In the Dashboard for your Main Site, see: `s2Member -> Multisite ( Config )`.
|
64 |
-
|
65 |
== Description ==
|
66 |
|
67 |
[youtube http://www.youtube.com/watch?v=FyA8Qmm2DHY /]
|
68 |
|
69 |
-
s2Member® (Membership w/ PayPal®). Powerful (free) membership capabilities. Protect members only content. The s2Member Framework (free) integrates w/ PayPal® (very easy), and fully supports recurring billing. s2Member supports custom Pages for registration (including Custom Registration Fields), account access, and a
|
70 |
|
71 |
-
s2Member supports Free Subscribers (at Level #0), and
|
72 |
|
73 |
s2Member allows you to protect Pages, Posts, Tags, Categories, URIs, URI word fragments, URI Replacement Codes for BuddyPress, Specific Post/Page "Buy Now" Access, and even portions of content within Posts/Pages/themes/plugins. Everything is configurable through the s2Member Options Panel. This makes s2Member VERY easy to integrate into any WordPress® site. With s2Member, you can also protect downloadable files, using restrictions to control how many downloads can occur within a certain amount of time; all based on Membership Level. sMember also integrates with Amazon® S3 (optional).
|
74 |
|
@@ -76,7 +70,7 @@ Each Membership Level can have different restrictions, and you could even integr
|
|
76 |
|
77 |
You can also sell Specific Post/Page Access (membership not required), using "Buy Now" buttons. You can even package multiple Posts/Pages together into one "Buy Now" transaction. Further details are provided under `s2Member -> PayPal® Buttons -> Specific Posts/Pages`. Specific Post/Page Access, is like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress®. A Specific Post/Page protected by s2Member, might contain a download link for your eBook, access to file & music downloads, access to support services, and the list goes on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress® Post/Page. For instance, you might sell an existing Member an additional item (without affecting their current Membership plan).
|
78 |
|
79 |
-
New! - [s2Member Pro](http://www.s2member.com/) is an add-on for the free version of s2Member. [s2Member Pro](http://www.s2member.com/) adds
|
80 |
|
81 |
== Screenshots ==
|
82 |
|
@@ -108,14 +102,14 @@ Yes, many [common questions/problems/tips](http://www.primothemes.com/forums/vie
|
|
108 |
= Where can I download older versions of s2Member? =
|
109 |
Archived releases of s2Member are maintained [here](http://wordpress.org/extend/plugins/s2member/download/).
|
110 |
|
111 |
-
= Does s2Member install any new database tables? =
|
112 |
-
No, s2Member has been fully integrated with Roles/Capabilities; already built into WordPress®. It is designed to be completely seamless, without code bloat. We've carefully structured the entire framework, in order to maximize s2Member's ability to operate with other plugins installed. For instance, s2Member is also compatible with BuddyPress; and can even be used to protect forums powered by bbPress.
|
113 |
-
|
114 |
= Does PayPal integration work right-out-of-the-box? =
|
115 |
Yes, it can even generate your PayPal® Subscription Buttons for you. Everything is fully integrated. You even get to create your own Pages within WordPress® to handle Membership Options, the Login Welcome Page, etc. For advanced webmasters, there are scripting techniques that are documented as well. These will help you further develop your site and tailor it to meet your specific needs. s2Member API Scripting is NOT required however.
|
116 |
|
117 |
= How many Membership Levels are supported? =
|
118 |
-
s2Member supports Free Subscribers (
|
|
|
|
|
|
|
119 |
|
120 |
= Does s2Member utilize the PayPal® IPN system? =
|
121 |
Yes, s2Member supports automation of account activation, welcome emails, confirmations, renewals, deactivation, refunds, etc. The integration with PayPal® is seamless. s2Member even provides API Notifications, which are an added layer of functionality. These are not to be confused with the IPN service. s2Member API Notifications make it easier to integrate back-office routines, affiliate programs, list servers, or any other 3rd-party applications that should react to certain events.
|
@@ -141,26 +135,20 @@ Yes, there were some bugs in the beginning, but they have been fixed now. Both Q
|
|
141 |
= Is s2Member compatible with Multisite Networking? =
|
142 |
Yes. s2Member, and also s2Member Pro, are both compatible with Multisite Networking enabled. After you enable Multisite Networking, install the s2Member plugin. Then navigate to `s2Member -> Multisite ( Config )` in the Dashboard on your ( Main Site ).
|
143 |
|
144 |
-
= What about Multisite Networking ( WPMU ), used on a Blog Farm? =
|
145 |
-
Yes, preliminary ( experimental ) support for Multisite Blog Farms has also been implemented. If you're running a Multisite Blog Farm ( i.e. you offer Blogs ), please contact s2Member.com for further details. With Multisite Networking enabled, your site could ALSO offer a Customer access to create a Blog of their own, where a Customer becomes a "Member" of your ( Main Site ), and also a Blog Owner/Administrator. With s2Member installed ( network wide ), each of your Blog Owners could offer Membership too, using a single installation of the s2Member plugin ( which is a great selling point! ). We refer to this as a Multisite Blog Farm. You can get started now, by turning on [Multisite Networking](http://codex.wordpress.org/Create_A_Network) inside your installation of WordPress®. Then, install the s2Member plugin ( network wide ). In the Dashboard for your Main Site, see: `s2Member -> Multisite ( Config )`.
|
146 |
-
|
147 |
= Is s2Member compatible with the BuddyPress plugin for WordPress? =
|
148 |
Yes it is. In fact, we must say... the s2Member/BuddyPress combination is just awesome. These two plugins running together make all sorts of things possible.
|
149 |
|
150 |
= How does s2Member know when to demote a paid Member to a Free Subscriber? =
|
151 |
s2Member uses its built-in Auto-EOT System. EOT = End Of Term. Whenever you generate a PayPal® Button with s2Member, you'll configure a length for the Subscription. Depending on the type of Subscription you choose ( recurring, non-recurring, lifetime, or fixed-term ); s2Member will either use PayPal's IPN/`subscr_payment,subscr_cancel,subscr_eot` notices, or it will set an Automatic EOT Time, which is processed automatically by s2Member via WP_Cron. For each Member, you can also override the EOT Time, by forcing a specific expiration date. To manually adjust the EOT Time for a specific Member, go to: `WordPress® -> Users`, and click the Edit link next the Member you want to work on.
|
152 |
|
153 |
-
= Why do I get memory errors during installation and/or upgrade? =
|
154 |
-
This depends on your hosting provider and/or server configuration. Some web hosting companies impose very low limits on the amount of memory available to WordPress® during the execution of a single script. Since s2Member is a larger plugin, WordPress® may exceed conservative limits set forth by shared hosting companies. Don't feel bad, it's a very common problem. The solution is to upgrade manually. Memory limits only affect the WordPress® auto-installation/upgrade routine, not the actual functionality of WordPress® or s2Member.
|
155 |
-
|
156 |
= How can I see more of what's going on behind-the-scene? =
|
157 |
-
s2Member comes with
|
158 |
|
159 |
= When a User/Member is demoted by the Auto-EOT System, are Custom Capabilities removed too? =
|
160 |
Yes, whenever a User/Member is demoted, s2Member resets their account back to a Free Subscriber. Any Custom Capabilities the Member had, will be removed.
|
161 |
|
162 |
= When a User/Member upgrades, are existing Custom Capabilities preserved? =
|
163 |
-
No, by default, s2Member will reset their Custom Capabilities to the ones listed in the Payment Button/Form that initiates the upgrade. However, starting with s2Member v3.5+, it is now possible to start your list of Custom Capabilities with a `+` sign. This tells s2Member to (ADD) a comma-delimited list of new Custom Capabilities to any that may or may not already exist for a given Member. So this behavior can now be modified during Button/Form generation with s2Member.
|
164 |
|
165 |
= Can s2Member implement a Captcha Code on my Login/Registration Forms? =
|
166 |
Yes and no. We've left this feature out of the plugin intentionally, because many site owners prefer to use Captcha plugins that encompass all aspects of their site ( including comment forms ). We recommend this one: [SI CAPTCHA Anti-Spam](http://wordpress.org/extend/plugins/si-captcha-for-wordpress/). That being said, [s2Member's Pro Forms](http://www.s2member.com/) for PayPal® Pro and Authorize.Net® ( including Free Registration Forms ) CAN be configured to use Google's reCAPTCHA service. Just add this Attribute to any Pro Form Shortcode ( `captcha="clean"` ). For further details, please check your Dashboard under: `s2Member -> PayPal® Pro Forms -> Shortcode Attributes ( explained )`.
|
@@ -173,6 +161,15 @@ Please visit s2Member.com for [video tutorials](http://www.s2member.com/videos/)
|
|
173 |
|
174 |
== Changelog ==
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
= v110620 =
|
177 |
* **(s2Member) Bug fix.** s2Member has been updated to support GMT offset in date calculations for Registration Time. In previous versions, this was addressed using `date_i18n()`, but this update now includes the proper function call to `get_date_from_gmt()`. No changes are necessary, as this update simply corrects the way Registration Times are displayed in your list of Users. Starting with v110620, s2Member will now display Registration Times with the correct GMT offset, based on your configuration of `WordPress -> General Options -> Timezone`.
|
178 |
|
1 |
=== s2Member® ( Membership w/ PayPal® ) ===
|
2 |
|
3 |
+
Version: 110708
|
4 |
+
Stable tag: 110708
|
5 |
Framework: WS-P-110523
|
6 |
|
7 |
SSL Compatible: yes
|
19 |
AliPay® Compatible: w/ s2Member Pro
|
20 |
ccBill® Compatible: w/ s2Member Pro
|
21 |
|
22 |
+
Tested up to: 3.2
|
23 |
Requires at least: 3.1
|
24 |
Requires: WordPress® 3.1+, PHP 5.2.3+
|
25 |
|
53 |
= Upgrading to the latest version? =
|
54 |
Please visit [this page](http://www.primothemes.com/forums/viewtopic.php?f=36&t=247) for [easy upgrade instructions](http://www.primothemes.com/forums/viewtopic.php?f=36&t=247).
|
55 |
|
|
|
|
|
|
|
56 |
= Is s2Member compatible with Multisite Networking ? =
|
57 |
Yes. s2Member, and also s2Member Pro, are BOTH compatible with Multisite Networking enabled. After you enable Multisite Networking, install the s2Member plugin. Then navigate to `s2Member -> Multisite ( Config )` in the Dashboard on your ( Main Site ).
|
58 |
|
|
|
|
|
|
|
59 |
== Description ==
|
60 |
|
61 |
[youtube http://www.youtube.com/watch?v=FyA8Qmm2DHY /]
|
62 |
|
63 |
+
s2Member® (Membership w/ PayPal®). Powerful (free) membership capabilities. Protect members only content. The s2Member Framework (free) integrates w/ PayPal® (very easy), and fully supports recurring billing. s2Member supports custom Pages for registration (including Custom Registration Fields), account access, and a lot more. s2Member is now compatible with Multisite Networking too, and even with BuddyPress and bbPress. In addition, with the s2Member Pro Module (an optional paid upgrade), you can add support for unlimited Membership Levels, PayPal® Pro (w/ Pro Forms), Authorize.Net® (w/ Pro Forms), ccBill®, Google® Checkout, ClickBank®, AliPay®, advanced User Import/Export tools, the ability to use Coupon Codesm, and more. Videos available at: [s2Member.com / Videos](http://www.s2member.com/videos/).
|
64 |
|
65 |
+
s2Member supports Free Subscribers (at Level #0), and four primary Membership Levels [1-4] (unlimited with s2Member Pro). You can label your Membership Levels anything you like. The defaults are Free, Bronze, Silver, Gold, and Platinum. s2Member also supports an unlimited number of Custom Capability Packages. Custom Capabilities are an easy way to extend s2Member in creative ways. Custom Capabilities allow you to create an unlimited number of Membership Packages, all with different Capabilities and prices.
|
66 |
|
67 |
s2Member allows you to protect Pages, Posts, Tags, Categories, URIs, URI word fragments, URI Replacement Codes for BuddyPress, Specific Post/Page "Buy Now" Access, and even portions of content within Posts/Pages/themes/plugins. Everything is configurable through the s2Member Options Panel. This makes s2Member VERY easy to integrate into any WordPress® site. With s2Member, you can also protect downloadable files, using restrictions to control how many downloads can occur within a certain amount of time; all based on Membership Level. sMember also integrates with Amazon® S3 (optional).
|
68 |
|
70 |
|
71 |
You can also sell Specific Post/Page Access (membership not required), using "Buy Now" buttons. You can even package multiple Posts/Pages together into one "Buy Now" transaction. Further details are provided under `s2Member -> PayPal® Buttons -> Specific Posts/Pages`. Specific Post/Page Access, is like selling a product. Only, instead of shipping anything to the Customer, you just give them access to a specific Post/Page on your site; one that you created in WordPress®. A Specific Post/Page protected by s2Member, might contain a download link for your eBook, access to file & music downloads, access to support services, and the list goes on. The possibilities with this are endless; as long as your digital product can be delivered through access to a WordPress® Post/Page. For instance, you might sell an existing Member an additional item (without affecting their current Membership plan).
|
72 |
|
73 |
+
New! - [s2Member Pro](http://www.s2member.com/) is an add-on for the free version of s2Member. [s2Member Pro](http://www.s2member.com/) adds support for unlimited Membership Levels, PayPal® Pro (w/ Pro Forms), Authorize.Net® (w/ Pro Forms), ccBill®, Google® Checkout, ClickBank®, AliPay®, advanced User Import/Export tools, and the ability to use Coupon Codes. Videos available at: [s2Member.com / Videos](http://www.s2member.com/videos/).
|
74 |
|
75 |
== Screenshots ==
|
76 |
|
102 |
= Where can I download older versions of s2Member? =
|
103 |
Archived releases of s2Member are maintained [here](http://wordpress.org/extend/plugins/s2member/download/).
|
104 |
|
|
|
|
|
|
|
105 |
= Does PayPal integration work right-out-of-the-box? =
|
106 |
Yes, it can even generate your PayPal® Subscription Buttons for you. Everything is fully integrated. You even get to create your own Pages within WordPress® to handle Membership Options, the Login Welcome Page, etc. For advanced webmasters, there are scripting techniques that are documented as well. These will help you further develop your site and tailor it to meet your specific needs. s2Member API Scripting is NOT required however.
|
107 |
|
108 |
= How many Membership Levels are supported? =
|
109 |
+
s2Member supports Free Subscribers (at Level #0), and four primary Membership Levels [1-4] (unlimited with s2Member Pro). You can label your Membership Levels anything you like. The defaults are Free, Bronze, Silver, Gold, and Platinum. s2Member also supports an unlimited number of Custom Capability Packages. Custom Capabilities are an easy way to extend s2Member in creative ways. Custom Capabilities allow you to create an unlimited number of Membership Packages, all with different Capabilities and prices.
|
110 |
+
|
111 |
+
= How can I extend s2Member beyond four Levels? =
|
112 |
+
With s2Member "Pro" installed, you may configure an unlimited number of Membership Levels. You can set the number of Membership Levels by adding this line to your /wp-config.php file: `define("MEMBERSHIP_LEVELS", 4);`. Feel free to change the default value of 4 to whatever you need. The miniumum allowed value is `1`. The recommended maximum is `100`.
|
113 |
|
114 |
= Does s2Member utilize the PayPal® IPN system? =
|
115 |
Yes, s2Member supports automation of account activation, welcome emails, confirmations, renewals, deactivation, refunds, etc. The integration with PayPal® is seamless. s2Member even provides API Notifications, which are an added layer of functionality. These are not to be confused with the IPN service. s2Member API Notifications make it easier to integrate back-office routines, affiliate programs, list servers, or any other 3rd-party applications that should react to certain events.
|
135 |
= Is s2Member compatible with Multisite Networking? =
|
136 |
Yes. s2Member, and also s2Member Pro, are both compatible with Multisite Networking enabled. After you enable Multisite Networking, install the s2Member plugin. Then navigate to `s2Member -> Multisite ( Config )` in the Dashboard on your ( Main Site ).
|
137 |
|
|
|
|
|
|
|
138 |
= Is s2Member compatible with the BuddyPress plugin for WordPress? =
|
139 |
Yes it is. In fact, we must say... the s2Member/BuddyPress combination is just awesome. These two plugins running together make all sorts of things possible.
|
140 |
|
141 |
= How does s2Member know when to demote a paid Member to a Free Subscriber? =
|
142 |
s2Member uses its built-in Auto-EOT System. EOT = End Of Term. Whenever you generate a PayPal® Button with s2Member, you'll configure a length for the Subscription. Depending on the type of Subscription you choose ( recurring, non-recurring, lifetime, or fixed-term ); s2Member will either use PayPal's IPN/`subscr_payment,subscr_cancel,subscr_eot` notices, or it will set an Automatic EOT Time, which is processed automatically by s2Member via WP_Cron. For each Member, you can also override the EOT Time, by forcing a specific expiration date. To manually adjust the EOT Time for a specific Member, go to: `WordPress® -> Users`, and click the Edit link next the Member you want to work on.
|
143 |
|
|
|
|
|
|
|
144 |
= How can I see more of what's going on behind-the-scene? =
|
145 |
+
s2Member comes with very sophisticated logging routines for PayPal®. One for its PayPal® IPN communication ( and resulting actions ). Another logs Return-Data processing. Another logs PayPal® API communication ( i.e. for dynamic Button Encryption, if enabled; and/or for the s2Member Pro add-on communication with the PayPal® Pro API ). You can enable all of these logging routines, by going to: `s2Member -> PayPal® Options -> Account Details -> Logging`.
|
146 |
|
147 |
= When a User/Member is demoted by the Auto-EOT System, are Custom Capabilities removed too? =
|
148 |
Yes, whenever a User/Member is demoted, s2Member resets their account back to a Free Subscriber. Any Custom Capabilities the Member had, will be removed.
|
149 |
|
150 |
= When a User/Member upgrades, are existing Custom Capabilities preserved? =
|
151 |
+
No, by default, s2Member will reset their Custom Capabilities to the ones listed in the Payment Button/Form that initiates the upgrade. However, starting with s2Member v3.5+, it is now possible to start your list of Custom Capabilities with a `+` sign. This tells s2Member to (ADD) a comma-delimited list of new Custom Capabilities to any that may, or may not, already exist for a given Member. So this behavior can now be modified during Button/Form generation with s2Member.
|
152 |
|
153 |
= Can s2Member implement a Captcha Code on my Login/Registration Forms? =
|
154 |
Yes and no. We've left this feature out of the plugin intentionally, because many site owners prefer to use Captcha plugins that encompass all aspects of their site ( including comment forms ). We recommend this one: [SI CAPTCHA Anti-Spam](http://wordpress.org/extend/plugins/si-captcha-for-wordpress/). That being said, [s2Member's Pro Forms](http://www.s2member.com/) for PayPal® Pro and Authorize.Net® ( including Free Registration Forms ) CAN be configured to use Google's reCAPTCHA service. Just add this Attribute to any Pro Form Shortcode ( `captcha="clean"` ). For further details, please check your Dashboard under: `s2Member -> PayPal® Pro Forms -> Shortcode Attributes ( explained )`.
|
161 |
|
162 |
== Changelog ==
|
163 |
|
164 |
+
= v110708 =
|
165 |
+
* **(s2Member/s2Member Pro) Compatibility.** s2Member updated to support WordPress® v3.2.
|
166 |
+
* **(s2Member Pro) Unlimited Membership Levels.** With s2Member Pro installed, you may now configure an unlimited number of Membership Levels. You can set the number of Membership Levels by adding this line to your /wp-config.php file: `define("MEMBERSHIP_LEVELS", 4);`. Feel free to change the default value of 4 to whatever you need. The miniumum allowed value is 1. The recommended maximum is 100. For further details, please check your Dashboard, under: `s2Member -> General Options -> Membership Levels/Labels`.
|
167 |
+
* **(s2Member/s2Member Pro) Email Configuration.** Some new options are now available that allow site owners to customize the email that contains the Username/Password for new Users/Members. For further details, please check your Dashboard, under: `s2Member -> General Options -> Email Configuration`.
|
168 |
+
* **(s2Member/s2Member Pro) Bug fix.** A problem with certain email addresses routed through the `wp_mail()` function, containing special characters in the "Name" portion. The issue was related to the way in which `wp_mail()` handles recipient addresses in the format `"Name" <address>`. s2Member now strips double quotes dynamically ( i.e. internally ), so that `wp_mail()` and the PHPMailer class can deal with this format on their own. This bug fix should also prevent seemingly random `500 Internal Server Error` messages during checkout. One symptom of this bug was to find "Premature end of script headers" inside your Apache error log, followed by an error code of `500` reported in the browser. These issues have been corrected in this release of s2Member.
|
169 |
+
* **(s2Member) Bug fix.** A bug first introduced in v110604 was preventing s2Member from setting a User's "Display Name" during Registration properly. This bug has been corrected in the latest release. In addition, a new configurable option for this behavior has been added to the s2Member General Options panel. For further details, please check your Dashboard under: `s2Member -> General Options -> Custom Registration Fields -> Display Name`.
|
170 |
+
* **(s2Member) Bug fix.** A bug first introduced in v110604 was preventing s2Member from handling password strenth meters in the Stand-Alone Profile Editing Panel ( i.e. the popup version ).
|
171 |
+
* **(s2Member) Documentation.** s2Member's `API Scripting` sections inside your Dashboard have been updated in various places, in support of some new API Functions/Constants introduced in the latest versions of s2Member; and also to reference relevant articles in the [s2Member Codex](http://www.primothemes.com/forums/viewforum.php?f=40).
|
172 |
+
|
173 |
= v110620 =
|
174 |
* **(s2Member) Bug fix.** s2Member has been updated to support GMT offset in date calculations for Registration Time. In previous versions, this was addressed using `date_i18n()`, but this update now includes the proper function call to `get_date_from_gmt()`. No changes are necessary, as this update simply corrects the way Registration Times are displayed in your list of Users. Starting with v110620, s2Member will now display Registration Times with the correct GMT offset, based on your configuration of `WordPress -> General Options -> Timezone`.
|
175 |
|
s2member.php
CHANGED
@@ -19,8 +19,8 @@
|
|
19 |
*/
|
20 |
/* -- This section for WordPress® parsing. ------------------------------------------------------------------------------
|
21 |
|
22 |
-
Version:
|
23 |
-
Stable tag:
|
24 |
Framework: WS-P-110523
|
25 |
|
26 |
SSL Compatible: yes
|
@@ -33,10 +33,12 @@ Multisite Blog Farm Compatible: yes
|
|
33 |
PayPal® Standard Compatible: yes
|
34 |
PayPal® Pro Compatible: w/ s2Member Pro
|
35 |
Google® Checkout Compatible: w/ s2Member Pro
|
|
|
36 |
ClickBank® Compatible: w/ s2Member Pro
|
37 |
AliPay® Compatible: w/ s2Member Pro
|
|
|
38 |
|
39 |
-
Tested up to: 3.
|
40 |
Requires at least: 3.1
|
41 |
Requires: WordPress® 3.1+, PHP 5.2.3+
|
42 |
|
@@ -53,9 +55,9 @@ Pro Module / Prices: http://www.s2member.com/prices/
|
|
53 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
54 |
Privacy URI: http://www.primothemes.com/about/privacy-policy/
|
55 |
PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304
|
56 |
-
Professional Installation URI: http://www.
|
57 |
Plugin URI: http://www.primothemes.com/post/product/s2member-membership-plugin-with-paypal/
|
58 |
-
Description:
|
59 |
Tags: membership, members, member, register, signup, paypal, paypal pro, pay pal, s2member, authorize.net, google checkout, ccbill, clickbank, alipay, 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
|
60 |
|
61 |
-- end section for WordPress® parsing. ------------------------------------------------------------------------------- */
|
@@ -70,7 +72,7 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
|
|
70 |
* @var str
|
71 |
*/
|
72 |
if (!defined ("WS_PLUGIN__S2MEMBER_VERSION"))
|
73 |
-
define ("WS_PLUGIN__S2MEMBER_VERSION", "
|
74 |
/**
|
75 |
* Minimum PHP version required to run s2Member.
|
76 |
*
|
@@ -100,7 +102,7 @@ if (!defined ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION"))
|
|
100 |
* @var str
|
101 |
*/
|
102 |
if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION"))
|
103 |
-
define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "
|
104 |
/*
|
105 |
Several compatibility checks.
|
106 |
If all pass, load the s2Member plugin.
|
19 |
*/
|
20 |
/* -- This section for WordPress® parsing. ------------------------------------------------------------------------------
|
21 |
|
22 |
+
Version: 110708
|
23 |
+
Stable tag: 110708
|
24 |
Framework: WS-P-110523
|
25 |
|
26 |
SSL Compatible: yes
|
33 |
PayPal® Standard Compatible: yes
|
34 |
PayPal® Pro Compatible: w/ s2Member Pro
|
35 |
Google® Checkout Compatible: w/ s2Member Pro
|
36 |
+
Authorize.Net® Compatible: w/ s2Member Pro
|
37 |
ClickBank® Compatible: w/ s2Member Pro
|
38 |
AliPay® Compatible: w/ s2Member Pro
|
39 |
+
ccBill® Compatible: w/ s2Member Pro
|
40 |
|
41 |
+
Tested up to: 3.2
|
42 |
Requires at least: 3.1
|
43 |
Requires: WordPress® 3.1+, PHP 5.2.3+
|
44 |
|
55 |
Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
|
56 |
Privacy URI: http://www.primothemes.com/about/privacy-policy/
|
57 |
PayPal Pro Integration: http://www.primothemes.com/forums/viewtopic.php?f=4&t=304
|
58 |
+
Professional Installation URI: http://www.s2member.com/professional-installation/
|
59 |
Plugin URI: http://www.primothemes.com/post/product/s2member-membership-plugin-with-paypal/
|
60 |
+
Description: s2Member® (Membership w/ PayPal®). Powerful (free) membership capabilities. Protect/secure members only content w/ roles/capabilities for members.
|
61 |
Tags: membership, members, member, register, signup, paypal, paypal pro, pay pal, s2member, authorize.net, google checkout, ccbill, clickbank, alipay, 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
|
62 |
|
63 |
-- end section for WordPress® parsing. ------------------------------------------------------------------------------- */
|
72 |
* @var str
|
73 |
*/
|
74 |
if (!defined ("WS_PLUGIN__S2MEMBER_VERSION"))
|
75 |
+
define ("WS_PLUGIN__S2MEMBER_VERSION", "110708");
|
76 |
/**
|
77 |
* Minimum PHP version required to run s2Member.
|
78 |
*
|
102 |
* @var str
|
103 |
*/
|
104 |
if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION"))
|
105 |
+
define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "110708");
|
106 |
/*
|
107 |
Several compatibility checks.
|
108 |
If all pass, load the s2Member plugin.
|