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

Version Description

  • Documentation fix. s2Member -> API Scripting -> Advanced Conditionals -> Example #5 contained a PHP syntax error. This has been corrected in v2.9.3.
  • Bug fix. Infinite redirection loop on Download Limit Exceeded Page. This was possible under certain circumstances, based on configuration. Resolved in v2.9.3.
  • s2Member fully tested under WordPress 3.0-beta2. Everything looks good. If you find any bugs, please report them here.
  • New feature. A couple of Replacement Codes are now supported in the s2Member URI Level Access Restrictions. See: s2Member -> General Options -> URI Level Access for further details. This can be useful if you're running BuddyPress. For example, if you're using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: /members/%%current_user_login%%/groups/
  • New feature. For protected File Downloads, you may now specify a list of file extensions that should be displayed Inline ( in your browser ) as opposed to being downloaded as an attachment. See: s2Member -> Download Options -> Inline Extensions. A new API Constant was also added, which reflects the value of this option: S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS.
  • Documentation change. This is only relevant if you've been using the s2member_xencrypt() function to provide free access to specific files. The documentation for this has been changed. You should now use s2member_free_file_download_key=<?php echo md5(s2member_xencrypt("file")); ?>, instead of just s2member_xencrypt() by itself ( which is now deprecated ). The addition of the MD5 hash improves the security of s2Member on a whole, and also makes your links shorter. Please update your links. In future versions of s2Member, the older method will no longer be supported.
  • Compatiblity fix. Calls to the PHP mail() function have been modified to exclude additional flag parameters. This makes s2Member more compatible with a variety of MTAs across different hosting providers.
  • New feature. A couple of Replacement Codes are now supported in the s2Member Login Redirection URL. See: s2Member -> General Options -> Login Welcome Page -> Special Redirection for further details. This can be useful if you'd like to redirect Members to their BuddyPress Profile, if/when BuddyPress is installed together with s2Member. For example, if you're using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: http://www.example.com/members/%%current_user_login%%/profile/
  • Please note. BuddyPress is NOT required to use s2Member. However, the combination of BuddyPress + s2Member is a popular choice among site owners.
Download this release

Release Info

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

Code changes from version 2.9.2 to 2.9.3

includes/functions/catg-level-access.inc.php CHANGED
@@ -36,25 +36,25 @@ function ws_plugin__s2member_check_catg_level_access ()
36
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
37
  exit;
38
  /**/
39
- else if (in_array ($cat_ID, ($level1_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
40
  exit;
41
  /**/
42
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
43
  exit;
44
  /**/
45
- else if (in_array ($cat_ID, ($level2_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
46
  exit;
47
  /**/
48
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
49
  exit;
50
  /**/
51
- else if (in_array ($cat_ID, ($level3_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
52
  exit;
53
  /**/
54
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
55
  exit;
56
  /**/
57
- else if (in_array ($cat_ID, ($level4_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
58
  exit;
59
  /**/
60
  foreach ($level1_catgs as $catg)
@@ -78,25 +78,25 @@ function ws_plugin__s2member_check_catg_level_access ()
78
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
79
  exit;
80
  /**/
81
- else if (($level1_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"])) && (in_category ($level1_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level1_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
82
  exit;
83
  /**/
84
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
85
  exit;
86
  /**/
87
- else if (($level2_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"])) && (in_category ($level2_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level2_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
88
  exit;
89
  /**/
90
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
91
  exit;
92
  /**/
93
- else if (($level3_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"])) && (in_category ($level3_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level3_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
94
  exit;
95
  /**/
96
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
97
  exit;
98
  /**/
99
- else if (($level4_catgs = preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"])) && (in_category ($level4_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level4_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
100
  exit;
101
  }
102
  /**/
36
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
37
  exit;
38
  /**/
39
+ else if (in_array ($cat_ID, ($level1_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
40
  exit;
41
  /**/
42
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
43
  exit;
44
  /**/
45
+ else if (in_array ($cat_ID, ($level2_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
46
  exit;
47
  /**/
48
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
49
  exit;
50
  /**/
51
+ else if (in_array ($cat_ID, ($level3_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
52
  exit;
53
  /**/
54
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
55
  exit;
56
  /**/
57
+ else if (in_array ($cat_ID, ($level4_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"]))) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
58
  exit;
59
  /**/
60
  foreach ($level1_catgs as $catg)
78
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
79
  exit;
80
  /**/
81
+ else if (($level1_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_catgs"])) && (in_category ($level1_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level1_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
82
  exit;
83
  /**/
84
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
85
  exit;
86
  /**/
87
+ else if (($level2_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_catgs"])) && (in_category ($level2_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level2_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
88
  exit;
89
  /**/
90
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
91
  exit;
92
  /**/
93
+ else if (($level3_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_catgs"])) && (in_category ($level3_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level3_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
94
  exit;
95
  /**/
96
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
97
  exit;
98
  /**/
99
+ else if (($level4_catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"])) && (in_category ($level4_catgs, $post_ID) || ws_plugin__s2member_in_descendant_category ($level4_catgs, $post_ID)) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
100
  exit;
101
  }
102
  /**/
includes/functions/constants.inc.php CHANGED
@@ -80,6 +80,8 @@ function ws_plugin__s2member_constants ()
80
  define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed_days"]); /* This is (int) allowed days. */
81
  define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"]); /* This is (int) allowed days. */
82
  /**/
 
 
83
  define ("S2MEMBER_REG_EMAIL_FROM_NAME", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]); /* This is the name that outgoing email messages are sent by. */
84
  define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]); /* This is the email that outgoing messages are sent by. */
85
  /**/
80
  define ("S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_file_downloads_allowed_days"]); /* This is (int) allowed days. */
81
  define ("S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS", (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_file_downloads_allowed_days"]); /* This is (int) allowed days. */
82
  /**/
83
+ define ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]); /* This is the (string) list of extensions. */
84
+ /**/
85
  define ("S2MEMBER_REG_EMAIL_FROM_NAME", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]); /* This is the name that outgoing email messages are sent by. */
86
  define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]); /* This is the email that outgoing messages are sent by. */
87
  /**/
includes/functions/file-download-access.inc.php CHANGED
@@ -134,25 +134,26 @@ function ws_plugin__s2member_check_file_download_access ()
134
  /**/
135
  $file_download_access_is_allowed = $minimum_level_required_to_download_files = ws_plugin__s2member_min_level_4_downloads ();
136
  /**/
137
- if (!($current_user = (is_user_logged_in ()) ? wp_get_current_user () : false) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=" . urlencode ($minimum_level_required_to_download_files))) !== "nill")
 
138
  exit;
139
  /**/
140
  else if (!$file_download_access_is_allowed) /* Have file downloads even been enabled? */
141
  {
142
  header ("HTTP/1.0 503 Service Temporarily Unavailable");
143
- echo '503 File Downloads Are Not Enabled.';
144
  exit;
145
  }
146
  /**/
147
  else if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
148
  {
149
  header ("HTTP/1.0 404 Not Found"); /* The file does not even exist. */
150
- echo '404 File Download Not Found.';
151
  exit;
152
  }
153
  /**/
154
  else if ((!is_array ($file_downloads = ws_plugin__s2member_user_downloads ()) || !$file_downloads["allowed"] || !$file_downloads["allowed_days"])/**/
155
- && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]), "s2member_file_download=" . urlencode ($_GET["s2member_file_download"]))) !== "nill")
156
  exit;
157
  /**/
158
  $previous_file_downloads = 0; /* Here we're going to count how many downloads they've performed. */
@@ -177,11 +178,12 @@ function ws_plugin__s2member_check_file_download_access ()
177
  }
178
  /**/
179
  if (!$already_downloaded && $previous_file_downloads >= $file_downloads["allowed"] /* They have NOT already downloaded this file, and they're over their limit. */
180
- && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]), "s2member_file_download=" . urlencode ($_GET["s2member_file_download"]))) !== "nill")
181
  exit;
182
  /**/
183
  if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
184
  $file_download_access_log[] = array ("date" => date ("Y-m-d"), "file" => $_GET["s2member_file_download"]);
 
185
  update_usermeta ($current_user->ID, "s2member_file_download_access_arc", ws_plugin__s2member_array_unique ($file_download_access_arc));
186
  update_usermeta ($current_user->ID, "s2member_file_download_access_log", ws_plugin__s2member_array_unique ($file_download_access_log));
187
  }
@@ -192,7 +194,7 @@ function ws_plugin__s2member_check_file_download_access ()
192
  if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
193
  {
194
  header ("HTTP/1.0 404 Not Found"); /* The file does not exist. */
195
- echo '404 File Download Not Found.';
196
  exit;
197
  }
198
  }
@@ -200,32 +202,33 @@ function ws_plugin__s2member_check_file_download_access ()
200
  Here we are going to put together all of the file download information.
201
  */
202
  $mimetypes = parse_ini_file (dirname (dirname (dirname (__FILE__))) . "/includes/mime-types.ini");
203
- /**/
204
- $pathinfo = pathinfo ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]);
205
- /**/
206
  $extension = strtolower ($pathinfo["extension"]); /* Convert file extension to lowercase format for MIME type lookup. */
207
- /**/
208
  $mimetype = ($mimetypes[$extension]) ? $mimetypes[$extension] : "application/octet-stream"; /* Lookup MIME type. */
209
- /**/
210
- $length = filesize ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]);
211
  /**/
212
  do_action ("s2member_during_file_download_access"); /* Give plugins a chance. */
213
  /*
214
  Now send the file to the browser. Be sure to turn off output compression.
215
  */
216
- ini_set ("zlib.output_compression", 0);
217
  /**/
218
  header ("Content-Encoding: none");
219
  header ("Content-Type: " . $mimetype);
220
  header ("Content-Length: " . $length);
221
- header ('Content-Disposition: attachment; filename="' . $pathinfo["basename"] . '"');
 
 
 
222
  header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
223
  header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
224
  header ("Cache-Control: no-cache, must-revalidate, max-age=0");
225
  header ("Cache-Control: post-check=0, pre-check=0", false);
226
  header ("Pragma: no-cache");
227
  /**/
228
- readfile ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]);
229
  /**/
230
  exit;
231
  }
134
  /**/
135
  $file_download_access_is_allowed = $minimum_level_required_to_download_files = ws_plugin__s2member_min_level_4_downloads ();
136
  /**/
137
+ if (!($current_user = (is_user_logged_in ()) ? wp_get_current_user () : false) /* Redirect Users who are not logged in. */
138
+ && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=" . urlencode ($minimum_level_required_to_download_files) . "&s2member_file_download_req=" . urlencode ($_GET["s2member_file_download"]))) !== "nill")
139
  exit;
140
  /**/
141
  else if (!$file_download_access_is_allowed) /* Have file downloads even been enabled? */
142
  {
143
  header ("HTTP/1.0 503 Service Temporarily Unavailable");
144
+ echo '503: File Downloads Are Not Enabled.';
145
  exit;
146
  }
147
  /**/
148
  else if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
149
  {
150
  header ("HTTP/1.0 404 Not Found"); /* The file does not even exist. */
151
+ echo '404: File Download Not Found.';
152
  exit;
153
  }
154
  /**/
155
  else if ((!is_array ($file_downloads = ws_plugin__s2member_user_downloads ()) || !$file_downloads["allowed"] || !$file_downloads["allowed_days"])/**/
156
+ && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]), "s2member_file_download_req=" . urlencode ($_GET["s2member_file_download"]))) !== "nill")
157
  exit;
158
  /**/
159
  $previous_file_downloads = 0; /* Here we're going to count how many downloads they've performed. */
178
  }
179
  /**/
180
  if (!$already_downloaded && $previous_file_downloads >= $file_downloads["allowed"] /* They have NOT already downloaded this file, and they're over their limit. */
181
+ && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]), "s2member_file_download_req=" . urlencode ($_GET["s2member_file_download"]))) !== "nill")
182
  exit;
183
  /**/
184
  if (!$already_downloaded) /* Only add this file to the log if they have not already downloaded it. */
185
  $file_download_access_log[] = array ("date" => date ("Y-m-d"), "file" => $_GET["s2member_file_download"]);
186
+ /**/
187
  update_usermeta ($current_user->ID, "s2member_file_download_access_arc", ws_plugin__s2member_array_unique ($file_download_access_arc));
188
  update_usermeta ($current_user->ID, "s2member_file_download_access_log", ws_plugin__s2member_array_unique ($file_download_access_log));
189
  }
194
  if (!file_exists ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]))
195
  {
196
  header ("HTTP/1.0 404 Not Found"); /* The file does not exist. */
197
+ echo '404: File Download Not Found.';
198
  exit;
199
  }
200
  }
202
  Here we are going to put together all of the file download information.
203
  */
204
  $mimetypes = parse_ini_file (dirname (dirname (dirname (__FILE__))) . "/includes/mime-types.ini");
205
+ $pathinfo = pathinfo ($file = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/" . $_GET["s2member_file_download"]);
 
 
206
  $extension = strtolower ($pathinfo["extension"]); /* Convert file extension to lowercase format for MIME type lookup. */
207
+ $inline = (in_array ($extension, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]))) ? true : false;
208
  $mimetype = ($mimetypes[$extension]) ? $mimetypes[$extension] : "application/octet-stream"; /* Lookup MIME type. */
209
+ $basename = $pathinfo["basename"]; /* The actual file name, including its extension. */
210
+ $length = filesize ($file); /* The overall file size, in bytes. */
211
  /**/
212
  do_action ("s2member_during_file_download_access"); /* Give plugins a chance. */
213
  /*
214
  Now send the file to the browser. Be sure to turn off output compression.
215
  */
216
+ ini_set ("zlib.output_compression", 0); /* Must be turned off. */
217
  /**/
218
  header ("Content-Encoding: none");
219
  header ("Content-Type: " . $mimetype);
220
  header ("Content-Length: " . $length);
221
+ /**/
222
+ if (!$inline) /* If not inline, we default to serving the file as an attachment. */
223
+ header ('Content-Disposition: attachment; filename="' . $basename . '"');
224
+ /**/
225
  header ("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT");
226
  header ("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
227
  header ("Cache-Control: no-cache, must-revalidate, max-age=0");
228
  header ("Cache-Control: post-check=0, pre-check=0", false);
229
  header ("Pragma: no-cache");
230
  /**/
231
+ readfile ($file);
232
  /**/
233
  exit;
234
  }
includes/functions/js-globals.inc.php CHANGED
@@ -116,6 +116,8 @@ function ws_plugin__s2member_js_w_globals ()
116
  $g .= "S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
117
  $g .= "S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
118
  /**/
 
 
119
  $g .= "S2MEMBER_REG_EMAIL_FROM_NAME = '" . preg_replace ("/'/", "\'", S2MEMBER_REG_EMAIL_FROM_NAME) . "',";
120
  $g .= "S2MEMBER_REG_EMAIL_FROM_EMAIL = '" . preg_replace ("/'/", "\'", S2MEMBER_REG_EMAIL_FROM_EMAIL) . "',";
121
  /**/
116
  $g .= "S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
117
  $g .= "S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS . ",";
118
  /**/
119
+ $g .= "S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '" . preg_replace ("/'/", "\'", S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS) . "',";
120
+ /**/
121
  $g .= "S2MEMBER_REG_EMAIL_FROM_NAME = '" . preg_replace ("/'/", "\'", S2MEMBER_REG_EMAIL_FROM_NAME) . "',";
122
  $g .= "S2MEMBER_REG_EMAIL_FROM_EMAIL = '" . preg_replace ("/'/", "\'", S2MEMBER_REG_EMAIL_FROM_EMAIL) . "',";
123
  /**/
includes/functions/login-redirection.inc.php CHANGED
@@ -23,14 +23,15 @@ function ws_plugin__s2member_login_redirect ($username = FALSE)
23
  /**/
24
  $user = new WP_User ($username); /* Get user object reference. */
25
  /**/
26
- if (!$user->has_cap ("edit_posts")) /* In other words, all Subscribers & Members. */
27
  {
28
- do_action ("s2member_during_login_redirect");
29
  /**/
30
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"])
31
- wp_redirect ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]);
 
32
  /**/
33
- else /* Otherwise, use the Login Welcome Page. */
34
  wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
35
  /**/
36
  exit;
@@ -40,4 +41,19 @@ function ws_plugin__s2member_login_redirect ($username = FALSE)
40
  /**/
41
  return;
42
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ?>
23
  /**/
24
  $user = new WP_User ($username); /* Get user object reference. */
25
  /**/
26
+ if (!$user->has_cap ("edit_posts")) /* Subscribers & Members. */
27
  {
28
+ do_action ("s2member_during_login_redirect"); /* Custom redirections. */
29
  /**/
30
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"])
31
+ wp_redirect (ws_plugin__s2member_fill_login_redirect_rc_vars /* Special. */
32
+ ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]));
33
  /**/
34
+ else /* Otherwise, use the Login Welcome Page for s2Member. */
35
  wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
36
  /**/
37
  exit;
41
  /**/
42
  return;
43
  }
44
+ /*
45
+ Function that fills replacement code variables in special redirection URLs.
46
+ */
47
+ function ws_plugin__s2member_fill_login_redirect_rc_vars ($url = FALSE, $current_user = FALSE)
48
+ {
49
+ do_action ("s2member_before_fill_login_redirect_rc_vars");
50
+ /**/
51
+ $current_user_login = (is_object ($current_user)) ? strtolower ($current_user->user_login) : "";
52
+ $current_user_ID = (is_object ($current_user)) ? (string)$current_user->ID : "";
53
+ /**/
54
+ $url = preg_replace ("/%%current_user_login%%/i", $current_user_login, $url);
55
+ $url = preg_replace ("/%%current_user_ID%%/i", $current_user_ID, $url);
56
+ /**/
57
+ return apply_filters ("s2member_fill_login_redirect_rc_vars", $url);
58
+ }
59
  ?>
includes/functions/page-level-access.inc.php CHANGED
@@ -38,28 +38,28 @@ function ws_plugin__s2member_check_page_level_access ()
38
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
39
  exit;
40
  /**/
41
- else if (in_array ($page_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
42
  exit;
43
  /**/
44
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
45
  exit;
46
  /**/
47
- else if (in_array ($page_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
48
  exit;
49
  /**/
50
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
51
  exit;
52
  /**/
53
- else if (in_array ($page_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
54
  exit;
55
  /**/
56
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
57
  exit;
58
  /**/
59
- else if (in_array ($page_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
60
  exit;
61
  /**/
62
- else if (in_array ($page_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["single_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && !ws_plugin__s2member_sp_access ($page_ID) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_sp_req=" . urlencode ($page_ID))) !== "nill")
63
  exit;
64
  /**/
65
  do_action ("s2member_during_check_page_level_access");
38
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
39
  exit;
40
  /**/
41
+ else if (in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
42
  exit;
43
  /**/
44
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
45
  exit;
46
  /**/
47
+ else if (in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
48
  exit;
49
  /**/
50
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
51
  exit;
52
  /**/
53
+ else if (in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
54
  exit;
55
  /**/
56
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
57
  exit;
58
  /**/
59
+ else if (in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
60
  exit;
61
  /**/
62
+ else if (in_array ($page_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["single_pages"])) && ws_plugin__s2member_nocache_constants () !== "nill" && !ws_plugin__s2member_sp_access ($page_ID) && !ws_plugin__s2member_is_systematic_use_page () && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_sp_req=" . urlencode ($page_ID))) !== "nill")
63
  exit;
64
  /**/
65
  do_action ("s2member_during_check_page_level_access");
includes/functions/paypal-notify.inc.php CHANGED
@@ -68,7 +68,7 @@ function ws_plugin__s2member_paypal_notify ()
68
  /**/
69
  if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
70
  {
71
- @mail ($paypal["payer_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", "-f " . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]);
72
  /**/
73
  $paypal["s2member_log"][] = "Single-Page Confirmation Email sent to Customer, with a URL that provides Single-Page Access.";
74
  }
@@ -141,7 +141,7 @@ function ws_plugin__s2member_paypal_notify ()
141
  /**/
142
  $paypal["s2member_log"][] = "s2Member Level/Capabilities updated w/ advanced update routines.";
143
  /**/
144
- @mail ($paypal["payer_email"], "Thank You! Your membership has been updated.", "Thank You! Your membership has been updated to:\n" . $paypal["item_name"] . "\n\nYou\\'ll need to log back in now.\n" . wp_login_url (), "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", "-f " . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]);
145
  /**/
146
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
147
  /**/
@@ -203,7 +203,7 @@ function ws_plugin__s2member_paypal_notify ()
203
  /**/
204
  if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
205
  {
206
- @mail ($paypal["payer_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", "-f " . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]);
207
  /**/
208
  $paypal["s2member_log"][] = "Signup Confirmation Email sent to Customer, with a URL to assist w/ registration.";
209
  }
@@ -279,7 +279,7 @@ function ws_plugin__s2member_paypal_notify ()
279
  /**/
280
  $paypal["s2member_log"][] = "s2Member Level/Capabilities updated on subscription modification.";
281
  /**/
282
- @mail ($paypal["payer_email"], "Thank You! Your membership has been updated.", "Thank You! Your membership has been updated to:\n" . $paypal["item_name"] . "\n\nYou\\'ll need to log back in now.\n" . wp_login_url (), "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", "-f " . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]);
283
  /**/
284
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
285
  /**/
68
  /**/
69
  if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
70
  {
71
+ @mail ($paypal["payer_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");
72
  /**/
73
  $paypal["s2member_log"][] = "Single-Page Confirmation Email sent to Customer, with a URL that provides Single-Page Access.";
74
  }
141
  /**/
142
  $paypal["s2member_log"][] = "s2Member Level/Capabilities updated w/ advanced update routines.";
143
  /**/
144
+ @mail ($paypal["payer_email"], "Thank You! Your membership has been updated.", "Thank You! Your membership has been updated to:\n" . $paypal["item_name"] . "\n\nYou\\'ll need to log back in now.\n" . wp_login_url (), "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");
145
  /**/
146
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
147
  /**/
203
  /**/
204
  if (($sbj = trim ($sbj)) && ($msg = trim ($msg))) /* Make sure they are not empty. */
205
  {
206
+ @mail ($paypal["payer_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");
207
  /**/
208
  $paypal["s2member_log"][] = "Signup Confirmation Email sent to Customer, with a URL to assist w/ registration.";
209
  }
279
  /**/
280
  $paypal["s2member_log"][] = "s2Member Level/Capabilities updated on subscription modification.";
281
  /**/
282
+ @mail ($paypal["payer_email"], "Thank You! Your membership has been updated.", "Thank You! Your membership has been updated to:\n" . $paypal["item_name"] . "\n\nYou\\'ll need to log back in now.\n" . wp_login_url (), "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");
283
  /**/
284
  $paypal["s2member_log"][] = "Modification Confirmation Email sent to Customer, with a URL that provides them with a way to log back in.";
285
  /**/
includes/functions/paypal-return.inc.php CHANGED
@@ -46,6 +46,8 @@ function ws_plugin__s2member_paypal_return ()
46
  /**/
47
  if (($sp_access_url = ws_plugin__s2member_sp_access_link_gen ($paypal["page"], $paypal["hours"], false)))
48
  {
 
 
49
  do_action ("s2member_during_paypal_return_during_sp_access");
50
  /**/
51
  header ("Location: " . $sp_access_url);
46
  /**/
47
  if (($sp_access_url = ws_plugin__s2member_sp_access_link_gen ($paypal["page"], $paypal["hours"], false)))
48
  {
49
+ $paypal["s2member_log"][] = "Redirecting Customer to the Single-Page.";
50
+ /**/
51
  do_action ("s2member_during_paypal_return_during_sp_access");
52
  /**/
53
  header ("Location: " . $sp_access_url);
includes/functions/post-level-access.inc.php CHANGED
@@ -34,25 +34,25 @@ function ws_plugin__s2member_check_post_level_access ()
34
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
35
  exit;
36
  /**/
37
- else if (in_array ($post_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
38
  exit;
39
  /**/
40
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
41
  exit;
42
  /**/
43
- else if (in_array ($post_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
44
  exit;
45
  /**/
46
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
47
  exit;
48
  /**/
49
- else if (in_array ($post_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
50
  exit;
51
  /**/
52
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
53
  exit;
54
  /**/
55
- else if (in_array ($post_ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
56
  exit;
57
  /**/
58
  do_action ("s2member_during_check_post_level_access");
34
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
35
  exit;
36
  /**/
37
+ else if (in_array ($post_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
38
  exit;
39
  /**/
40
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
41
  exit;
42
  /**/
43
+ else if (in_array ($post_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
44
  exit;
45
  /**/
46
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
47
  exit;
48
  /**/
49
+ else if (in_array ($post_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
50
  exit;
51
  /**/
52
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
53
  exit;
54
  /**/
55
+ else if (in_array ($post_ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_posts"])) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
56
  exit;
57
  /**/
58
  do_action ("s2member_during_check_post_level_access");
includes/functions/profile-modifications.inc.php CHANGED
@@ -45,7 +45,7 @@ function ws_plugin__s2member_handle_profile_modifications ()
45
  /**/
46
  wp_update_user ($userdata); /* Send this array for an update. */
47
  /**/
48
- foreach (preg_split ("/[\r\n\t,;]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
49
  {
50
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
51
  {
45
  /**/
46
  wp_update_user ($userdata); /* Send this array for an update. */
47
  /**/
48
+ foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
49
  {
50
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
51
  {
includes/functions/ptag-level-access.inc.php CHANGED
@@ -36,25 +36,25 @@ function ws_plugin__s2member_check_ptag_level_access ()
36
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
37
  exit;
38
  /**/
39
- else if (($level1_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"]))) && is_tag ($level1_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
40
  exit;
41
  /**/
42
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
43
  exit;
44
  /**/
45
- else if (($level2_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"]))) && is_tag ($level2_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
46
  exit;
47
  /**/
48
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
49
  exit;
50
  /**/
51
- else if (($level3_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"]))) && is_tag ($level3_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
52
  exit;
53
  /**/
54
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
55
  exit;
56
  /**/
57
- else if (($level4_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ptags"]))) && is_tag ($level4_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
58
  exit;
59
  }
60
  else if (is_single () && has_tag () && $post_ID)
@@ -62,25 +62,25 @@ function ws_plugin__s2member_check_ptag_level_access ()
62
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
63
  exit;
64
  /**/
65
- else if (($level1_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"]))) && has_tag ($level1_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
66
  exit;
67
  /**/
68
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
69
  exit;
70
  /**/
71
- else if (($level2_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"]))) && has_tag ($level2_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
72
  exit;
73
  /**/
74
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
75
  exit;
76
  /**/
77
- else if (($level3_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"]))) && has_tag ($level3_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
78
  exit;
79
  /**/
80
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
81
  exit;
82
  /**/
83
- else if (($level4_ptags = preg_split ("/,/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ptags"]))) && has_tag ($level4_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
84
  exit;
85
  }
86
  /**/
36
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
37
  exit;
38
  /**/
39
+ else if (($level1_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"]))) && is_tag ($level1_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
40
  exit;
41
  /**/
42
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
43
  exit;
44
  /**/
45
+ else if (($level2_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"]))) && is_tag ($level2_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
46
  exit;
47
  /**/
48
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
49
  exit;
50
  /**/
51
+ else if (($level3_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"]))) && is_tag ($level3_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
52
  exit;
53
  /**/
54
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_catgs"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
55
  exit;
56
  /**/
57
+ else if (($level4_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ptags"]))) && is_tag ($level4_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
58
  exit;
59
  }
60
  else if (is_single () && has_tag () && $post_ID)
62
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
63
  exit;
64
  /**/
65
+ else if (($level1_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ptags"]))) && has_tag ($level1_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
66
  exit;
67
  /**/
68
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
69
  exit;
70
  /**/
71
+ else if (($level2_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ptags"]))) && has_tag ($level2_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
72
  exit;
73
  /**/
74
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
75
  exit;
76
  /**/
77
+ else if (($level3_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ptags"]))) && has_tag ($level3_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
78
  exit;
79
  /**/
80
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ptags"] === "all" && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
81
  exit;
82
  /**/
83
+ else if (($level4_ptags = preg_split ("/[\r\n\t;,]+/", preg_replace ("/( +)/", "-", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ptags"]))) && has_tag ($level4_ptags) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
84
  exit;
85
  }
86
  /**/
includes/functions/register-access.inc.php CHANGED
@@ -110,7 +110,7 @@ function ws_plugin__s2member_custom_registration_fields ()
110
  echo '</label>' . "\n";
111
  echo '</p>';
112
  /**/
113
- foreach (preg_split ("/[\r\n\t,;]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
114
  {
115
  $req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
116
  $req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
@@ -230,7 +230,7 @@ function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
230
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
231
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
232
  /**/
233
- foreach (preg_split ("/[\r\n\t,;]+/", $mailchimp_list_ids) as $mailchimp_list_id)
234
  $MCAPI->listSubscribe ($mailchimp_list_id, $email, array ("FNAME" => $fname, "LNAME" => $lname, "OPTINIP" => $_SERVER["REMOTE_ADDR"]));
235
  }
236
  /**/
@@ -241,7 +241,7 @@ function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
241
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
242
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
243
  /**/
244
- foreach (preg_split ("/[\r\n\t,;]+/", $aweber_list_ids) as $aweber_list_id)
245
  @mail ($aweber_list_id . "@aweber.com", "s2Member Subscription Request",/**/
246
  "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nBuyer: " . $fname . " " . $lname . "\n - end.",/**/
247
  "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
@@ -296,7 +296,7 @@ function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
296
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
297
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
298
  /**/
299
- foreach (preg_split ("/[\r\n\t,;]+/", $mailchimp_list_ids) as $mailchimp_list_id)
300
  $MCAPI->listSubscribe ($mailchimp_list_id, $email, array ("FNAME" => $fname, "LNAME" => $lname, "OPTINIP" => ""));
301
  }
302
  /**/
@@ -312,7 +312,7 @@ function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
312
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
313
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
314
  /**/
315
- foreach (preg_split ("/[\r\n\t,;]+/", $mailchimp_list_ids) as $mailchimp_list_id)
316
  $MCAPI->listSubscribe ($mailchimp_list_id, $email, array ("FNAME" => $fname, "LNAME" => $lname, "OPTINIP" => ""));
317
  }
318
  /**/
@@ -323,7 +323,7 @@ function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
323
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
324
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
325
  /**/
326
- foreach (preg_split ("/[\r\n\t,;]+/", $aweber_list_ids) as $aweber_list_id)
327
  @mail ($aweber_list_id . "@aweber.com", "s2Member Subscription Request",/**/
328
  "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nBuyer: " . $fname . " " . $lname . "\n - end.",/**/
329
  "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
@@ -336,7 +336,7 @@ function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
336
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
337
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
338
  /**/
339
- foreach (preg_split ("/[\r\n\t,;]+/", $aweber_list_ids) as $aweber_list_id)
340
  @mail ($aweber_list_id . "@aweber.com", "s2Member Subscription Request",/**/
341
  "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nBuyer: " . $fname . " " . $lname . "\n - end.",/**/
342
  "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
@@ -380,7 +380,7 @@ function ws_plugin__s2member_configure_user_registration ($user_id = FALSE)
380
  if (!$user->last_name && ($last_name = trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"])))
381
  update_usermeta ($user_id, "last_name", $last_name);
382
  /**/
383
- foreach (preg_split ("/[\r\n\t,;]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
384
  {
385
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
386
  {
110
  echo '</label>' . "\n";
111
  echo '</p>';
112
  /**/
113
+ foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
114
  {
115
  $req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
116
  $req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
230
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
231
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
232
  /**/
233
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $mailchimp_list_ids) as $mailchimp_list_id)
234
  $MCAPI->listSubscribe ($mailchimp_list_id, $email, array ("FNAME" => $fname, "LNAME" => $lname, "OPTINIP" => $_SERVER["REMOTE_ADDR"]));
235
  }
236
  /**/
241
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
242
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
243
  /**/
244
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $aweber_list_ids) as $aweber_list_id)
245
  @mail ($aweber_list_id . "@aweber.com", "s2Member Subscription Request",/**/
246
  "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nBuyer: " . $fname . " " . $lname . "\n - end.",/**/
247
  "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
296
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
297
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
298
  /**/
299
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $mailchimp_list_ids) as $mailchimp_list_id)
300
  $MCAPI->listSubscribe ($mailchimp_list_id, $email, array ("FNAME" => $fname, "LNAME" => $lname, "OPTINIP" => ""));
301
  }
302
  /**/
312
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
313
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
314
  /**/
315
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $mailchimp_list_ids) as $mailchimp_list_id)
316
  $MCAPI->listSubscribe ($mailchimp_list_id, $email, array ("FNAME" => $fname, "LNAME" => $lname, "OPTINIP" => ""));
317
  }
318
  /**/
323
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
324
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
325
  /**/
326
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $aweber_list_ids) as $aweber_list_id)
327
  @mail ($aweber_list_id . "@aweber.com", "s2Member Subscription Request",/**/
328
  "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nBuyer: " . $fname . " " . $lname . "\n - end.",/**/
329
  "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
336
  $fname = ($user->first_name) ? $user->first_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_first_name"]);
337
  $lname = ($user->last_name) ? $user->last_name : trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"]);
338
  /**/
339
+ foreach (preg_split ("/[\r\n\t\s;,]+/", $aweber_list_ids) as $aweber_list_id)
340
  @mail ($aweber_list_id . "@aweber.com", "s2Member Subscription Request",/**/
341
  "s2Member Subscription Request\ns2Member w/ PayPal Email ID\nBuyer: " . $fname . " " . $lname . "\n - end.",/**/
342
  "From: \"" . preg_replace ("/\"/", "", $fname . " " . $lname) . "\" <" . $email . ">\r\nContent-Type: text/plain; charset=utf-8");
380
  if (!$user->last_name && ($last_name = trim ($_POST["ws_plugin__s2member_custom_reg_field_last_name"])))
381
  update_usermeta ($user_id, "last_name", $last_name);
382
  /**/
383
+ foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
384
  {
385
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
386
  {
includes/functions/ruri-level-access.inc.php CHANGED
@@ -14,7 +14,7 @@ Direct access denial.
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit;
16
  /*
17
- Function for handling request uri level access permissions.
18
  Attach to: add_action("template_redirect");
19
  */
20
  function ws_plugin__s2member_check_ruri_level_access ()
@@ -27,19 +27,19 @@ function ws_plugin__s2member_check_ruri_level_access ()
27
  {
28
  $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Is a user logged in? */
29
  /**/
30
- foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ruris"]) as $str)
31
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
32
  exit;
33
  /**/
34
- foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ruris"]) as $str)
35
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
36
  exit;
37
  /**/
38
- foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ruris"]) as $str)
39
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
40
  exit;
41
  /**/
42
- foreach (preg_split ("/[\r\n\t]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ruris"]) as $str)
43
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
44
  exit;
45
  /**/
@@ -50,4 +50,19 @@ function ws_plugin__s2member_check_ruri_level_access ()
50
  /**/
51
  return;
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  ?>
14
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
15
  exit;
16
  /*
17
+ Function for handling Request URI Level Access permissions.
18
  Attach to: add_action("template_redirect");
19
  */
20
  function ws_plugin__s2member_check_ruri_level_access ()
27
  {
28
  $current_user = (is_user_logged_in ()) ? wp_get_current_user () : false; /* Is a user logged in? */
29
  /**/
30
+ foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_ruris"], $current_user)) as $str)
31
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level1")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=1")) !== "nill")
32
  exit;
33
  /**/
34
+ foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_ruris"], $current_user)) as $str)
35
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level2")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=2")) !== "nill")
36
  exit;
37
  /**/
38
+ foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_ruris"], $current_user)) as $str)
39
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level3")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=3")) !== "nill")
40
  exit;
41
  /**/
42
+ foreach (preg_split ("/[\r\n\t]+/", ws_plugin__s2member_fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_ruris"], $current_user)) as $str)
43
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && ws_plugin__s2member_nocache_constants () !== "nill" && (!$current_user || !current_user_can ("access_s2member_level4")) && wp_redirect (ws_plugin__s2member_append_query_var (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]), "s2member_level_req=4")) !== "nill")
44
  exit;
45
  /**/
50
  /**/
51
  return;
52
  }
53
+ /*
54
+ Function that fills replacement code variables in URIs; collectively.
55
+ */
56
+ function ws_plugin__s2member_fill_ruri_level_access_rc_vars ($uris = FALSE, $current_user = FALSE)
57
+ {
58
+ do_action ("s2member_before_fill_ruri_level_access_rc_vars");
59
+ /**/
60
+ $current_user_login = (is_object ($current_user)) ? strtolower ($current_user->user_login) : "";
61
+ $current_user_ID = (is_object ($current_user)) ? (string)$current_user->ID : "";
62
+ /**/
63
+ $uris = preg_replace ("/%%current_user_login%%/i", $current_user_login, $uris);
64
+ $uris = preg_replace ("/%%current_user_ID%%/i", $current_user_ID, $uris);
65
+ /**/
66
+ return apply_filters ("s2member_fill_ruri_level_access_rc_vars", $uris);
67
+ }
68
  ?>
includes/functions/users-list.inc.php CHANGED
@@ -27,7 +27,7 @@ function ws_plugin__s2member_users_list_cols ($cols = FALSE)
27
  /**/
28
  if (!defined ("BP_VERSION")) /* Custom fields are not compatible when running together with BuddyPress. */
29
  {
30
- foreach (preg_split ("/[\r\n\t,;]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
31
  {
32
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
33
  {
@@ -111,7 +111,7 @@ function ws_plugin__s2member_users_list_edit_cols ($user = FALSE)
111
  {
112
  $fields = get_usermeta ($user->ID, "s2member_custom_fields");
113
  /**/
114
- foreach (preg_split ("/[\r\n\t,;]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
115
  {
116
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
117
  {
@@ -161,7 +161,7 @@ function ws_plugin__s2member_users_list_update_cols ($user_id = FALSE)
161
  /**/
162
  if (!defined ("BP_VERSION")) /* Custom fields are not compatible when running together with BuddyPress. */
163
  {
164
- foreach (preg_split ("/[\r\n\t,;]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
165
  {
166
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
167
  {
27
  /**/
28
  if (!defined ("BP_VERSION")) /* Custom fields are not compatible when running together with BuddyPress. */
29
  {
30
+ foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
31
  {
32
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
33
  {
111
  {
112
  $fields = get_usermeta ($user->ID, "s2member_custom_fields");
113
  /**/
114
+ foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
115
  {
116
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
117
  {
161
  /**/
162
  if (!defined ("BP_VERSION")) /* Custom fields are not compatible when running together with BuddyPress. */
163
  {
164
+ foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
165
  {
166
  if ($field = trim ($field, "* \t\n\r\0\x0B")) /* Don't process empty fields. */
167
  {
includes/menu-pages/buttons.inc.php CHANGED
@@ -30,8 +30,6 @@ echo '<td class="ws-menu-page-table-l">' . "\n";
30
  /**/
31
  if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])
32
  {
33
- echo '<form method="post" name="ws_plugin__s2member_buttons_form" id="ws-plugin--s2member-buttons-form">' . "\n";
34
- /**/
35
  echo '<div class="ws-menu-page-group" title="PayPal® Buttons For Level #1 Access">' . "\n";
36
  /**/
37
  echo '<div class="ws-menu-page-section ws-plugin--s2member-button-code-1-section">' . "\n";
@@ -51,24 +49,27 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
51
  echo '</th>' . "\n";
52
  /**/
53
  echo '<td>' . "\n";
 
54
  echo '<p id="ws-plugin--s2member-level1-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level1-trial-period" value="0" size="2" /> <select id="ws-plugin--s2member-level1-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
55
  echo '<p><span id="ws-plugin--s2member-level1-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level1-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level1-term"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
56
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level1-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level1-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level1\');" class="button-primary" /></p>' . "\n";
57
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level1-ccaps" size="40" maxlength="125" /></p>' . "\n";
 
58
  echo '</td>' . "\n";
59
  /**/
60
  echo '</tr>' . "\n";
61
  echo '<tr>' . "\n";
62
  /**/
63
  echo '<td colspan="2">' . "\n";
 
64
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
65
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
66
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
67
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "1", $ws_plugin__s2member_temp_s);
68
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"], $ws_plugin__s2member_temp_s);
69
- echo '<input id="ws-plugin--s2member-level1-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" /><br /><br />' . "\n";
70
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
71
- echo '<textarea id="ws-plugin--s2member-level1-button" rows="8" wrap="off" onclick="this.select ();">';
72
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
73
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
74
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
@@ -81,6 +82,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
81
  echo format_to_edit ($ws_plugin__s2member_temp_s);
82
  echo '</textarea><br />' . "\n";
83
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
 
84
  echo '</td>' . "\n";
85
  /**/
86
  echo '</tr>' . "\n";
@@ -109,24 +111,27 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
109
  echo '</th>' . "\n";
110
  /**/
111
  echo '<td>' . "\n";
 
112
  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="2" /> <select id="ws-plugin--s2member-level2-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
113
  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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
114
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level2-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level2-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level2\');" class="button-primary" /></p>' . "\n";
115
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level2-ccaps" size="40" maxlength="125" /></p>' . "\n";
 
116
  echo '</td>' . "\n";
117
  /**/
118
  echo '</tr>' . "\n";
119
  echo '<tr>' . "\n";
120
  /**/
121
  echo '<td colspan="2">' . "\n";
 
122
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
123
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
124
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
125
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "2", $ws_plugin__s2member_temp_s);
126
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"], $ws_plugin__s2member_temp_s);
127
- echo '<input id="ws-plugin--s2member-level2-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" /><br /><br />' . "\n";
128
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
129
- echo '<textarea id="ws-plugin--s2member-level2-button" rows="8" wrap="off" onclick="this.select ();">';
130
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
131
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
132
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
@@ -139,6 +144,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
139
  echo format_to_edit ($ws_plugin__s2member_temp_s);
140
  echo '</textarea><br />' . "\n";
141
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
 
142
  echo '</td>' . "\n";
143
  /**/
144
  echo '</tr>' . "\n";
@@ -167,24 +173,27 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
167
  echo '</th>' . "\n";
168
  /**/
169
  echo '<td>' . "\n";
 
170
  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="2" /> <select id="ws-plugin--s2member-level3-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
171
  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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
172
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level3-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level3-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level3\');" class="button-primary" /></p>' . "\n";
173
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level3-ccaps" size="40" maxlength="125" /></p>' . "\n";
 
174
  echo '</td>' . "\n";
175
  /**/
176
  echo '</tr>' . "\n";
177
  echo '<tr>' . "\n";
178
  /**/
179
  echo '<td colspan="2">' . "\n";
 
180
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
181
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
182
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
183
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "3", $ws_plugin__s2member_temp_s);
184
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"], $ws_plugin__s2member_temp_s);
185
- echo '<input id="ws-plugin--s2member-level3-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" /><br /><br />' . "\n";
186
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
187
- echo '<textarea id="ws-plugin--s2member-level3-button" rows="8" wrap="off" onclick="this.select ();">';
188
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
189
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
190
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
@@ -197,6 +206,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
197
  echo format_to_edit ($ws_plugin__s2member_temp_s);
198
  echo '</textarea><br />' . "\n";
199
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
 
200
  echo '</td>' . "\n";
201
  /**/
202
  echo '</tr>' . "\n";
@@ -225,24 +235,27 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
225
  echo '</th>' . "\n";
226
  /**/
227
  echo '<td>' . "\n";
 
228
  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="2" /> <select id="ws-plugin--s2member-level4-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
229
  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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
230
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level4-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level4-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level4\');" class="button-primary" /></p>' . "\n";
231
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level4-ccaps" size="40" maxlength="125" /></p>' . "\n";
 
232
  echo '</td>' . "\n";
233
  /**/
234
  echo '</tr>' . "\n";
235
  echo '<tr>' . "\n";
236
  /**/
237
  echo '<td colspan="2">' . "\n";
 
238
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
239
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
240
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
241
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "4", $ws_plugin__s2member_temp_s);
242
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"], $ws_plugin__s2member_temp_s);
243
- echo '<input id="ws-plugin--s2member-level4-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" /><br /><br />' . "\n";
244
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
245
- echo '<textarea id="ws-plugin--s2member-level4-button" rows="8" wrap="off" onclick="this.select ();">';
246
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
247
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
248
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
@@ -255,6 +268,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
255
  echo format_to_edit ($ws_plugin__s2member_temp_s);
256
  echo '</textarea><br />' . "\n";
257
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
 
258
  echo '</td>' . "\n";
259
  /**/
260
  echo '</tr>' . "\n";
@@ -286,26 +300,29 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
286
  echo '</th>' . "\n";
287
  /**/
288
  echo '<td>' . "\n";
 
289
  echo '<p>Modification: <select id="ws-plugin--s2member-modification-level"><optgroup label="Level #1"><option value="upgrade:1">&uarr; Upgrade To Level #1</option><option value="downgrade:1">&darr; Downgrade To Level #1</option></optgroup><optgroup label="Level #2"><option value="upgrade:2" selected="selected">&uarr; Upgrade To Level #2</option><option value="downgrade:2">&darr; Downgrade To Level #2</option></optgroup><optgroup label="Level #3"><option value="upgrade:3">&uarr; Upgrade To Level #3</option><option value="downgrade:3">&darr; Downgrade To Level #3</option></optgroup><optgroup label="Level #4"><option value="upgrade:4">&uarr; Upgrade To Level #4</option></optgroup></select></p>' . "\n";
290
  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="2" /> <select id="ws-plugin--s2member-modification-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
291
- 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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
292
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
293
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-modification-ccaps" size="40" maxlength="125" /></p>' . "\n";
 
294
  echo '</td>' . "\n";
295
  /**/
296
  echo '</tr>' . "\n";
297
  echo '<tr>' . "\n";
298
  /**/
299
  echo '<td colspan="2">' . "\n";
 
300
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
301
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
302
  $ws_plugin__s2member_temp_s = preg_replace ("/\/]$/", 'mb="1" /]', $ws_plugin__s2member_temp_s);
303
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
304
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "2", $ws_plugin__s2member_temp_s);
305
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"], $ws_plugin__s2member_temp_s);
306
- echo '<input id="ws-plugin--s2member-modification-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" /><br /><br />' . "\n";
307
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
308
- echo '<textarea id="ws-plugin--s2member-modification-button" rows="8" wrap="off" onclick="this.select ();">';
309
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
310
  $ws_plugin__s2member_temp_s = preg_replace ('/name\="modify" value\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__s2member_temp_s);
311
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
@@ -319,6 +336,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
319
  echo format_to_edit ($ws_plugin__s2member_temp_s);
320
  echo '</textarea><br />' . "\n";
321
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
 
322
  echo '</td>' . "\n";
323
  /**/
324
  echo '</tr>' . "\n";
@@ -352,24 +370,28 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
352
  echo '</th>' . "\n";
353
  /**/
354
  echo '<td>' . "\n";
 
355
  echo '<p>No configuration necessary.</p>' . "\n";
 
356
  echo '</td>' . "\n";
357
  /**/
358
  echo '</tr>' . "\n";
359
  echo '<tr>' . "\n";
360
  /**/
361
  echo '<td colspan="2">' . "\n";
 
362
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
363
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/c-shortcode.html"));
364
- echo '<input id="ws-plugin--s2member-cancellation-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" /><br /><br />' . "\n";
365
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
366
- echo '<textarea id="ws-plugin--s2member-cancellation-button" rows="8" wrap="off" onclick="this.select ();">';
367
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/c-button.html"));
368
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
369
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
370
  echo format_to_edit ($ws_plugin__s2member_temp_s);
371
  echo '</textarea><br />' . "\n";
372
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
 
373
  echo '</td>' . "\n";
374
  /**/
375
  echo '</tr>' . "\n";
@@ -400,6 +422,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
400
  echo '</th>' . "\n";
401
  /**/
402
  echo '<td>' . "\n";
 
403
  echo '<p><select id="ws-plugin--s2member-sp-page">' . "\n";
404
  echo '<option value="">&mdash; Select A Protected Single-Page &mdash;</option>' . "\n";
405
  /**/
@@ -410,28 +433,30 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
410
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])
411
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
412
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
413
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
414
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
415
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
416
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
417
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
418
  /**/
419
  echo '</select></p>' . "\n";
420
  echo '<p>Description: <input type="text" id="ws-plugin--s2member-sp-desc" value="" size="68" /></p>' . "\n";
421
  echo '<p>I want to charge: $<input type="text" id="ws-plugin--s2member-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-sp-hours"><optgroup label="Expires In Hours"><option value="2">Buy Now ( Single-Page Link, valid for 2 hours )</option><option value="4">Buy Now ( Single-Page Link, valid for 4 hours )</option><option value="6">Buy Now ( Single-Page Link, valid for 6 hours )</option><option value="8">Buy Now ( Single-Page Link, valid for 8 hours )</option><option value="10">Buy Now ( Single-Page Link, valid for 10 hours )</option><option value="12">Buy Now ( Single-Page Link, valid for 12 hours )</option></optgroup><optgroup label="Expires In Days"><option value="24">Buy Now ( Single-Page Link, valid for 1 day )</option><option value="48">Buy Now ( Single-Page Link, valid for 2 days )</option><option value="72" selected="selected">Buy Now ( Single-Page Link, valid for 3 days )</option><option value="96">Buy Now ( Single-Page Link, valid for 4 days )</option><option value="120">Buy Now ( Single-Page Link, valid for 5 days )</option><option value="144">Buy Now ( Single-Page Link, valid for 6 days )</option></optgroup><optgroup label="Expires In Weeks"><option value="168">Buy Now ( Single-Page Link, valid for 1 week )</option><option value="336">Buy Now ( Single-Page Link, valid for 2 weeks )</option><option value="504">Buy Now ( Single-Page Link, valid for 3 weeks )</option></optgroup><optgroup label="Expires In Months"><option value="720">Buy Now ( Single-Page Link, valid for 1 month )</option><option value="1440">Buy Now ( Single-Page Link, valid for 2 months )</option><option value="2190">Buy Now ( Single-Page Link, valid for 3 months )</option><option value="4380">Buy Now ( Single-Page Link, valid for 6 months )</option></optgroup><optgroup label="Expires In Years"><option value="8760">Buy Now ( Single-Page Link, valid for 1 year )</option><option value="17520">Buy Now ( Single-Page Link, valid for 2 years )</option><option value="26280">Buy Now ( Single-Page Link, valid for 3 years )</option><option value="35040">Buy Now ( Single-Page Link, valid for 4 years )</option><option value="43800">Buy Now ( Single-Page Link, valid for 5 years )</option></optgroup></select></p>' . "\n";
422
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-sp-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalSpButtonGenerate();" class="button-primary" /></p>' . "\n";
 
423
  echo '</td>' . "\n";
424
  /**/
425
  echo '</tr>' . "\n";
426
  echo '<tr>' . "\n";
427
  /**/
428
  echo '<td colspan="2">' . "\n";
 
429
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
430
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/sp-shortcode.html"));
431
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
432
- echo '<input id="ws-plugin--s2member-sp-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" /><br /><br />' . "\n";
433
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
434
- echo '<textarea id="ws-plugin--s2member-sp-button" rows="8" wrap="off" onclick="this.select ();">';
435
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/sp-button.html"));
436
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
437
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
@@ -442,6 +467,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
442
  echo format_to_edit ($ws_plugin__s2member_temp_s);
443
  echo '</textarea><br />' . "\n";
444
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
 
445
  echo '</td>' . "\n";
446
  /**/
447
  echo '</tr>' . "\n";
@@ -458,6 +484,7 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
458
  echo '<tr>' . "\n";
459
  /**/
460
  echo '<td>' . "\n";
 
461
  echo '<p><select id="ws-plugin--s2member-sp-link-page">' . "\n";
462
  echo '<option value="">&mdash; Select A Protected Single-Page &mdash;</option>' . "\n";
463
  /**/
@@ -465,15 +492,16 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
465
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])
466
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
467
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
468
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
469
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
470
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
471
- if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/,/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
472
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
473
  /**/
474
  echo '</select> <select id="ws-plugin--s2member-sp-link-hours"><optgroup label="Hours"><option value="2">valid for 2 hours</option><option value="4">valid for 4 hours</option><option value="6">valid for 6 hours</option><option value="8">valid for 8 hours</option><option value="10">valid for 10 hours</option><option value="12">valid for 12 hours</option></optgroup><optgroup label="Days"><option value="24">valid for 1 day</option><option value="48">valid for 2 days</option><option value="72" selected="selected">valid for 3 days</option><option value="96">valid for 4 days</option><option value="120">valid for 5 days</option><option value="144">valid for 6 days</option></optgroup><optgroup label="Weeks"><option value="168">valid for 1 week</option><option value="336">valid for 2 weeks</option><option value="504">valid for 3 weeks</option></optgroup><optgroup label="Months"><option value="720">valid for 1 month</option><option value="1440">valid for 2 months</option><option value="2190">valid for 3 months</option><option value="4380">valid for 6 months</option></optgroup><optgroup label="Years"><option value="8760">valid for 1 year</option><option value="17520">valid for 2 years</option><option value="26280">valid for 3 years</option><option value="35040">valid for 4 years</option><option value="43800">valid for 5 years</option></optgroup></select> <input type="button" value="Generate Link" onclick="ws_plugin__s2member_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--s2member-sp-link-loading" src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
475
  /**/
476
  echo '<p id="ws-plugin--s2member-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n";
 
477
  echo '</td>' . "\n";
478
  /**/
479
  echo '</tr>' . "\n";
@@ -482,8 +510,6 @@ if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2
482
  echo '</div>' . "\n";
483
  /**/
484
  echo '</div>' . "\n";
485
- /**/
486
- echo '</form>' . "\n";
487
  }
488
  else /* They need to first configure the options. */
489
  echo '<p>Please configure the s2Member PayPal® Options first. Once your PayPal® Options have been properly configured, return to this page &amp; generate your PayPal® Button(s).</p>' . "\n";
30
  /**/
31
  if (get_option ("ws_plugin__s2member_configured") && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])
32
  {
 
 
33
  echo '<div class="ws-menu-page-group" title="PayPal® Buttons For Level #1 Access">' . "\n";
34
  /**/
35
  echo '<div class="ws-menu-page-section ws-plugin--s2member-button-code-1-section">' . "\n";
49
  echo '</th>' . "\n";
50
  /**/
51
  echo '<td>' . "\n";
52
+ echo '<form onsubmit="return false;">' . "\n";
53
  echo '<p id="ws-plugin--s2member-level1-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-level1-trial-period" value="0" size="2" /> <select id="ws-plugin--s2member-level1-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
54
  echo '<p><span id="ws-plugin--s2member-level1-trial-then">Then, </span>I want to charge: $<input type="text" id="ws-plugin--s2member-level1-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-level1-term"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
55
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level1-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level1-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level1\');" class="button-primary" /></p>' . "\n";
56
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level1-ccaps" size="40" maxlength="125" /></p>' . "\n";
57
+ echo '</form>' . "\n";
58
  echo '</td>' . "\n";
59
  /**/
60
  echo '</tr>' . "\n";
61
  echo '<tr>' . "\n";
62
  /**/
63
  echo '<td colspan="2">' . "\n";
64
+ echo '<form onsubmit="return false;">' . "\n";
65
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
66
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
67
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
68
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "1", $ws_plugin__s2member_temp_s);
69
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_label"], $ws_plugin__s2member_temp_s);
70
+ echo '<input id="ws-plugin--s2member-level1-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
71
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
72
+ echo '<textarea id="ws-plugin--s2member-level1-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
73
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
74
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
75
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
82
  echo format_to_edit ($ws_plugin__s2member_temp_s);
83
  echo '</textarea><br />' . "\n";
84
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
85
+ echo '</form>' . "\n";
86
  echo '</td>' . "\n";
87
  /**/
88
  echo '</tr>' . "\n";
111
  echo '</th>' . "\n";
112
  /**/
113
  echo '<td>' . "\n";
114
+ echo '<form onsubmit="return false;">' . "\n";
115
  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="2" /> <select id="ws-plugin--s2member-level2-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
116
  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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
117
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level2-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level2-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level2\');" class="button-primary" /></p>' . "\n";
118
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level2-ccaps" size="40" maxlength="125" /></p>' . "\n";
119
+ echo '</form>' . "\n";
120
  echo '</td>' . "\n";
121
  /**/
122
  echo '</tr>' . "\n";
123
  echo '<tr>' . "\n";
124
  /**/
125
  echo '<td colspan="2">' . "\n";
126
+ echo '<form onsubmit="return false;">' . "\n";
127
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
128
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
129
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
130
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "2", $ws_plugin__s2member_temp_s);
131
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"], $ws_plugin__s2member_temp_s);
132
+ 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%;" /><br /><br />' . "\n";
133
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
134
+ echo '<textarea id="ws-plugin--s2member-level2-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
135
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
136
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
137
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
144
  echo format_to_edit ($ws_plugin__s2member_temp_s);
145
  echo '</textarea><br />' . "\n";
146
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
147
+ echo '</form>' . "\n";
148
  echo '</td>' . "\n";
149
  /**/
150
  echo '</tr>' . "\n";
173
  echo '</th>' . "\n";
174
  /**/
175
  echo '<td>' . "\n";
176
+ echo '<form onsubmit="return false;">' . "\n";
177
  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="2" /> <select id="ws-plugin--s2member-level3-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
178
  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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
179
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level3-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level3-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level3\');" class="button-primary" /></p>' . "\n";
180
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level3-ccaps" size="40" maxlength="125" /></p>' . "\n";
181
+ echo '</form>' . "\n";
182
  echo '</td>' . "\n";
183
  /**/
184
  echo '</tr>' . "\n";
185
  echo '<tr>' . "\n";
186
  /**/
187
  echo '<td colspan="2">' . "\n";
188
+ echo '<form onsubmit="return false;">' . "\n";
189
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
190
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
191
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
192
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "3", $ws_plugin__s2member_temp_s);
193
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_label"], $ws_plugin__s2member_temp_s);
194
+ 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%;" /><br /><br />' . "\n";
195
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
196
+ echo '<textarea id="ws-plugin--s2member-level3-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
197
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
198
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
199
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
206
  echo format_to_edit ($ws_plugin__s2member_temp_s);
207
  echo '</textarea><br />' . "\n";
208
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
209
+ echo '</form>' . "\n";
210
  echo '</td>' . "\n";
211
  /**/
212
  echo '</tr>' . "\n";
235
  echo '</th>' . "\n";
236
  /**/
237
  echo '<td>' . "\n";
238
+ echo '<form onsubmit="return false;">' . "\n";
239
  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="2" /> <select id="ws-plugin--s2member-level4-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
240
  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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select></p>' . "\n";
241
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-level4-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-level4-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'level4\');" class="button-primary" /></p>' . "\n";
242
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-level4-ccaps" size="40" maxlength="125" /></p>' . "\n";
243
+ echo '</form>' . "\n";
244
  echo '</td>' . "\n";
245
  /**/
246
  echo '</tr>' . "\n";
247
  echo '<tr>' . "\n";
248
  /**/
249
  echo '<td colspan="2">' . "\n";
250
+ echo '<form onsubmit="return false;">' . "\n";
251
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
252
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
253
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
254
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "4", $ws_plugin__s2member_temp_s);
255
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_label"], $ws_plugin__s2member_temp_s);
256
+ 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%;" /><br /><br />' . "\n";
257
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
258
+ echo '<textarea id="ws-plugin--s2member-level4-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
259
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
260
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
261
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
268
  echo format_to_edit ($ws_plugin__s2member_temp_s);
269
  echo '</textarea><br />' . "\n";
270
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
271
+ echo '</form>' . "\n";
272
  echo '</td>' . "\n";
273
  /**/
274
  echo '</tr>' . "\n";
300
  echo '</th>' . "\n";
301
  /**/
302
  echo '<td>' . "\n";
303
+ echo '<form onsubmit="return false;">' . "\n";
304
  echo '<p>Modification: <select id="ws-plugin--s2member-modification-level"><optgroup label="Level #1"><option value="upgrade:1">&uarr; Upgrade To Level #1</option><option value="downgrade:1">&darr; Downgrade To Level #1</option></optgroup><optgroup label="Level #2"><option value="upgrade:2" selected="selected">&uarr; Upgrade To Level #2</option><option value="downgrade:2">&darr; Downgrade To Level #2</option></optgroup><optgroup label="Level #3"><option value="upgrade:3">&uarr; Upgrade To Level #3</option><option value="downgrade:3">&darr; Downgrade To Level #3</option></optgroup><optgroup label="Level #4"><option value="upgrade:4">&uarr; Upgrade To Level #4</option></optgroup></select></p>' . "\n";
305
  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="2" /> <select id="ws-plugin--s2member-modification-trial-term"><option value="D" selected="selected">Days</option><option value="W">Weeks</option><option value="M">Months</option><option value="Y">Years</option></select> free.</p>' . "\n";
306
+ 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"><optgroup label="Recurring Subscriptions"><option value="1-D-1">Daily ( recurring charge, for ongoing access )</option><option value="1-W-1">Weekly ( recurring charge, for ongoing access )</option><option value="1-M-1" selected="selected">Monthly ( recurring charge, for ongoing access )</option><option value="3-M-1">Quarterly ( recurring charge, for ongoing access )</option><option value="1-Y-1">Yearly ( recurring charge, for ongoing access )</option></optgroup><optgroup label="Days / Non-Recurring"><option value="1-D-0">One Time ( for 1 day access, non-recurring )</option><option value="2-D-0">One Time ( for 2 day access, non-recurring )</option><option value="3-D-0">One Time ( for 3 day access, non-recurring )</option><option value="4-D-0">One Time ( for 4 day access, non-recurring )</option><option value="5-D-0">One Time ( for 5 day access, non-recurring )</option><option value="6-D-0">One Time ( for 6 day access, non-recurring )</option></optgroup><optgroup label="Weeks / Non-Recurring"><option value="1-W-0">One Time ( for 1 week access, non-recurring )</option><option value="2-W-0">One Time ( for 2 week access, non-recurring )</option><option value="3-W-0">One Time ( for 3 week access, non-recurring )</option></optgroup><optgroup label="Months / Non-Recurring"><option value="1-M-0">One Time ( for 1 month access, non-recurring )</option><option value="2-M-0">One Time ( for 2 month access, non-recurring )</option><option value="3-M-0">One Time ( for 3 month access, non-recurring )</option><option value="4-M-0">One Time ( for 4 month access, non-recurring )</option><option value="5-M-0">One Time ( for 5 month access, non-recurring )</option><option value="6-M-0">One Time ( for 6 month access, non-recurring )</option></optgroup><optgroup label="Years / Non-Recurring"><option value="1-Y-0">One Time ( for 1 year access, non-recurring )</option><option value="2-Y-0">One Time ( for 2 year access, non-recurring )</option><option value="3-Y-0">One Time ( for 3 year access, non-recurring )</option><option value="4-Y-0">One Time ( for 4 year access, non-recurring )</option><option value="5-Y-0">One Time ( for 5 year access, non-recurring )</option></optgroup><optgroup label="Lifetime / Buy Now / Non-Recurring / No Trial"><option value="1-L-0">Buy Now ( for lifetime access, no-trial, non-recurring )</option></optgroup></select><br /><small>** Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details on the 20% rule 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>.</small></p>' . "\n";
307
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
308
  echo '<p>Custom Capabilities ( comma delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced. For full details, see:\\ns2Member -> API Scripting -> Custom Capabilities.\'); return false;">[?]</a> <input type="text" id="ws-plugin--s2member-modification-ccaps" size="40" maxlength="125" /></p>' . "\n";
309
+ echo '</form>' . "\n";
310
  echo '</td>' . "\n";
311
  /**/
312
  echo '</tr>' . "\n";
313
  echo '<tr>' . "\n";
314
  /**/
315
  echo '<td colspan="2">' . "\n";
316
+ echo '<form onsubmit="return false;">' . "\n";
317
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
318
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/shortcode.html"));
319
  $ws_plugin__s2member_temp_s = preg_replace ("/\/]$/", 'mb="1" /]', $ws_plugin__s2member_temp_s);
320
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
321
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level%%/", "2", $ws_plugin__s2member_temp_s);
322
  $ws_plugin__s2member_temp_s = preg_replace ("/%%level_label%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_label"], $ws_plugin__s2member_temp_s);
323
+ 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%;" /><br /><br />' . "\n";
324
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
325
+ echo '<textarea id="ws-plugin--s2member-modification-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
326
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/button.html"));
327
  $ws_plugin__s2member_temp_s = preg_replace ('/name\="modify" value\="(.*?)"/', 'name="modify" value="1"', $ws_plugin__s2member_temp_s);
328
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
336
  echo format_to_edit ($ws_plugin__s2member_temp_s);
337
  echo '</textarea><br />' . "\n";
338
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
339
+ echo '</form>' . "\n";
340
  echo '</td>' . "\n";
341
  /**/
342
  echo '</tr>' . "\n";
370
  echo '</th>' . "\n";
371
  /**/
372
  echo '<td>' . "\n";
373
+ echo '<form onsubmit="return false;">' . "\n";
374
  echo '<p>No configuration necessary.</p>' . "\n";
375
+ echo '</form>' . "\n";
376
  echo '</td>' . "\n";
377
  /**/
378
  echo '</tr>' . "\n";
379
  echo '<tr>' . "\n";
380
  /**/
381
  echo '<td colspan="2">' . "\n";
382
+ echo '<form onsubmit="return false;">' . "\n";
383
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
384
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/c-shortcode.html"));
385
+ echo '<input id="ws-plugin--s2member-cancellation-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
386
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
387
+ echo '<textarea id="ws-plugin--s2member-cancellation-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
388
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/c-button.html"));
389
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
390
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
391
  echo format_to_edit ($ws_plugin__s2member_temp_s);
392
  echo '</textarea><br />' . "\n";
393
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
394
+ echo '</form>' . "\n";
395
  echo '</td>' . "\n";
396
  /**/
397
  echo '</tr>' . "\n";
422
  echo '</th>' . "\n";
423
  /**/
424
  echo '<td>' . "\n";
425
+ echo '<form onsubmit="return false;">' . "\n";
426
  echo '<p><select id="ws-plugin--s2member-sp-page">' . "\n";
427
  echo '<option value="">&mdash; Select A Protected Single-Page &mdash;</option>' . "\n";
428
  /**/
433
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])
434
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
435
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
436
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
437
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
438
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
439
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
440
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
441
  /**/
442
  echo '</select></p>' . "\n";
443
  echo '<p>Description: <input type="text" id="ws-plugin--s2member-sp-desc" value="" size="68" /></p>' . "\n";
444
  echo '<p>I want to charge: $<input type="text" id="ws-plugin--s2member-sp-amount" value="0.01" size="4" /> / <select id="ws-plugin--s2member-sp-hours"><optgroup label="Expires In Hours"><option value="2">Buy Now ( Single-Page Link, valid for 2 hours )</option><option value="4">Buy Now ( Single-Page Link, valid for 4 hours )</option><option value="6">Buy Now ( Single-Page Link, valid for 6 hours )</option><option value="8">Buy Now ( Single-Page Link, valid for 8 hours )</option><option value="10">Buy Now ( Single-Page Link, valid for 10 hours )</option><option value="12">Buy Now ( Single-Page Link, valid for 12 hours )</option></optgroup><optgroup label="Expires In Days"><option value="24">Buy Now ( Single-Page Link, valid for 1 day )</option><option value="48">Buy Now ( Single-Page Link, valid for 2 days )</option><option value="72" selected="selected">Buy Now ( Single-Page Link, valid for 3 days )</option><option value="96">Buy Now ( Single-Page Link, valid for 4 days )</option><option value="120">Buy Now ( Single-Page Link, valid for 5 days )</option><option value="144">Buy Now ( Single-Page Link, valid for 6 days )</option></optgroup><optgroup label="Expires In Weeks"><option value="168">Buy Now ( Single-Page Link, valid for 1 week )</option><option value="336">Buy Now ( Single-Page Link, valid for 2 weeks )</option><option value="504">Buy Now ( Single-Page Link, valid for 3 weeks )</option></optgroup><optgroup label="Expires In Months"><option value="720">Buy Now ( Single-Page Link, valid for 1 month )</option><option value="1440">Buy Now ( Single-Page Link, valid for 2 months )</option><option value="2190">Buy Now ( Single-Page Link, valid for 3 months )</option><option value="4380">Buy Now ( Single-Page Link, valid for 6 months )</option></optgroup><optgroup label="Expires In Years"><option value="8760">Buy Now ( Single-Page Link, valid for 1 year )</option><option value="17520">Buy Now ( Single-Page Link, valid for 2 years )</option><option value="26280">Buy Now ( Single-Page Link, valid for 3 years )</option><option value="35040">Buy Now ( Single-Page Link, valid for 4 years )</option><option value="43800">Buy Now ( Single-Page Link, valid for 5 years )</option></optgroup></select></p>' . "\n";
445
  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.\'); return false;">[?]</a>: <input type="text" id="ws-plugin--s2member-sp-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-sp-currency"><optgroup label="Currency"><option value="USD" title="U.S. Dollar">USD</option><option value="AUD" title="Australian Dollar">AUD</option><option value="BRL" title="Brazilian Real">BRL</option><option value="CAD" title="Canadian Dollar">CAD</option><option value="CZK" title="Czech Koruna">CZK</option><option value="DKK" title="Danish Krone">DKK</option><option value="EUR" title="Euro">EUR</option><option value="HKD" title="Hong Kong Dollar">HKD</option><option value="HUF" title="Hungarian Forint">HUF</option><option value="ILS" title="Israeli New Sheqel">ILS</option><option value="JPY" title="Japanese Yen">JPY</option><option value="MYR" title="Malaysian Ringgit">MYR</option><option value="MXN" title="Mexican Peso">MXN</option><option value="NOK" title="Norwegian Krone">NOK</option><option value="NZD" title="New Zealand Dollar">NZD</option><option value="PHP" title="Philippine Peso">PHP</option><option value="PLN" title="Polish Zloty">PLN</option><option value="GBP" title="Pound Sterling">GBP</option><option value="SGD" title="Singapore Dollar">SGD</option><option value="SEK" title="Swedish Krona">SEK</option><option value="CHF" title="Swiss Franc">CHF</option><option value="TWD" title="Taiwan New Dollar">TWD</option><option value="THB" title="Thai Baht">THB</option><option value="USD" title="U.S. Dollar">USD</option></optgroup></select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalSpButtonGenerate();" class="button-primary" /></p>' . "\n";
446
+ echo '</form>' . "\n";
447
  echo '</td>' . "\n";
448
  /**/
449
  echo '</tr>' . "\n";
450
  echo '<tr>' . "\n";
451
  /**/
452
  echo '<td colspan="2">' . "\n";
453
+ echo '<form onsubmit="return false;">' . "\n";
454
  echo '<strong>WordPress® Shortcode:</strong> ( recommended for both the WordPress® Visual &amp; HTML Editors )<br />' . "\n";
455
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/shortcodes/sp-shortcode.html"));
456
  $ws_plugin__s2member_temp_s = preg_replace ("/%%domain%%/", strtolower ($_SERVER["HTTP_HOST"]), $ws_plugin__s2member_temp_s);
457
+ echo '<input id="ws-plugin--s2member-sp-shortcode" type="text" value="' . format_to_edit ($ws_plugin__s2member_temp_s) . '" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;" /><br /><br />' . "\n";
458
  echo '<strong>Resulting PayPal® Button Code:</strong> ( ultimately, your Shortcode will produce this snippet )<br />' . "\n";
459
+ echo '<textarea id="ws-plugin--s2member-sp-button" rows="8" wrap="off" onclick="this.select ();" style="font-family:Consolas, monospace; width:99%;">';
460
  $ws_plugin__s2member_temp_s = trim (file_get_contents (dirname (dirname (__FILE__)) . "/templates/buttons/sp-button.html"));
461
  $ws_plugin__s2member_temp_s = preg_replace ("/%%endpoint%%/", (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com"), $ws_plugin__s2member_temp_s);
462
  $ws_plugin__s2member_temp_s = preg_replace ("/%%paypal_business%%/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"], $ws_plugin__s2member_temp_s);
467
  echo format_to_edit ($ws_plugin__s2member_temp_s);
468
  echo '</textarea><br />' . "\n";
469
  echo '&uarr; Use this more advanced Code if you\'re building a theme or plugin that integrates with s2Member.' . "\n";
470
+ echo '</form>' . "\n";
471
  echo '</td>' . "\n";
472
  /**/
473
  echo '</tr>' . "\n";
484
  echo '<tr>' . "\n";
485
  /**/
486
  echo '<td>' . "\n";
487
+ echo '<form onsubmit="return false;">' . "\n";
488
  echo '<p><select id="ws-plugin--s2member-sp-link-page">' . "\n";
489
  echo '<option value="">&mdash; Select A Protected Single-Page &mdash;</option>' . "\n";
490
  /**/
492
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])
493
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
494
  if ($ws_plugin__s2member_temp_o->ID != $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])
495
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level1_pages"])))
496
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level2_pages"])))
497
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level3_pages"])))
498
+ if (!in_array ($ws_plugin__s2member_temp_o->ID, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level4_pages"])))
499
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
500
  /**/
501
  echo '</select> <select id="ws-plugin--s2member-sp-link-hours"><optgroup label="Hours"><option value="2">valid for 2 hours</option><option value="4">valid for 4 hours</option><option value="6">valid for 6 hours</option><option value="8">valid for 8 hours</option><option value="10">valid for 10 hours</option><option value="12">valid for 12 hours</option></optgroup><optgroup label="Days"><option value="24">valid for 1 day</option><option value="48">valid for 2 days</option><option value="72" selected="selected">valid for 3 days</option><option value="96">valid for 4 days</option><option value="120">valid for 5 days</option><option value="144">valid for 6 days</option></optgroup><optgroup label="Weeks"><option value="168">valid for 1 week</option><option value="336">valid for 2 weeks</option><option value="504">valid for 3 weeks</option></optgroup><optgroup label="Months"><option value="720">valid for 1 month</option><option value="1440">valid for 2 months</option><option value="2190">valid for 3 months</option><option value="4380">valid for 6 months</option></optgroup><optgroup label="Years"><option value="8760">valid for 1 year</option><option value="17520">valid for 2 years</option><option value="26280">valid for 3 years</option><option value="35040">valid for 4 years</option><option value="43800">valid for 5 years</option></optgroup></select> <input type="button" value="Generate Link" onclick="ws_plugin__s2member_paypalSpLinkGenerate();" class="button-primary" /> <img id="ws-plugin--s2member-sp-link-loading" src="' . $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . '/images/ajax-loader.gif" alt="" style="display:none;" /></p>' . "\n";
502
  /**/
503
  echo '<p id="ws-plugin--s2member-sp-link" style="font-family:Consolas, monospace; display:none;"></p>' . "\n";
504
+ echo '</form>' . "\n";
505
  echo '</td>' . "\n";
506
  /**/
507
  echo '</tr>' . "\n";
510
  echo '</div>' . "\n";
511
  /**/
512
  echo '</div>' . "\n";
 
 
513
  }
514
  else /* They need to first configure the options. */
515
  echo '<p>Please configure the s2Member PayPal® Options first. Once your PayPal® Options have been properly configured, return to this page &amp; generate your PayPal® Button(s).</p>' . "\n";
includes/menu-pages/code-samples/current-user-can-constants-2.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 4){ ?>
2
- Some content for Members with an s2Member Level >= 4.
3
- <?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 3){ ?>
4
- Some content for Members with an s2Member Level >= 3.
5
  <?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 2){ ?>
6
- Some content for Members with an s2Member Level >= 2.
7
  <?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 1){ ?>
8
- Some content for Members with an s2Member Level >= 1.
9
  <?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0){ ?>
10
- Some content for Free Subscribers.
11
  <?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>
12
- Some public content.
13
- <?php } ?>
1
  <?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 4){ ?>
2
+ Some content for Members with an s2Member Level >= 4.
3
+ <?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 3){ ?>
4
+ Some content for Members with an s2Member Level >= 3.
5
  <?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 2){ ?>
6
+ Some content for Members with an s2Member Level >= 2.
7
  <?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 1){ ?>
8
+ Some content for Members with an s2Member Level >= 1.
9
  <?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0){ ?>
10
+ Some content for Free Subscribers.
11
  <?php } else if(S2MEMBER_CURRENT_USER_ACCESS_LEVEL === -1){ ?>
12
+ Some public content.
13
+ <?php } ?>
includes/menu-pages/code-samples/file-download-inline-extensions.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php echo S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS; ?>
2
+ This may output something like: pdf,jpg,jpeg,jpe,png
3
+ ( s2Member will display these extensions inline )
includes/menu-pages/down-ops.inc.php CHANGED
@@ -163,6 +163,38 @@ echo '</div>' . "\n";
163
  /**/
164
  echo '</div>' . "\n";
165
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
167
  /**/
168
  echo '<p class="submit"><input type="submit" class="button-primary" value="Save Changes" /></p>' . "\n";
163
  /**/
164
  echo '</div>' . "\n";
165
  /**/
166
+ echo '<div class="ws-menu-page-group" title="Inline File Extensions">' . "\n";
167
+ /**/
168
+ echo '<div class="ws-menu-page-section ws-plugin--s2member-extensions-section">' . "\n";
169
+ echo '<h3>Inline File Extensions ( optional, for content-disposition )</h3>' . "\n";
170
+ echo '<p>There are two ways to serve files. Inline, or as an Attachment. By default, s2Member will serve all of your protected Files, as downloadable attachments. Meaning, visitors will be given a File Download Prompt. Otherwise known as <code>Content-Disposition: attachment</code>. In some cases though, you may wish to serve files Inline. For example, PDF files and images should usually be served Inline. When you serve a file Inline, it is displayed in your browser immediately, rather than your browser prompting you to download the file as an attachment.</p>' . "\n";
171
+ echo '<p>Using the field below, you can list all of the extensions that you want s2Member to serve Inline ( ex: <code>pdf,jpg,jpeg,jpe,gif,png</code> ). Please understand, some files just cannot be displayed inline. For instance, there is no way to display an <code>exe</code> file inline. So only specify extensions that can, and should be displayed inline by a web browser.</p>' . "\n";
172
+ /**/
173
+ echo '<table class="form-table">' . "\n";
174
+ echo '<tbody>' . "\n";
175
+ echo '<tr>' . "\n";
176
+ /**/
177
+ echo '<th>' . "\n";
178
+ echo '<label for="ws-plugin--s2member-file-download-inline-extensions">' . "\n";
179
+ echo 'Inline File Extensions ( comma delimited ):' . "\n";
180
+ echo '</label>' . "\n";
181
+ echo '</th>' . "\n";
182
+ /**/
183
+ echo '</tr>' . "\n";
184
+ echo '<tr>' . "\n";
185
+ /**/
186
+ echo '<td>' . "\n";
187
+ echo '<input type="text" name="ws_plugin__s2member_file_download_inline_extensions" id="ws-plugin--s2member-file-download-inline-extensions" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]) . '" /><br />' . "\n";
188
+ echo 'Inline extensions in comma delimited format. Example: <code>pdf,jpg,jpeg,jpe,gif,png</code>.' . "\n";
189
+ echo '</td>' . "\n";
190
+ /**/
191
+ echo '</tr>' . "\n";
192
+ echo '</tbody>' . "\n";
193
+ echo '</table>' . "\n";
194
+ echo '</div>' . "\n";
195
+ /**/
196
+ echo '</div>' . "\n";
197
+ /**/
198
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
199
  /**/
200
  echo '<p class="submit"><input type="submit" class="button-primary" value="Save Changes" /></p>' . "\n";
includes/menu-pages/options.inc.php CHANGED
@@ -397,7 +397,7 @@ foreach (($ws_plugin__s2member_temp_a = array_merge ((array)get_pages ())) as $w
397
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && $ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
398
  echo '</select><br />' . "\n";
399
  echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.<br /><br />' . "\n";
400
- echo '&darr; Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>' . "\n";
401
  echo '<input type="text" name="ws_plugin__s2member_login_redirection_override" id="ws-plugin--s2member-login-redirection-override" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
402
  echo '</td>' . "\n";
403
  /**/
@@ -879,7 +879,7 @@ echo '<div class="ws-menu-page-group" title="URI Access Restrictions">' . "\n";
879
  echo '<div class="ws-menu-page-section ws-plugin--s2member-uri-level-access-section">' . "\n";
880
  echo '<h3>URI Level Access Restrictions ( optional )</h3>' . "\n";
881
  echo '<p>Here you can specify URIs ( or word fragments found in URIs ) that are restricted to certain Membership Access Levels. Control over URIs is a little more complex. This section is intended for advanced webmasters only. That being said, here are the basics... A REQUEST_URI, is the portion of the URL that comes after the domain. This is a URL <code>http://www.example.com/path/to/file.php</code>, and this is the URI: <code>/path/to/file.php</code>.</p>' . "\n";
882
- echo '<p>In the fields below, you can provide a list ( one per line ) of URIs on your site that should be off-limits based on Membership Level. You can also use word fragments instead of a full URI. If a word fragment is found anywhere in the URI, it will be protected. Wildcards and other regex patterns are not supported here, and therefore you don\'t need to escape special characters or anything. Please note, these ARE caSe sensitive. You must be specific with respect to case sensitivity. The word fragment <code>some-path/</code> would NOT match a URI that contains <code>some-Path/</code>.</p>' . "\n";
883
  /**/
884
  echo '<table class="form-table">' . "\n";
885
  echo '<tbody>' . "\n";
397
  echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && $ws_plugin__s2member_temp_o->ID == $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) ? ' selected="selected"' : '') . '>' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
398
  echo '</select><br />' . "\n";
399
  echo 'Please choose a Page to be used as the first page Members will see after logging in. This Page can contain anything you like. We recommend the following title: <code>Welcome To Our Members Area</code>.<br /><br />' . "\n";
400
+ echo '&darr; Or, you may configure a Special Redirection URL, if you prefer. You\'ll need to type in the full URL, starting with: <code>http://</code>. <em>A couple of <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: ' . get_bloginfo ("url") . '/members/%%current_user_login%%/profile/\\n\\nAdditional Replacement Codes can be added through custom programming. Use: add_filter(\\\'s2member_fill_login_redirect_rc_vars\\\', \\\'my_filter\\\');\'); return false;">Replacement Codes</a> are also supported here.</em>' . "\n";
401
  echo '<input type="text" name="ws_plugin__s2member_login_redirection_override" id="ws-plugin--s2member-login-redirection-override" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"]) . '" /><br />' . "\n";
402
  echo '</td>' . "\n";
403
  /**/
879
  echo '<div class="ws-menu-page-section ws-plugin--s2member-uri-level-access-section">' . "\n";
880
  echo '<h3>URI Level Access Restrictions ( optional )</h3>' . "\n";
881
  echo '<p>Here you can specify URIs ( or word fragments found in URIs ) that are restricted to certain Membership Access Levels. Control over URIs is a little more complex. This section is intended for advanced webmasters only. That being said, here are the basics... A REQUEST_URI, is the portion of the URL that comes after the domain. This is a URL <code>http://www.example.com/path/to/file.php</code>, and this is the URI: <code>/path/to/file.php</code>.</p>' . "\n";
882
+ echo '<p>In the fields below, you can provide a list ( one per line ) of URIs on your site that should be off-limits based on Membership Level. You can also use word fragments instead of a full URI. If a word fragment is found anywhere in the URI, it will be protected. Wildcards and other regex patterns are not supported here, and therefore you don\'t need to escape special characters or anything. Please note, these ARE caSe sensitive. You must be specific with respect to case sensitivity. The word fragment <code>some-path/</code> would NOT match a URI that contains <code>some-Path/</code>. <em>A couple of <a href="#" onclick="alert(\'URI Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s login ( their Username, lowercase ).\\n%%current_user_ID%% = The current User\\\'s ID.\\n\\nFor example, if you\\\'re using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: /members/%%current_user_login%%/groups/\\n\\nAdditional Replacement Codes can be added through custom programming. Use: add_filter(\\\'s2member_fill_ruri_level_access_rc_vars\\\', \\\'my_filter\\\');\'); return false;">Replacement Codes</a> are also supported here.</em></p>' . "\n";
883
  /**/
884
  echo '<table class="form-table">' . "\n";
885
  echo '<tbody>' . "\n";
includes/menu-pages/scripting.inc.php CHANGED
@@ -339,6 +339,11 @@ echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-sa
339
  /**/
340
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
341
  /**/
 
 
 
 
 
342
  echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
343
  echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/reg-email-from-name.php"), true) . '</p>' . "\n";
344
  /**/
339
  /**/
340
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
341
  /**/
342
+ echo '<p><strong>S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS</strong><br />This is the (string) list of extensions to display inline.</p>' . "\n";
343
+ echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/file-download-inline-extensions.php"), true) . '</p>' . "\n";
344
+ /**/
345
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
346
+ /**/
347
  echo '<p><strong>S2MEMBER_REG_EMAIL_FROM_NAME</strong><br />This is the Name that outgoing email messages are sent by.</p>' . "\n";
348
  echo '<p>' . highlight_string (file_get_contents (dirname (__FILE__) . "/code-samples/reg-email-from-name.php"), true) . '</p>' . "\n";
349
  /**/
includes/profile.inc.php CHANGED
@@ -78,7 +78,7 @@ echo '</tr>' . "\n";
78
  /**/
79
  $fields = get_usermeta ($current_user->ID, "s2member_custom_fields");
80
  /**/
81
- foreach (preg_split ("/[\r\n\t,;]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
82
  {
83
  $req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
84
  $req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
78
  /**/
79
  $fields = get_usermeta ($current_user->ID, "s2member_custom_fields");
80
  /**/
81
+ foreach (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) as $field)
82
  {
83
  $req = preg_match ("/\*/", $field); /* Required fields should be wrapped inside asterisks. */
84
  $req = ($req) ? ' aria-required="true"' : ''; /* Has JavaScript validation applied. */
includes/syscon.inc.php CHANGED
@@ -76,10 +76,9 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
76
  "allow_subscribers_in" => "0", /* Allow subscribers to access the login_welcome_page? */
77
  "force_admin_lockouts" => "0", /* Redirects admin pages/profile to the login_welcome_page. */
78
  /**/
79
- "login_welcome_page" => "", /* Preceded by bloginfo("url"). Defaults to the home page. */
80
  "login_redirection_override" => "", /* Alternate redirection location; instead of the welcome page. */
81
- "membership_options_page" => "", /* Preceded by bloginfo("url"). Defaults to the home page. */
82
- "file_download_limit_exceeded_page" => "", /* Preceded by bloginfo("url"). Defaults to the home page. */
83
  /**/
84
  "login_reg_background_color" => "FFFFFF", /* Defaults to white, and the bg.png is also white. */
85
  "login_reg_background_image" => $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/bg.png",/**/
@@ -144,6 +143,9 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
144
  "level3_file_downloads_allowed_days" => "", /* This should be numeric or empty. */
145
  "level4_file_downloads_allowed_days" => "", /* This should be numeric or empty. */
146
  /**/
 
 
 
147
  "level1_ruris" => "", /* It is ok for these to just be empty strings. */
148
  "level2_ruris" => "", /* It is ok for these to just be empty strings. */
149
  "level3_ruris" => "", /* It is ok for these to just be empty strings. */
@@ -234,9 +236,6 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
234
  else if ($key === "membership_options_page" && (!is_string ($value) || !is_numeric ($value)))
235
  $value = $default_options[$key];
236
  /**/
237
- else if ($key === "file_download_limit_exceeded_page" && (!is_string ($value) || !is_numeric ($value)))
238
- $value = $default_options[$key];
239
- /**/
240
  else if ($key === "login_reg_background_color" && (!is_string ($value) || !strlen ($value)))
241
  $value = $default_options[$key];
242
  /**/
@@ -294,10 +293,10 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
294
  else if ($key === "mailchimp_api_key" && (!is_string ($value) || !strlen ($value)))
295
  $value = $default_options[$key];
296
  /**/
297
- else if (preg_match ("/level[0-4]_mailchimp_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/\s+/", "", $value))))
298
  $value = $default_options[$key];
299
  /**/
300
- else if (preg_match ("/level[0-4]_aweber_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/\s+/", "", $value))))
301
  $value = $default_options[$key];
302
  /**/
303
  else if ($key === "signup_notification_urls" && (!is_string ($value) || !strlen ($value)))
@@ -330,25 +329,31 @@ function ws_plugin__s2member_configure_options_and_their_defaults ($options = FA
330
  else if ($key === "level4_label" && (!is_string ($value) || !strlen ($value)))
331
  $value = $default_options[$key];
332
  /**/
333
- else if (preg_match ("/level[1-4]_file_downloads_allowed$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
 
 
 
 
 
 
334
  $value = $default_options[$key];
335
  /**/
336
- else if (preg_match ("/level[1-4]_file_downloads_allowed_days$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
337
  $value = $default_options[$key];
338
  /**/
339
- else if (preg_match ("/level[1-4]_ruris$/", $key) && (!is_string ($value) || !strlen ($value)))
340
  $value = $default_options[$key];
341
  /**/
342
- else if (preg_match ("/level[1-4]_catgs$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
343
  $value = $default_options[$key];
344
  /**/
345
- else if (preg_match ("/level[1-4]_ptags$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : strtolower (preg_replace ("/( +)/", " ", trim (preg_replace ("/( *),( *)/", ",", $value))))))))
346
  $value = $default_options[$key];
347
  /**/
348
- else if (preg_match ("/level[1-4]_posts$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
349
  $value = $default_options[$key];
350
  /**/
351
- else if (preg_match ("/level[1-4]_pages$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
352
  $value = $default_options[$key];
353
  /**/
354
  else if ($key === "single_pages" && (!is_string ($value) || !($value = preg_replace ("/[^0-9,]/", "", $value))))
76
  "allow_subscribers_in" => "0", /* Allow subscribers to access the login_welcome_page? */
77
  "force_admin_lockouts" => "0", /* Redirects admin pages/profile to the login_welcome_page. */
78
  /**/
79
+ "login_welcome_page" => "", /* Defaults to the home page. */
80
  "login_redirection_override" => "", /* Alternate redirection location; instead of the welcome page. */
81
+ "membership_options_page" => "", /* Defaults to the home page. */
 
82
  /**/
83
  "login_reg_background_color" => "FFFFFF", /* Defaults to white, and the bg.png is also white. */
84
  "login_reg_background_image" => $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images/bg.png",/**/
143
  "level3_file_downloads_allowed_days" => "", /* This should be numeric or empty. */
144
  "level4_file_downloads_allowed_days" => "", /* This should be numeric or empty. */
145
  /**/
146
+ "file_download_limit_exceeded_page" => "", /* Defaults to the home page. */
147
+ "file_download_inline_extensions" => "", /* List of extensions to serve inline. */
148
+ /**/
149
  "level1_ruris" => "", /* It is ok for these to just be empty strings. */
150
  "level2_ruris" => "", /* It is ok for these to just be empty strings. */
151
  "level3_ruris" => "", /* It is ok for these to just be empty strings. */
236
  else if ($key === "membership_options_page" && (!is_string ($value) || !is_numeric ($value)))
237
  $value = $default_options[$key];
238
  /**/
 
 
 
239
  else if ($key === "login_reg_background_color" && (!is_string ($value) || !strlen ($value)))
240
  $value = $default_options[$key];
241
  /**/
293
  else if ($key === "mailchimp_api_key" && (!is_string ($value) || !strlen ($value)))
294
  $value = $default_options[$key];
295
  /**/
296
+ else if (preg_match ("/^level[0-4]_mailchimp_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/\s+/", "", $value))))
297
  $value = $default_options[$key];
298
  /**/
299
+ else if (preg_match ("/^level[0-4]_aweber_list_ids$/", $key) && (!is_string ($value) || !strlen ($value = preg_replace ("/\s+/", "", $value))))
300
  $value = $default_options[$key];
301
  /**/
302
  else if ($key === "signup_notification_urls" && (!is_string ($value) || !strlen ($value)))
329
  else if ($key === "level4_label" && (!is_string ($value) || !strlen ($value)))
330
  $value = $default_options[$key];
331
  /**/
332
+ else if (preg_match ("/^level[1-4]_file_downloads_allowed$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
333
+ $value = $default_options[$key];
334
+ /**/
335
+ else if (preg_match ("/^level[1-4]_file_downloads_allowed_days$/", $key) && (!is_string ($value) || !is_numeric ($value) || $value < 0))
336
+ $value = $default_options[$key];
337
+ /**/
338
+ else if ($key === "file_download_limit_exceeded_page" && (!is_string ($value) || !is_numeric ($value)))
339
  $value = $default_options[$key];
340
  /**/
341
+ else if ($key === "file_download_inline_extensions" && (!is_string ($value) || !($value = strtolower (preg_replace ("/\s+/", "", $value)))))
342
  $value = $default_options[$key];
343
  /**/
344
+ else if (preg_match ("/^level[1-4]_ruris$/", $key) && (!is_string ($value) || !strlen ($value)))
345
  $value = $default_options[$key];
346
  /**/
347
+ else if (preg_match ("/^level[1-4]_catgs$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
348
  $value = $default_options[$key];
349
  /**/
350
+ else if (preg_match ("/^level[1-4]_ptags$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : strtolower (preg_replace ("/( +)/", " ", trim (preg_replace ("/( *),( *)/", ",", $value))))))))
351
  $value = $default_options[$key];
352
  /**/
353
+ else if (preg_match ("/^level[1-4]_posts$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
354
  $value = $default_options[$key];
355
  /**/
356
+ else if (preg_match ("/^level[1-4]_pages$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : preg_replace ("/[^0-9,]/", "", $value)))))
357
  $value = $default_options[$key];
358
  /**/
359
  else if ($key === "single_pages" && (!is_string ($value) || !($value = preg_replace ("/[^0-9,]/", "", $value))))
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === s2Member ( Membership w/ PayPal® Integration ) also works w/ BuddyPress ===
2
 
3
- Version: 2.9.2
4
- Stable tag: 2.9.2
5
  Framework: WS-P-2.1
6
 
7
  WordPress Compatible: yes
@@ -9,7 +9,7 @@ BuddyPress Compatible: yes
9
  WordPress MU Compatible: soon
10
  MU Blog Farm Compatible: soon
11
 
12
- Tested up to: 2.9
13
  Requires at least: 2.8.4
14
  Requires: WordPress® 2.8.4+, PHP 5.2+
15
 
@@ -49,7 +49,7 @@ s2Member allows you to protect Pages, Posts, Tags, Categories, URIs, URI word fr
49
 
50
  Each Membership Level can have different restrictions, and you could even integrate Conditionals within your content based on Member Level. Advanced code samples are provided under `s2Member -> API Scripting -> Advanced Conditionals`. s2Member has been fully integrated with the Roles &amp; Capabilities that are already built into WordPress®. No new tables :-) 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 compatible with BuddyPress!
51
 
52
- New! - Now you can sell Single-Page Access too, using "Buy Now" buttons. Further details are provided under `s2Member -> PayPal® Buttons`.
53
 
54
  == Screenshots ==
55
 
@@ -69,6 +69,9 @@ New! - Now you can sell Single-Page Access too, using "Buy Now" buttons. Further
69
  = Is there a discussion forum for s2Member? =
70
  Yes. The [Support Forum](http://www.primothemes.com/forums/viewforum.php?f=4) for s2Member is available [here](http://www.primothemes.com/forums/viewforum.php?f=4).
71
 
 
 
 
72
  = Does the PayPal integration work right-out-of-the-box? =
73
  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.
74
 
@@ -81,11 +84,8 @@ Yes, s2Member supports automation of account activation, welcome emails, confirm
81
  = Does s2Member support PayPal® PDT/Auto-Return? =
82
  Yes, s2Member will work with PayPal® Auto-Return/PDT (Payment Data Transfer) `On`, and also with Auto-Return/PDT `Off`. If you enable Auto-Return, you MUST also enable PDT and supply s2Member with your Identity Token. If one is enabled, the other must also be enabled; and vice-versa. There is a place to enter your PayPal® Identity Token for PDT under `s2Member -> PayPal® Options`.
83
 
84
- = Does s2Member install any new database tables? =
85
- No, s2Member has been fully integrated with the Roles &amp; Capabilities that are 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 compatible with BuddyPress!
86
-
87
  = How does s2Member protect content from public access? =
88
- s2Member allows you to protect Pages, Posts, Tags, Categories, URIs, URI word fragments, Single-Page Access ( Buy Now! ), and even portions of content within Pages/Posts. Everything is configurable through the s2Member Options Panel. This makes s2Member VERY easy to integrate into any WordPress®-powered site. With s2Member, you can also protect downloadable files, using special restrictions on how many downloads can occur within a certain amount of time; all based on Membership Level. Each Membership Level can have different restrictions, and you could even integrate Conditionals within your content based on Member Level. Advanced code samples are provided under `s2Member -> API Scripting -> Advanced Conditionals`.
89
 
90
  = Does s2Member provide an API that I can connect to? =
91
  Yes, s2Member provides many *Advanced Scripting* techniques that are fully documented within its Option Panels. Code samples are provided for everything. There are several API functions that you can use, along with s2Member API Constants. This allows you to access many parts of its functionality, as well as specific Member information. Theme designers are welcome to integrate their themes/plugins with s2Member using the code samples that we provide under `s2Member -> API Scripting`. 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 application that should react to certain events.
@@ -101,6 +101,17 @@ Archived releases of s2Member are maintained [here](http://wordpress.org/extend/
101
 
102
  == Changelog ==
103
 
 
 
 
 
 
 
 
 
 
 
 
104
  = 2.9.2 =
105
  * Bug fix. A bug in the PayPal® Auto-Return routine for PDT ( Payment Data Transfer ) has been resolved. This bug was generating a message that read: `Unable to verify POST vars`. This was actually not a bug, but rather, a [limitation in PDT transmissions](https://www.x.com/message/34450#34450) from PayPal®. s2Member has been updated, with a work-around for this limitation. This bug was very elusive, because it was not affecting all PayPal® accounts. In some cases, it was only affecting PayPal® accounts opened after October 2009.
106
 
1
  === s2Member ( Membership w/ PayPal® Integration ) also works w/ BuddyPress ===
2
 
3
+ Version: 2.9.3
4
+ Stable tag: 2.9.3
5
  Framework: WS-P-2.1
6
 
7
  WordPress Compatible: yes
9
  WordPress MU Compatible: soon
10
  MU Blog Farm Compatible: soon
11
 
12
+ Tested up to: 3.0
13
  Requires at least: 2.8.4
14
  Requires: WordPress® 2.8.4+, PHP 5.2+
15
 
49
 
50
  Each Membership Level can have different restrictions, and you could even integrate Conditionals within your content based on Member Level. Advanced code samples are provided under `s2Member -> API Scripting -> Advanced Conditionals`. s2Member has been fully integrated with the Roles &amp; Capabilities that are already built into WordPress®. No new tables :-) 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 compatible with BuddyPress!
51
 
52
+ New! - Now you can sell Single-Page Access ( membership not required ), using "Buy Now" buttons. Further details are provided under `s2Member -> PayPal® Buttons`.
53
 
54
  == Screenshots ==
55
 
69
  = Is there a discussion forum for s2Member? =
70
  Yes. The [Support Forum](http://www.primothemes.com/forums/viewforum.php?f=4) for s2Member is available [here](http://www.primothemes.com/forums/viewforum.php?f=4).
71
 
72
+ = Does s2Member install any new database tables? =
73
+ No, s2Member has been fully integrated with the Roles &amp; Capabilities that are 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 compatible with BuddyPress!
74
+
75
  = Does the PayPal integration work right-out-of-the-box? =
76
  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.
77
 
84
  = Does s2Member support PayPal® PDT/Auto-Return? =
85
  Yes, s2Member will work with PayPal® Auto-Return/PDT (Payment Data Transfer) `On`, and also with Auto-Return/PDT `Off`. If you enable Auto-Return, you MUST also enable PDT and supply s2Member with your Identity Token. If one is enabled, the other must also be enabled; and vice-versa. There is a place to enter your PayPal® Identity Token for PDT under `s2Member -> PayPal® Options`.
86
 
 
 
 
87
  = How does s2Member protect content from public access? =
88
+ s2Member allows you to protect Pages, Posts, Tags, Categories, URIs, URI word fragments, URI replacement codes for BuddyPress, Single-Page Access ( Buy Now! ), and even portions of content within Pages/Posts/themes/plugins using Advanced Conditionals. Everything is configurable through the s2Member Options Panel. This makes s2Member VERY easy to integrate into any WordPress®-powered site. With s2Member, you can also protect downloadable files, using special restrictions on how many downloads can occur within a certain amount of time. Each Membership Level can have different restrictions ( even Custom Capability Packages ). You can also integrate Conditionals within your content based on Member Level or Capabilities. Advanced code samples are provided under `s2Member -> API Scripting -> Advanced Conditionals`.
89
 
90
  = Does s2Member provide an API that I can connect to? =
91
  Yes, s2Member provides many *Advanced Scripting* techniques that are fully documented within its Option Panels. Code samples are provided for everything. There are several API functions that you can use, along with s2Member API Constants. This allows you to access many parts of its functionality, as well as specific Member information. Theme designers are welcome to integrate their themes/plugins with s2Member using the code samples that we provide under `s2Member -> API Scripting`. 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 application that should react to certain events.
101
 
102
  == Changelog ==
103
 
104
+ = 2.9.3 =
105
+ * Documentation fix. `s2Member -> API Scripting -> Advanced Conditionals -> Example #5` contained a PHP syntax error. This has been corrected in v2.9.3.
106
+ * Bug fix. Infinite redirection loop on Download Limit Exceeded Page. This was possible under certain circumstances, based on configuration. Resolved in v2.9.3.
107
+ * s2Member fully tested under WordPress® 3.0-beta2. Everything looks good. If you find any bugs, please report them [here](http://www.primothemes.com/forums/viewforum.php?f=4).
108
+ * New feature. A couple of Replacement Codes are now supported in the s2Member URI Level Access Restrictions. See: `s2Member -> General Options -> URI Level Access` for further details. This can be useful if you're running BuddyPress. For example, if you're using BuddyPress, and want to protect BuddyPress Groups, you could add URI protection, like this: `/members/%%current_user_login%%/groups/`
109
+ * New feature. For protected File Downloads, you may now specify a list of file extensions that should be displayed Inline ( in your browser ) as opposed to being downloaded as an attachment. See: `s2Member -> Download Options -> Inline Extensions`. A new API Constant was also added, which reflects the value of this option: `S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS`.
110
+ * Documentation change. This is only relevant if you've been using the `s2member_xencrypt()` function to provide free access to specific files. The documentation for this has been changed. You should now use `s2member_free_file_download_key=<?php echo md5(s2member_xencrypt("file")); ?>`, instead of just `s2member_xencrypt()` by itself ( which is now deprecated ). The addition of the MD5 hash improves the security of s2Member on a whole, and also makes your links shorter. Please update your links. In future versions of s2Member, the older method will no longer be supported.
111
+ * Compatiblity fix. Calls to the PHP `mail()` function have been modified to exclude additional flag parameters. This makes s2Member more compatible with a variety of MTAs across different hosting providers.
112
+ * New feature. A couple of Replacement Codes are now supported in the s2Member Login Redirection URL. See: `s2Member -> General Options -> Login Welcome Page -> Special Redirection` for further details. This can be useful if you'd like to redirect Members to their BuddyPress Profile, if/when BuddyPress is installed together with s2Member. For example, if you're using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would setup a Special Redirection URL, like this: `http://www.example.com/members/%%current_user_login%%/profile/`
113
+ * Please note. BuddyPress is NOT required to use s2Member. However, the combination of BuddyPress + s2Member is a popular choice among site owners.
114
+
115
  = 2.9.2 =
116
  * Bug fix. A bug in the PayPal® Auto-Return routine for PDT ( Payment Data Transfer ) has been resolved. This bug was generating a message that read: `Unable to verify POST vars`. This was actually not a bug, but rather, a [limitation in PDT transmissions](https://www.x.com/message/34450#34450) from PayPal®. s2Member has been updated, with a work-around for this limitation. This bug was very elusive, because it was not affecting all PayPal® accounts. In some cases, it was only affecting PayPal® accounts opened after October 2009.
117
 
s2member.php CHANGED
@@ -9,8 +9,8 @@ along with this software. In the main directory, see: /licensing/
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
- Version: 2.9.2
13
- Stable tag: 2.9.2
14
  Framework: WS-P-2.1
15
 
16
  WordPress Compatible: yes
9
  If not, see: <http://www.gnu.org/licenses/>.
10
  */
11
  /*
12
+ Version: 2.9.3
13
+ Stable tag: 2.9.3
14
  Framework: WS-P-2.1
15
 
16
  WordPress Compatible: yes