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

Version Description

Download this release

Release Info

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

Code changes from version 111029 to 111105

Files changed (40) hide show
  1. includes/classes/admin-lockouts.inc.php +41 -37
  2. includes/classes/catgs.inc.php +5 -5
  3. includes/classes/files-in.inc.php +12 -12
  4. includes/classes/login-redirects.inc.php +13 -12
  5. includes/classes/menu-pages.inc.php +11 -50
  6. includes/classes/meta-box-saves.inc.php +19 -16
  7. includes/classes/meta-box-security.inc.php +15 -4
  8. includes/classes/mo-page-in.inc.php +51 -10
  9. includes/classes/mo-page.inc.php +21 -1
  10. includes/classes/no-cache.inc.php +0 -1
  11. includes/classes/pages-sp.inc.php +6 -1
  12. includes/classes/pages.inc.php +17 -14
  13. includes/classes/posts-sp.inc.php +4 -1
  14. includes/classes/posts.inc.php +16 -13
  15. includes/classes/ptags.inc.php +5 -5
  16. includes/classes/querys.inc.php +65 -53
  17. includes/classes/registrations.inc.php +1 -1
  18. includes/classes/ruris.inc.php +8 -5
  19. includes/classes/systematics.inc.php +2 -2
  20. includes/classes/utils-arrays.inc.php +57 -15
  21. includes/classes/utils-conds.inc.php +15 -0
  22. includes/classes/utils-gets.inc.php +231 -93
  23. includes/dropins/bridges/_s2member-bbpress-bridge.php +0 -285
  24. includes/menu-pages/code-samples/api-mop-vars-e.x-php +60 -0
  25. includes/menu-pages/code-samples/api-mop-vars-o.x-php +34 -0
  26. includes/menu-pages/code-samples/api-mop-vars.x-php +43 -22
  27. includes/menu-pages/down-ops.inc.php +2 -2
  28. includes/menu-pages/els-ops.inc.php +8 -8
  29. includes/menu-pages/gen-ops.inc.php +1 -1
  30. includes/menu-pages/integrations.inc.php +2 -93
  31. includes/menu-pages/paypal-buttons.inc.php +12 -32
  32. includes/menu-pages/paypal-ops.inc.php +7 -7
  33. includes/menu-pages/res-ops.inc.php +5 -3
  34. includes/menu-pages/scripting.inc.php +12 -2
  35. includes/menu-pages/trk-ops.inc.php +27 -6
  36. includes/menu-pages/ws-mlist.inc.php +3 -3
  37. includes/syscon.inc.php +6 -6
  38. includes/translations/s2member.pot +124 -118
  39. readme.txt +15 -2
  40. s2member.php +4 -4
includes/classes/admin-lockouts.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
21
  {
@@ -41,16 +41,14 @@ if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
41
  {
42
  do_action ("ws_plugin__s2member_before_admin_lockouts", get_defined_vars ());
43
  /**/
44
- if ((!defined ("DOING_AJAX") || !DOING_AJAX) && !current_user_can ("edit_posts") && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"])
45
- if (apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ()) /* Give Filters a chance here too. */)
46
  {
47
  if ($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ())
48
- wp_redirect ($redirection_url); /* Special Redirection. */
49
  /**/
50
  else /* Else we use the Login Welcome Page configured for s2Member. */
51
- wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
52
- /**/
53
- exit (); /* Clean exit. */
54
  }
55
  /**/
56
  do_action ("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
@@ -58,7 +56,7 @@ if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
58
  return; /* Return for uniformity. */
59
  }
60
  /**
61
- * Filters administrative menu bars.
62
  *
63
  * @package s2Member\Admin_Lockouts
64
  * @since 3.5
@@ -74,40 +72,46 @@ if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
74
  /**/
75
  do_action ("ws_plugin__s2member_before_filter_admin_menu_bar", get_defined_vars ());
76
  /**/
77
- if (is_object ($wp_admin_bar) && !current_user_can ("edit_posts"))
78
  {
79
- if (isset ($wp_admin_bar->menu->{"dashboard"})) /* We don't need this. */
80
- unset ($wp_admin_bar->menu->{"dashboard"}); /* Remove this entire menu. */
 
 
 
 
 
 
81
  /**/
82
- if (is_multisite () && !c_ws_plugin__s2member_utils_conds::is_multisite_farm () && isset ($wp_admin_bar->menu->{"my-blogs"}))
83
- {
84
- $wp_admin_bar->menu->{"my-blogs"}["href"] = "#"; /* Void this link out by converting to `#`. */
85
- /**/
86
- if (isset ($wp_admin_bar->menu->{"my-blogs"}["children"]) && is_object ($wp_admin_bar->menu->{"my-blogs"}["children"]))
87
- foreach ($wp_admin_bar->menu->{"my-blogs"}["children"] as &$blog) /* Modify other Blog links in drop-down. */
88
- if (is_array ($blog) && isset ($blog["href"], $blog["children"]) && is_object ($blog["children"]))
89
- {
90
- $blog["href"] = preg_replace ("/\/wp-admin/", "", $blog["href"]);
91
- unset ($blog["children"]); /* Cause all we need is the link. */
92
- }
93
- }
94
  /**/
95
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"] && apply_filters ("ws_plugin__s2member_admin_lockout", true, get_defined_vars ()))
96
- {
97
- $lwp = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user);
98
- $lwp = (!$lwp) ? get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) : $lwp;
99
- /**/
100
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"})) /* Profile. */
101
- {
102
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["href"]))
103
- $wp_admin_bar->menu->{"my-account-with-avatar"}["href"] = $lwp;
104
- /**/
105
- if (isset ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"]))
106
- $wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"] = $lwp;
107
- }
108
- }
109
  }
110
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  do_action ("ws_plugin__s2member_after_filter_admin_menu_bar", get_defined_vars ());
112
  /**/
113
  return; /* Return for uniformity. */
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_admin_lockouts"))
21
  {
41
  {
42
  do_action ("ws_plugin__s2member_before_admin_lockouts", get_defined_vars ());
43
  /**/
44
+ if ((!defined ("DOING_AJAX") || !DOING_AJAX) && !current_user_can ("edit_posts") /* Give Filters a chance here too. */)
45
+ if (apply_filters ("ws_plugin__s2member_admin_lockout", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"], get_defined_vars ()))
46
  {
47
  if ($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ())
48
+ wp_redirect($redirection_url) . exit (); /* Special Redirection. */
49
  /**/
50
  else /* Else we use the Login Welcome Page configured for s2Member. */
51
+ wp_redirect(get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"])) . exit ();
 
 
52
  }
53
  /**/
54
  do_action ("ws_plugin__s2member_after_admin_lockouts", get_defined_vars ());
56
  return; /* Return for uniformity. */
57
  }
58
  /**
59
+ * Filters administrative menu bar for Users/Members.
60
  *
61
  * @package s2Member\Admin_Lockouts
62
  * @since 3.5
72
  /**/
73
  do_action ("ws_plugin__s2member_before_filter_admin_menu_bar", get_defined_vars ());
74
  /**/
75
+ if (is_object ($wp_admin_bar) && !current_user_can ("edit_posts") /* Always for Users/Members. */)
76
  {
77
+ if (isset /* Does it have this? */ ($wp_admin_bar->menu->{"wp-logo"}))
78
+ unset /* Ditch this. */($wp_admin_bar->menu->{"wp-logo"});
79
+ /**/
80
+ if (isset /* Does it have this? */ ($wp_admin_bar->menu->{"site-name"}["href"]))
81
+ $wp_admin_bar->menu->{"site-name"}["href"] = /* Modify this to. */ site_url ("/");
82
+ /**/
83
+ if (isset /* Does it have this? */ ($wp_admin_bar->menu->{"site-name"}["children"]))
84
+ unset /* Ditch this. */($wp_admin_bar->menu->{"site-name"}["children"]);
85
  /**/
86
+ if (isset /* Before WordPress® 3.3-beta2. */ ($wp_admin_bar->menu->{"dashboard"}))
87
+ unset /* Ditch this. */($wp_admin_bar->menu->{"dashboard"});
 
 
 
 
 
 
 
 
 
 
88
  /**/
89
+ if (isset /* Does it have this? */ ($wp_admin_bar->menu->{"my-sites"}))
90
+ unset /* Ditch this. */($wp_admin_bar->menu->{"my-sites"});
91
+ /**/
92
+ if (isset /* Before WordPress® 3.3-beta2. */ ($wp_admin_bar->menu->{"my-blogs"}))
93
+ unset /* Ditch this. */($wp_admin_bar->menu->{"my-blogs"});
 
 
 
 
 
 
 
 
 
94
  }
95
  /**/
96
+ if (is_object ($wp_admin_bar) && !current_user_can ("edit_posts") /* If locking Users/Members out of `/wp-admin/` areas. */)
97
+ if (apply_filters ("ws_plugin__s2member_admin_lockout", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["force_admin_lockouts"], get_defined_vars ()))
98
+ {
99
+ $lwp = c_ws_plugin__s2member_login_redirects::login_redirection_url ();
100
+ $lwp = (!$lwp) ? get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]) : $lwp;
101
+ /**/
102
+ if (isset /* Does it have this? */ ($wp_admin_bar->menu->{"my-account"}["href"]))
103
+ $wp_admin_bar->menu->{"my-account"}["href"] = /* Modify this to. */ $lwp;
104
+ /**/
105
+ if (isset /* Before WordPress® 3.3-beta2. */ ($wp_admin_bar->menu->{"my-account-with-avatar"}["href"]))
106
+ $wp_admin_bar->menu->{"my-account-with-avatar"}["href"] = /* Modify this to. */ $lwp;
107
+ /**/
108
+ if (isset /* Does it have this? */ ($wp_admin_bar->menu->{"my-account"}["children"]->{"edit-profile"}["href"]))
109
+ $wp_admin_bar->menu->{"my-account"}["children"]->{"edit-profile"}["href"] = /* Modify this to. */ $lwp;
110
+ /**/
111
+ if (isset /* Before WordPress® 3.3-beta2. */ ($wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"]))
112
+ $wp_admin_bar->menu->{"my-account-with-avatar"}["children"]->{"edit-profile"}["href"] = /* Modify this to. */ $lwp;
113
+ }
114
+ /**/
115
  do_action ("ws_plugin__s2member_after_filter_admin_menu_bar", get_defined_vars ());
116
  /**/
117
  return; /* Return for uniformity. */
includes/classes/catgs.inc.php CHANGED
@@ -50,22 +50,22 @@ if (!class_exists ("c_ws_plugin__s2member_catgs"))
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
53
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
54
  /**/
55
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above. */
56
  {
57
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Category Level restrictions. Go through each Level. We also check nested Categories. */
58
  {
59
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
60
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
61
  /**/
62
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] && in_array ($cat_id, ($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]))) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
63
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
64
  /**/
65
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]) /* Check Category ancestry. */
66
  foreach (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]) as $catg)
67
  if ($catg && cat_is_ancestor_of ($catg, $cat_id) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
68
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
69
  }
70
  /**/
71
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* URIs. Go through each Level. */
@@ -74,7 +74,7 @@ if (!class_exists ("c_ws_plugin__s2member_catgs"))
74
  /**/
75
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
76
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
77
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "catg-" . $cat_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
78
  }
79
  }
80
  /**/
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
53
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("catg", $cat_id, "level", 0, $_SERVER["REQUEST_URI"], "sys") . exit ();
54
  /**/
55
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above. */
56
  {
57
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Category Level restrictions. Go through each Level. We also check nested Categories. */
58
  {
59
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
60
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("catg", $cat_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
61
  /**/
62
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] && in_array ($cat_id, ($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]))) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
63
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("catg", $cat_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
64
  /**/
65
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]) /* Check Category ancestry. */
66
  foreach (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]) as $catg)
67
  if ($catg && cat_is_ancestor_of ($catg, $cat_id) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
68
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("catg", $cat_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
69
  }
70
  /**/
71
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* URIs. Go through each Level. */
74
  /**/
75
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
76
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
77
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("catg", $cat_id, "level", $n, $_SERVER["REQUEST_URI"], "ruri") . exit ();
78
  }
79
  }
80
  /**/
includes/classes/files-in.inc.php CHANGED
@@ -126,44 +126,44 @@ if (!class_exists ("c_ws_plugin__s2member_files_in"))
126
  /**/
127
  else if (!is_object ($user = apply_filters ("ws_plugin__s2member_check_file_download_access_user", ((is_user_logged_in ()) ? wp_get_current_user () : false), get_defined_vars ())) || empty ($user->ID) || !($user_id = $user->ID) || !is_array ($user_file_downloads = c_ws_plugin__s2member_files::user_downloads ($user)) || (!$user->has_cap ("administrator") && (!$user_file_downloads["allowed"] || !$user_file_downloads["allowed_days"])))
128
  {
129
- if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $req["file_download"], $m) && strlen ($level_req = $m[1]) && (!is_object ($user) || empty ($user->ID) || !$user->has_cap ("access_s2member_level" . $level_req)))
130
  {
131
  if ($serving) /* We only need this section when/if we're actually serving. */
132
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $req["file_download"], "s2member_level_req" => $level_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
133
  /**/
134
  else /* Else return false. */
135
  return false;
136
  }
137
  /**/
138
- else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $req["file_download"], $m) && strlen ($ccap_req = preg_replace ("/-/", "_", $m[1])) && (!is_object ($user) || empty ($user->ID) || !$user->has_cap ("access_s2member_ccap_" . $ccap_req)))
139
  {
140
  if ($serving) /* We only need this section when/if we're actually serving. */
141
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $req["file_download"], "s2member_ccap_req" => $ccap_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
142
  /**/
143
  else /* Else return false. */
144
  return false;
145
  }
146
  /**/
147
  else if ($serving) /* We only need this section when/if we're actually serving. */
148
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $req["file_download"], "s2member_level_req" => (string)$min_level_4_downloads)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
149
  /**/
150
  else /* Else return false. */
151
  return false;
152
  }
153
  /**/
154
- else if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $req["file_download"], $m) && strlen ($level_req = $m[1]) && !$user->has_cap ("access_s2member_level" . $level_req))
155
  {
156
  if ($serving) /* We only need this section when/if we're actually serving. */
157
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $req["file_download"], "s2member_level_req" => $level_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
158
  /**/
159
  else /* Else return false. */
160
  return false;
161
  }
162
  /**/
163
- else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $req["file_download"], $m) && strlen ($ccap_req = preg_replace ("/-/", "_", $m[1])) && !$user->has_cap ("access_s2member_ccap_" . $ccap_req))
164
  {
165
  if ($serving) /* We only need this section when/if we're actually serving. */
166
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $req["file_download"], "s2member_ccap_req" => $ccap_req)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
167
  /**/
168
  else /* Else return false. */
169
  return false;
@@ -219,10 +219,10 @@ if (!class_exists ("c_ws_plugin__s2member_files_in"))
219
  if ( /* Updating counter? */$updating_user_counter && /* Do we need a new log entry for this file? */ !$user_already_downloaded_this_file && !$user_already_downloaded_a_streaming_variation_of_this_file)
220
  $user_file_download_access_log[] = array ("date" => date ("Y-m-d"), "time" => time (), "ltime" => time (), "file" => $req["file_download"], "counter" => 1);
221
  /**/
222
- if (!$user_already_downloaded_this_file && !$user_already_downloaded_a_streaming_variation_of_this_file && !$user->has_cap ("administrator") && $user_previous_file_downloads >= $user_file_downloads["allowed"])
223
  {
224
  if ($serving) /* We only need this section when/if we're actually serving. */
225
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "file-" . $req["file_download"])), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
226
  /**/
227
  else /* Else return false. */
228
  return false;
@@ -708,10 +708,10 @@ if (!class_exists ("c_ws_plugin__s2member_files_in"))
708
  $cfc["expires"] = strtotime ("+" . apply_filters ("ws_plugin__s2member_amazon_cf_file_expires_time", "24 hours", get_defined_vars ()));
709
  /**/
710
  $cf_extn = strtolower (substr ($file, strrpos ($file, ".") + 1)); /* Parses the file extension out so we can scan it in some special scenarios. */
 
711
  $cf_stream_extn_resource_exclusions = array_unique ((array)apply_filters ("ws_plugin__s2member_amazon_cf_file_streaming_extension_resource_exclusions", array ("mp3" /* MP3 files should NOT include an extension in their resource reference. */), get_defined_vars ()));
712
  $cf_resource = ($stream) ? ((in_array ($cf_extn, $cf_stream_extn_resource_exclusions)) ? substr ($file, 0, strrpos ($file, ".")) : $file) : "http" . (($ssl) ? "s" : "") . "://" . (($cfc["distro_downloads_cname"]) ? $cfc["distro_downloads_cname"] : $cfc["distro_downloads_dname"]) . "/" . $file;
713
  $cf_url = ($stream) ? "rtmp" . (($ssl) ? "e" : "") . "://" . (($cfc["distro_streaming_cname"]) ? $cfc["distro_streaming_cname"] : $cfc["distro_streaming_dname"]) . "/cfx/st/" . $file : "http" . (($ssl) ? "s" : "") . "://" . (($cfc["distro_downloads_cname"]) ? $cfc["distro_downloads_cname"] : $cfc["distro_downloads_dname"]) . "/" . $file;
714
- $cf_ip_res = (stripos ($_SERVER["HTTP_HOST"], "localhost") === false && strpos ($_SERVER["HTTP_HOST"], "127.0.0.1") === false && (!defined ("LOCALHOST") || !LOCALHOST)) ? true : false; /* Don NOT restrict access to a particular IP during `localhost` development. The IP will NOT be the same one Amazon® CloudFront sees ( will NOT jive ). */
715
  $cf_policy = '{"Statement":[{"Resource":"' . c_ws_plugin__s2member_utils_strings::esc_dq ($cf_resource) . '","Condition":{' . (($cf_ip_res) ? '"IpAddress":{"AWS:SourceIp":"' . c_ws_plugin__s2member_utils_strings::esc_dq ($_SERVER["REMOTE_ADDR"]) . '/32"},' : '') . '"DateLessThan":{"AWS:EpochTime":' . (int)$cfc["expires"] . '}}}]}';
716
  /**/
717
  $cf_signature = c_ws_plugin__s2member_files_in::amazon_cf_rsa_sign ($cf_policy);
126
  /**/
127
  else if (!is_object ($user = apply_filters ("ws_plugin__s2member_check_file_download_access_user", ((is_user_logged_in ()) ? wp_get_current_user () : false), get_defined_vars ())) || empty ($user->ID) || !($user_id = $user->ID) || !is_array ($user_file_downloads = c_ws_plugin__s2member_files::user_downloads ($user)) || (!$user->has_cap ("administrator") && (!$user_file_downloads["allowed"] || !$user_file_downloads["allowed_days"])))
128
  {
129
+ if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $req["file_download"], $m) && strlen ($req_level = $m[1]) && (!is_object ($user) || empty ($user->ID) || !$user->has_cap ("access_s2member_level" . $req_level)))
130
  {
131
  if ($serving) /* We only need this section when/if we're actually serving. */
132
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("file", $req["file_download"], "level", $req_level, $_SERVER["REQUEST_URI"]) . exit ();
133
  /**/
134
  else /* Else return false. */
135
  return false;
136
  }
137
  /**/
138
+ else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $req["file_download"], $m) && strlen ($req_ccap = preg_replace ("/-/", "_", $m[1])) && (!is_object ($user) || empty ($user->ID) || !$user->has_cap ("access_s2member_ccap_" . $req_ccap)))
139
  {
140
  if ($serving) /* We only need this section when/if we're actually serving. */
141
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("file", $req["file_download"], "ccap", $req_ccap, $_SERVER["REQUEST_URI"]) . exit ();
142
  /**/
143
  else /* Else return false. */
144
  return false;
145
  }
146
  /**/
147
  else if ($serving) /* We only need this section when/if we're actually serving. */
148
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("file", $req["file_download"], "level", $min_level_4_downloads, $_SERVER["REQUEST_URI"]) . exit ();
149
  /**/
150
  else /* Else return false. */
151
  return false;
152
  }
153
  /**/
154
+ else if (preg_match ("/^access[_\-]s2member[_\-]level([0-9]+)\//", $req["file_download"], $m) && strlen ($req_level = $m[1]) && !$user->has_cap ("access_s2member_level" . $req_level))
155
  {
156
  if ($serving) /* We only need this section when/if we're actually serving. */
157
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("file", $req["file_download"], "level", $req_level, $_SERVER["REQUEST_URI"]) . exit ();
158
  /**/
159
  else /* Else return false. */
160
  return false;
161
  }
162
  /**/
163
+ else if (preg_match ("/^access[_\-]s2member[_\-]ccap[_\-](.+?)\//", $req["file_download"], $m) && strlen ($req_ccap = preg_replace ("/-/", "_", $m[1])) && !$user->has_cap ("access_s2member_ccap_" . $req_ccap))
164
  {
165
  if ($serving) /* We only need this section when/if we're actually serving. */
166
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("file", $req["file_download"], "ccap", $req_ccap, $_SERVER["REQUEST_URI"]) . exit ();
167
  /**/
168
  else /* Else return false. */
169
  return false;
219
  if ( /* Updating counter? */$updating_user_counter && /* Do we need a new log entry for this file? */ !$user_already_downloaded_this_file && !$user_already_downloaded_a_streaming_variation_of_this_file)
220
  $user_file_download_access_log[] = array ("date" => date ("Y-m-d"), "time" => time (), "ltime" => time (), "file" => $req["file_download"], "counter" => 1);
221
  /**/
222
+ if ($user_previous_file_downloads >= $user_file_downloads["allowed"] && !$user_already_downloaded_this_file && !$user_already_downloaded_a_streaming_variation_of_this_file && !$user->has_cap ("administrator"))
223
  {
224
  if ($serving) /* We only need this section when/if we're actually serving. */
225
+ wp_redirect (add_query_arg (urlencode_deep (array ("_s2member_seeking" => array ("type" => "file", "file" => $req["file_download"], "_uri" => base64_encode ($_SERVER["REQUEST_URI"])), "s2member_seeking" => "file-" . $req["file_download"])), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
226
  /**/
227
  else /* Else return false. */
228
  return false;
708
  $cfc["expires"] = strtotime ("+" . apply_filters ("ws_plugin__s2member_amazon_cf_file_expires_time", "24 hours", get_defined_vars ()));
709
  /**/
710
  $cf_extn = strtolower (substr ($file, strrpos ($file, ".") + 1)); /* Parses the file extension out so we can scan it in some special scenarios. */
711
+ $cf_ip_res = (c_ws_plugin__s2member_utils_conds::is_localhost ()) ? false : true; /* Do NOT restrict access to a particular IP during `localhost` development. The IP may NOT be the same one Amazon® CloudFront sees. */
712
  $cf_stream_extn_resource_exclusions = array_unique ((array)apply_filters ("ws_plugin__s2member_amazon_cf_file_streaming_extension_resource_exclusions", array ("mp3" /* MP3 files should NOT include an extension in their resource reference. */), get_defined_vars ()));
713
  $cf_resource = ($stream) ? ((in_array ($cf_extn, $cf_stream_extn_resource_exclusions)) ? substr ($file, 0, strrpos ($file, ".")) : $file) : "http" . (($ssl) ? "s" : "") . "://" . (($cfc["distro_downloads_cname"]) ? $cfc["distro_downloads_cname"] : $cfc["distro_downloads_dname"]) . "/" . $file;
714
  $cf_url = ($stream) ? "rtmp" . (($ssl) ? "e" : "") . "://" . (($cfc["distro_streaming_cname"]) ? $cfc["distro_streaming_cname"] : $cfc["distro_streaming_dname"]) . "/cfx/st/" . $file : "http" . (($ssl) ? "s" : "") . "://" . (($cfc["distro_downloads_cname"]) ? $cfc["distro_downloads_cname"] : $cfc["distro_downloads_dname"]) . "/" . $file;
 
715
  $cf_policy = '{"Statement":[{"Resource":"' . c_ws_plugin__s2member_utils_strings::esc_dq ($cf_resource) . '","Condition":{' . (($cf_ip_res) ? '"IpAddress":{"AWS:SourceIp":"' . c_ws_plugin__s2member_utils_strings::esc_dq ($_SERVER["REMOTE_ADDR"]) . '/32"},' : '') . '"DateLessThan":{"AWS:EpochTime":' . (int)$cfc["expires"] . '}}}]}';
716
  /**/
717
  $cf_signature = c_ws_plugin__s2member_files_in::amazon_cf_rsa_sign ($cf_policy);
includes/classes/login-redirects.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
21
  {
@@ -40,7 +40,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
40
  */
41
  public static function login_redirect ($username = FALSE)
42
  {
43
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
44
  do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
45
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
46
  /**/
@@ -55,7 +55,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
55
  update_user_option ($user_id, "s2member_login_counter", $logins);
56
  /**/
57
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) /* Nag em? */
58
- delete_user_setting("default_password_nag") . update_user_option ($user_id, "default_password_nag", false, true);
59
  /**/
60
  $disable_login_ip_restrictions = apply_filters ("ws_plugin__s2member_disable_login_ip_restrictions", false, get_defined_vars ());
61
  /**/
@@ -68,25 +68,25 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
68
  /**/
69
  if (!$obey_redirect_to || empty ($_REQUEST["redirect_to"]) || !is_string ($_REQUEST["redirect_to"]) || $_REQUEST["redirect_to"] === admin_url () || preg_match ("/^\/?wp-admin\/?$/", $_REQUEST["redirect_to"]))
70
  {
71
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
72
  do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
73
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
74
  /**/
75
  if ($redirect && is_string ($redirect)) /* Is this a string? */
76
- wp_redirect($redirect); /* Dynamic URL introduced by a Filter? */
77
  /**/
78
  else if ($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user))
79
- wp_redirect($redirection_url); /* Special Redirection URL configured with s2Member. */
80
  /**/
81
  else /* Else we use the Login Welcome Page configured for s2Member. */
82
- wp_redirect(get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
83
  /**/
84
  exit (); /* Clean exit. */
85
  }
86
  }
87
  }
88
  /**/
89
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
90
  do_action ("ws_plugin__s2member_after_login_redirect", get_defined_vars ());
91
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
92
  /**/
@@ -104,7 +104,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
104
  */
105
  public static function login_redirection_url ($user = FALSE, $root_returns_false = FALSE)
106
  {
107
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
108
  do_action ("ws_plugin__s2member_before_login_redirection_url", get_defined_vars ());
109
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
110
  /**/
@@ -125,7 +125,7 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
125
  */
126
  public static function login_redirection_uri ($user = FALSE, $root_returns_false = FALSE)
127
  {
128
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
129
  do_action ("ws_plugin__s2member_before_login_redirection_uri", get_defined_vars ());
130
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
131
  /**/
@@ -141,16 +141,17 @@ if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
141
  * @since 3.5
142
  *
143
  * @param str $url A URL with possible Replacement Codes in it.
144
- * @param obj $user Optional. A WP_User object. Defaults to the current User, if logged-in.
145
  * @param bool $root_returns_false Defaults to false. True if the function should return false when a URL is reduced to the site root.
146
  * @return str|bool A Special Login Redirection URL with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URL is the site root.
147
  */
148
  public static function fill_login_redirect_rc_vars ($url = FALSE, $user = FALSE, $root_returns_false = FALSE)
149
  {
150
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
151
  do_action ("ws_plugin__s2member_before_fill_login_redirect_rc_vars", get_defined_vars ());
152
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
153
  /**/
 
154
  $orig_url = $url; /* Record the original URL that was passed in. */
155
  /**/
156
  $user = ((is_object ($user) || is_object ($user = (is_user_logged_in ()) ? wp_get_current_user () : false)) && !empty ($user->ID)) ? $user : false;
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_login_redirects"))
21
  {
40
  */
41
  public static function login_redirect ($username = FALSE)
42
  {
43
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
44
  do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
45
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
46
  /**/
55
  update_user_option ($user_id, "s2member_login_counter", $logins);
56
  /**/
57
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"]) /* Nag em? */
58
+ delete_user_setting ("default_password_nag") . update_user_option ($user_id, "default_password_nag", false, true);
59
  /**/
60
  $disable_login_ip_restrictions = apply_filters ("ws_plugin__s2member_disable_login_ip_restrictions", false, get_defined_vars ());
61
  /**/
68
  /**/
69
  if (!$obey_redirect_to || empty ($_REQUEST["redirect_to"]) || !is_string ($_REQUEST["redirect_to"]) || $_REQUEST["redirect_to"] === admin_url () || preg_match ("/^\/?wp-admin\/?$/", $_REQUEST["redirect_to"]))
70
  {
71
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
72
  do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
73
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
74
  /**/
75
  if ($redirect && is_string ($redirect)) /* Is this a string? */
76
+ wp_redirect ($redirect); /* Dynamic URL introduced by a Filter? */
77
  /**/
78
  else if ($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user))
79
+ wp_redirect ($redirection_url); /* Special Redirection URL configured with s2Member. */
80
  /**/
81
  else /* Else we use the Login Welcome Page configured for s2Member. */
82
+ wp_redirect (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
83
  /**/
84
  exit (); /* Clean exit. */
85
  }
86
  }
87
  }
88
  /**/
89
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
90
  do_action ("ws_plugin__s2member_after_login_redirect", get_defined_vars ());
91
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
92
  /**/
104
  */
105
  public static function login_redirection_url ($user = FALSE, $root_returns_false = FALSE)
106
  {
107
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
108
  do_action ("ws_plugin__s2member_before_login_redirection_url", get_defined_vars ());
109
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
110
  /**/
125
  */
126
  public static function login_redirection_uri ($user = FALSE, $root_returns_false = FALSE)
127
  {
128
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
129
  do_action ("ws_plugin__s2member_before_login_redirection_uri", get_defined_vars ());
130
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
131
  /**/
141
  * @since 3.5
142
  *
143
  * @param str $url A URL with possible Replacement Codes in it.
144
+ * @param obj $user Optional. A `WP_User` object. Defaults to the current User, if logged-in.
145
  * @param bool $root_returns_false Defaults to false. True if the function should return false when a URL is reduced to the site root.
146
  * @return str|bool A Special Login Redirection URL with Replacement Codes having been parsed, or false if ``$root_returns_false = true`` and the URL is the site root.
147
  */
148
  public static function fill_login_redirect_rc_vars ($url = FALSE, $user = FALSE, $root_returns_false = FALSE)
149
  {
150
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
151
  do_action ("ws_plugin__s2member_before_fill_login_redirect_rc_vars", get_defined_vars ());
152
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
153
  /**/
154
+ $url = (string)$url; /* Force ``$url`` to a string value. */
155
  $orig_url = $url; /* Record the original URL that was passed in. */
156
  /**/
157
  $user = ((is_object ($user) || is_object ($user = (is_user_logged_in ()) ? wp_get_current_user () : false)) && !empty ($user->ID)) ? $user : false;
includes/classes/menu-pages.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
21
  {
@@ -48,7 +48,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
48
  {
49
  $updated_all_options = false; /* Initialize this to a value of false. Initializing this variable here makes it an available reference-variable to Hooks/Filters. */
50
  /**/
51
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
52
  do_action ("ws_plugin__s2member_before_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
53
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
54
  /**/
@@ -70,7 +70,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
70
  /**/
71
  unset ($key, $value); /* Unset these utility variables now. This prevents bleeding vars into Hooks/Filters that are of no use. */
72
  /**/
73
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
74
  do_action ("ws_plugin__s2member_during_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
75
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
76
  /**/
@@ -110,7 +110,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
110
  $updated_all_options = true; /* Flag indicating this routine was processed successfully; and that all s2Member options have been updated successfully.*/
111
  }
112
  /**/
113
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
114
  do_action ("ws_plugin__s2member_after_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
115
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
116
  /**/
@@ -261,7 +261,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
261
  */
262
  public static function _add_settings_link ($actions = FALSE, $plugin_file = FALSE)
263
  {
264
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
265
  do_action ("_ws_plugin__s2member_before_add_settings_link", get_defined_vars ());
266
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
267
  /**/
@@ -270,7 +270,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
270
  $settings = '<a href="' . esc_attr (admin_url ("/admin.php?page=ws-plugin--s2member-gen-ops")) . '">Settings</a>';
271
  array_unshift ($actions, apply_filters ("ws_plugin__s2member_add_settings_link", $settings, get_defined_vars ()));
272
  /**/
273
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
274
  do_action ("_ws_plugin__s2member_during_add_settings_link", get_defined_vars ());
275
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
276
  }
@@ -293,10 +293,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
293
  /**/
294
  if (!empty ($_GET["page"]) && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
295
  {
296
- wp_enqueue_script ("jquery");
297
- wp_enqueue_script ("thickbox");
298
- wp_enqueue_script ("media-upload");
299
- wp_enqueue_script ("jquery-ui-core");
300
  wp_enqueue_script ("jquery-sprintf", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.sprintf/jquery.sprintf-min.js", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum ());
301
  wp_enqueue_script ("jquery-json-ps", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.json-ps/jquery.json-ps-min.js", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum ());
302
  wp_enqueue_script ("jquery-ui-effects", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.ui-effects/jquery.ui-effects-min.js", array ("jquery", "jquery-ui-core"), c_ws_plugin__s2member_utilities::ver_checksum ());
@@ -325,7 +325,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
325
  /**/
326
  if (!empty ($_GET["page"]) && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
327
  {
328
- wp_enqueue_style ("thickbox");
329
  wp_enqueue_style ("ws-plugin--s2member-menu-pages", site_url ("/?ws_plugin__s2member_menu_pages_css=" . urlencode (mt_rand ())), array ("thickbox"), c_ws_plugin__s2member_utilities::ver_checksum (), "all");
330
  /**/
331
  do_action ("ws_plugin__s2member_during_add_admin_styles", get_defined_vars ());
@@ -619,45 +619,6 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
619
  {
620
  do_action ("ws_plugin__s2member_before_integrations_page", get_defined_vars ());
621
  /**/
622
- if (!empty ($_POST["ws_plugin__s2member_bridge_bbpress"]) && ($nonce = $_POST["ws_plugin__s2member_bridge_bbpress"]) && wp_verify_nonce ($nonce, "ws-plugin--s2member-bridge-bbpress") && ($_p = c_ws_plugin__s2member_utils_strings::trim_deep (stripslashes_deep ($_POST))))
623
- {
624
- if (!empty ($_p["ws_plugin__s2member_bridge_bbpress_plugins_dir"]) && is_dir ($plugins_dir = untrailingslashit ($_p["ws_plugin__s2member_bridge_bbpress_plugins_dir"])))
625
- {
626
- if (is_writable ($plugins_dir)) /* This directory MUST be writable. */
627
- {
628
- if (preg_match ("/^Install/i", $_p["ws_plugin__s2member_bridge_bbpress_action"]))
629
- {
630
- $min = (string)$_p["ws_plugin__s2member_bridge_bbpress_min_level"];
631
- $ovg = (string)$_p["ws_plugin__s2member_bridge_bbpress_ovg"];
632
- /**/
633
- if (($file = file_get_contents (dirname (dirname (__FILE__)) . "/dropins/bridges/_s2member-bbpress-bridge.php")) && ($file = preg_replace ("/%%min%%/i", c_ws_plugin__s2member_utils_strings::esc_dq ($min), preg_replace ("/%%ovg%%/i", c_ws_plugin__s2member_utils_strings::esc_dq ($ovg), $file))) && file_put_contents ($plugins_dir . "/_s2member-bbpress-bridge.php", $file))
634
- c_ws_plugin__s2member_admin_notices::display_admin_notice ('The bbPress® Bridge/plugin has been <strong>installed successfully</strong>.');
635
- /**/
636
- else /* Otherwise, something unexpected. The site owner will need to install the bbPress® plugin manually. */
637
- c_ws_plugin__s2member_admin_notices::display_admin_notice ('Unknown error. Please try again, or install manually.', true);
638
- }
639
- /**/
640
- else if (preg_match ("/^Un-Install/i", $_p["ws_plugin__s2member_bridge_bbpress_action"]))
641
- {
642
- if (file_exists ($plugins_dir . "/_s2member-bbpress-bridge.php"))
643
- {
644
- if (!unlink ($plugins_dir . "/_s2member-bbpress-bridge.php")) /* Test return value of unlink. */
645
- c_ws_plugin__s2member_admin_notices::display_admin_notice ('Unknown error. Please try again, or un-install manually.', true);
646
- /**/
647
- else /* Otherwise, everything looks good. The plugin file has been removed successfully. */
648
- c_ws_plugin__s2member_admin_notices::display_admin_notice ('The bbPress® Bridge/plugin has been successfully <strong>uninstalled</strong>.');
649
- }
650
- else
651
- c_ws_plugin__s2member_admin_notices::display_admin_notice ('The bbPress® Bridge/plugin is already un-installed.', true);
652
- }
653
- }
654
- else
655
- c_ws_plugin__s2member_admin_notices::display_admin_notice ('The directory you specified is NOT writable. Please try again, or install manually.', true);
656
- }
657
- else
658
- c_ws_plugin__s2member_admin_notices::display_admin_notice ('The directory you specified does NOT exist. Please try again, or install manually.', true);
659
- }
660
- /**/
661
  include_once dirname (dirname (__FILE__)) . "/menu-pages/integrations.inc.php";
662
  /**/
663
  do_action ("ws_plugin__s2member_after_integrations_page", get_defined_vars ());
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_pages"))
21
  {
48
  {
49
  $updated_all_options = false; /* Initialize this to a value of false. Initializing this variable here makes it an available reference-variable to Hooks/Filters. */
50
  /**/
51
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
52
  do_action ("ws_plugin__s2member_before_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
53
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
54
  /**/
70
  /**/
71
  unset ($key, $value); /* Unset these utility variables now. This prevents bleeding vars into Hooks/Filters that are of no use. */
72
  /**/
73
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
74
  do_action ("ws_plugin__s2member_during_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
75
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
76
  /**/
110
  $updated_all_options = true; /* Flag indicating this routine was processed successfully; and that all s2Member options have been updated successfully.*/
111
  }
112
  /**/
113
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
114
  do_action ("ws_plugin__s2member_after_update_all_options", get_defined_vars ()); /* If you use this Hook, be sure to use ``wp_verify_nonce()``. */
115
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
116
  /**/
261
  */
262
  public static function _add_settings_link ($actions = FALSE, $plugin_file = FALSE)
263
  {
264
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
265
  do_action ("_ws_plugin__s2member_before_add_settings_link", get_defined_vars ());
266
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
267
  /**/
270
  $settings = '<a href="' . esc_attr (admin_url ("/admin.php?page=ws-plugin--s2member-gen-ops")) . '">Settings</a>';
271
  array_unshift ($actions, apply_filters ("ws_plugin__s2member_add_settings_link", $settings, get_defined_vars ()));
272
  /**/
273
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
274
  do_action ("_ws_plugin__s2member_during_add_settings_link", get_defined_vars ());
275
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
276
  }
293
  /**/
294
  if (!empty ($_GET["page"]) && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
295
  {
296
+ wp_enqueue_script("jquery");
297
+ wp_enqueue_script("thickbox");
298
+ wp_enqueue_script("media-upload");
299
+ wp_enqueue_script("jquery-ui-core");
300
  wp_enqueue_script ("jquery-sprintf", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.sprintf/jquery.sprintf-min.js", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum ());
301
  wp_enqueue_script ("jquery-json-ps", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.json-ps/jquery.json-ps-min.js", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum ());
302
  wp_enqueue_script ("jquery-ui-effects", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/includes/jquery/jquery.ui-effects/jquery.ui-effects-min.js", array ("jquery", "jquery-ui-core"), c_ws_plugin__s2member_utilities::ver_checksum ());
325
  /**/
326
  if (!empty ($_GET["page"]) && preg_match ("/ws-plugin--s2member-/", $_GET["page"]))
327
  {
328
+ wp_enqueue_style("thickbox");
329
  wp_enqueue_style ("ws-plugin--s2member-menu-pages", site_url ("/?ws_plugin__s2member_menu_pages_css=" . urlencode (mt_rand ())), array ("thickbox"), c_ws_plugin__s2member_utilities::ver_checksum (), "all");
330
  /**/
331
  do_action ("ws_plugin__s2member_during_add_admin_styles", get_defined_vars ());
619
  {
620
  do_action ("ws_plugin__s2member_before_integrations_page", get_defined_vars ());
621
  /**/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  include_once dirname (dirname (__FILE__)) . "/menu-pages/integrations.inc.php";
623
  /**/
624
  do_action ("ws_plugin__s2member_after_integrations_page", get_defined_vars ());
includes/classes/meta-box-saves.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
21
  {
@@ -40,7 +40,7 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
40
  */
41
  public static function save_meta_boxes ($post_id = FALSE)
42
  {
43
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
44
  do_action ("ws_plugin__s2member_before_save_meta_boxes", get_defined_vars ());
45
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
46
  /**/
@@ -54,23 +54,26 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
54
  {
55
  if ($_p["post_type"] === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
56
  {
57
- if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
58
  {
59
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
60
  $pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
61
  /**/
 
 
 
62
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
63
  if (($i = array_search ($page_id, $pages[$n])) !== false)
64
- unset ($pages[$n][$i]);
65
  /**/
66
  if (isset ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]))
67
- if ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
68
- array_push ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]], $page_id);
69
  /**/
70
  for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
71
  $new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_pages" => trim (implode (",", $pages[$n]))));
72
  /**/
73
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
74
  do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
75
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
76
  /**/
@@ -80,23 +83,23 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
80
  /**/
81
  else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
82
  {
83
- if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* Just needs to be set. CAN be empty. */
84
  {
85
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
86
  $posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
87
  /**/
88
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
89
  if (($i = array_search ($post_id, $posts[$n])) !== false)
90
- unset ($posts[$n][$i]);
91
  /**/
92
  if (isset ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
93
- if ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all"))
94
- array_push ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]], $post_id);
95
  /**/
96
  for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
97
  $new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_posts" => trim (implode (",", $posts[$n]))));
98
  /**/
99
- eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
100
  do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
101
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
102
  /**/
@@ -106,10 +109,10 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
106
  /**/
107
  if ($_p["post_type"] === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
108
  {
109
- if (isset ($_p["ws_plugin__s2member_security_meta_box_ccaps"])) /* Just needs to be set. CAN be empty. */
110
  {
111
  $ccaps_req = trim (strtolower ($_p["ws_plugin__s2member_security_meta_box_ccaps"]), ",");
112
- $ccaps_req = trim (preg_replace ("/[^a-z_0-9,]/", "", $ccaps_req), ","); /* Now clean up. */
113
  /**/
114
  if (strlen ($ccaps_req) && ($s2member_ccaps_req = preg_split ("/[\r\n\t\s;,]+/", $ccaps_req)))
115
  update_post_meta ($page_id, "s2member_ccaps_req", $s2member_ccaps_req);
@@ -121,10 +124,10 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
121
  /**/
122
  else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
123
  {
124
- if (isset ($_p["ws_plugin__s2member_security_meta_box_ccaps"])) /* Just needs to be set. It CAN be empty. */
125
  {
126
  $ccaps_req = trim (strtolower ($_p["ws_plugin__s2member_security_meta_box_ccaps"]), ",");
127
- $ccaps_req = trim (preg_replace ("/[^a-z_0-9,]/", "", $ccaps_req), ","); /* Now clean up. */
128
  /**/
129
  if (strlen ($ccaps_req) && ($s2member_ccaps_req = preg_split ("/[\r\n\t\s;,]+/", $ccaps_req)))
130
  update_post_meta ($post_id, "s2member_ccaps_req", $s2member_ccaps_req);
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_meta_box_saves"))
21
  {
40
  */
41
  public static function save_meta_boxes ($post_id = FALSE)
42
  {
43
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
44
  do_action ("ws_plugin__s2member_before_save_meta_boxes", get_defined_vars ());
45
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
46
  /**/
54
  {
55
  if ($_p["post_type"] === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
56
  {
57
+ if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* CAN be empty. */
58
  {
59
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
60
  $pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
61
  /**/
62
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
63
+ $posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
64
+ /**/
65
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
66
  if (($i = array_search ($page_id, $pages[$n])) !== false)
67
+ unset($pages[$n][$i]);
68
  /**/
69
  if (isset ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]]))
70
+ if ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all")&& !in_array ("all-pages", $posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
71
+ array_push ($pages[$_p["ws_plugin__s2member_security_meta_box_level"]], (string)$page_id);
72
  /**/
73
  for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
74
  $new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_pages" => trim (implode (",", $pages[$n]))));
75
  /**/
76
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
77
  do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
78
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
79
  /**/
83
  /**/
84
  else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
85
  {
86
+ if (isset ($_p["ws_plugin__s2member_security_meta_box_level"])) /* CAN be empty. */
87
  {
88
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
89
  $posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
90
  /**/
91
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
92
  if (($i = array_search ($post_id, $posts[$n])) !== false)
93
+ unset($posts[$n][$i]);
94
  /**/
95
  if (isset ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]) && is_array ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
96
+ if ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]] !== array ("all")&& !in_array ("all-" . $_p["post_type"] . "s", $posts[$_p["ws_plugin__s2member_security_meta_box_level"]]))
97
+ array_push ($posts[$_p["ws_plugin__s2member_security_meta_box_level"]], (string)$post_id);
98
  /**/
99
  for ($n = 0, $new_options = array (); $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
100
  $new_options = array_merge ($new_options, array ("ws_plugin__s2member_level" . $n . "_posts" => trim (implode (",", $posts[$n]))));
101
  /**/
102
+ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
103
  do_action ("ws_plugin__s2member_during_save_meta_boxes", get_defined_vars ());
104
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
105
  /**/
109
  /**/
110
  if ($_p["post_type"] === "page" && ($page_id = $post_id)) /* OK. So we're dealing with a Page classification. */
111
  {
112
+ if (isset ($_p["ws_plugin__s2member_security_meta_box_ccaps"])) /* CAN be empty. */
113
  {
114
  $ccaps_req = trim (strtolower ($_p["ws_plugin__s2member_security_meta_box_ccaps"]), ",");
115
+ $ccaps_req = trim (preg_replace ("/[^a-z_0-9,]/", "", $ccaps_req), ",");
116
  /**/
117
  if (strlen ($ccaps_req) && ($s2member_ccaps_req = preg_split ("/[\r\n\t\s;,]+/", $ccaps_req)))
118
  update_post_meta ($page_id, "s2member_ccaps_req", $s2member_ccaps_req);
124
  /**/
125
  else /* Otherwise, we assume this is a Post, or possibly a Custom Post Type. It's NOT a Page. */
126
  {
127
+ if (isset ($_p["ws_plugin__s2member_security_meta_box_ccaps"])) /* CAN be empty. */
128
  {
129
  $ccaps_req = trim (strtolower ($_p["ws_plugin__s2member_security_meta_box_ccaps"]), ",");
130
+ $ccaps_req = trim (preg_replace ("/[^a-z_0-9,]/", "", $ccaps_req), ",");
131
  /**/
132
  if (strlen ($ccaps_req) && ($s2member_ccaps_req = preg_split ("/[\r\n\t\s;,]+/", $ccaps_req)))
133
  update_post_meta ($post_id, "s2member_ccaps_req", $s2member_ccaps_req);
includes/classes/meta-box-security.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
21
  {
@@ -38,7 +38,7 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
38
  */
39
  public static function security_meta_box ($post = FALSE)
40
  {
41
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
42
  do_action ("ws_plugin__s2member_before_security_meta_box", get_defined_vars ());
43
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
44
  /**/
@@ -54,13 +54,20 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
54
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
55
  $pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
56
  /**/
 
 
 
57
  echo '<p style="margin-left:2px;"><strong>Page Level Restriction?</strong></p>' . "\n";
58
  echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
59
  echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
60
  echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
61
  /**/
62
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
63
- echo ($pages[$n] !== array ("all")) ? '<option value="' . $n . '"' . ((in_array ($page_id, $pages[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n" : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Pages )</option>' . "\n";
 
 
 
 
64
  /**/
65
  echo '</select><br /><small>* see: <code>General Options -> Page Level Access</code></small>' . "\n";
66
  /**/
@@ -102,7 +109,11 @@ if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
102
  echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
103
  /**/
104
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
105
- echo ($posts[$n] !== array ("all")) ? '<option value="' . $n . '"' . ((in_array ($post_id, $posts[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n" : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Posts )</option>' . "\n";
 
 
 
 
106
  /**/
107
  echo '</select><br /><small>* see: <code>General Options -> Post Level Access</code></small>' . "\n";
108
  /**/
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_meta_box_security"))
21
  {
38
  */
39
  public static function security_meta_box ($post = FALSE)
40
  {
41
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
42
  do_action ("ws_plugin__s2member_before_security_meta_box", get_defined_vars ());
43
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
44
  /**/
54
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
55
  $pages[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
56
  /**/
57
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
58
+ $posts[$n] = array_unique (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
59
+ /**/
60
  echo '<p style="margin-left:2px;"><strong>Page Level Restriction?</strong></p>' . "\n";
61
  echo '<label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>' . "\n";
62
  echo '<select name="ws_plugin__s2member_security_meta_box_level" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">' . "\n";
63
  echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
64
  /**/
65
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
66
+ echo ($pages[$n] !== array ("all")) ? /* Protecting `all` Pages, of any kind? */
67
+ ((!in_array ("all-pages", $posts[$n])) /* Protecting Posts of type: `page` ( i.e. `all-pages` )? */
68
+ ? '<option value="' . $n . '"' . ((in_array ($page_id, $pages[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n"/**/
69
+ : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Posts of this type )</option>' . "\n")/**/
70
+ : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Pages )</option>' . "\n";
71
  /**/
72
  echo '</select><br /><small>* see: <code>General Options -> Page Level Access</code></small>' . "\n";
73
  /**/
109
  echo '<option value=""></option>' . "\n"; /* By default, we allow public access to any Post/Page. */
110
  /**/
111
  for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
112
+ echo ($posts[$n] !== array ("all")) ? /* Protecting `all` Posts, of any kind? */
113
+ ((!in_array ("all-" . $post->post_type . "s", $posts[$n])) /* Protecting Posts `all-[of-this-type]` ( don't forget plural `s` )? */
114
+ ? '<option value="' . $n . '"' . ((in_array ($post_id, $posts[$n])) ? ' selected="selected"' : '') . '>' . (($n === $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]) ? 'Require Highest Level #' . $n : 'Require Level #' . $n . ' ( or higher )') . '</option>' . "\n"/**/
115
+ : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Posts of this type )</option>' . "\n")/**/
116
+ : '<option value="" disabled="disabled">Level #' . $n . ' ( already protects "all" Posts )</option>' . "\n";
117
  /**/
118
  echo '</select><br /><small>* see: <code>General Options -> Post Level Access</code></small>' . "\n";
119
  /**/
includes/classes/mo-page-in.inc.php CHANGED
@@ -33,32 +33,73 @@ if (!class_exists ("c_ws_plugin__s2member_mo_page_in"))
33
  * This can be used by 3rd party apps that are not aware of which Page is currently set as the Membership Options Page.
34
  * Example usage: `http://example.com/?s2member_membership_options_page=1`
35
  *
 
 
 
 
36
  * @package s2Member\Membership_Options_Page
37
  * @since 3.5
38
  *
39
  * @attaches-to: ``add_action("init");``
40
  *
41
- * @return null Or exits script execution after redirection.
42
  */
43
- public static function membership_options_page ()
44
  {
45
  do_action ("ws_plugin__s2member_before_membership_options_page", get_defined_vars ());
46
  /**/
47
- if (!empty ($_GET["s2member_membership_options_page"])) /* An incoming request? */
48
  {
49
- $query_args = array (); /* Initialize array. */
50
- foreach ($_GET as $var => $val) /* Include any s2member_ vars. */
51
- if (preg_match ("/^s2member_/", $var) && $var !== "s2member_membership_options_page")
52
- $query_args[$var] = $val;
53
- /* Do NOT include `s2member_membership_options_page` as that could create a redirect loop. */
54
  /**/
55
- wp_redirect (add_query_arg (urlencode_deep ($query_args), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), 301);
 
 
 
56
  /**/
57
- exit (); /* Clean exit. */
58
  }
59
  /**/
60
  do_action ("ws_plugin__s2member_after_membership_options_page", get_defined_vars ());
61
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
  }
64
  ?>
33
  * This can be used by 3rd party apps that are not aware of which Page is currently set as the Membership Options Page.
34
  * Example usage: `http://example.com/?s2member_membership_options_page=1`
35
  *
36
+ * Redirection URLs containing array brackets MUST be URL encoded to get through: ``wp_sanitize_redirect()``.
37
+ * So we pass everything to ``urlencode_deep()``, as an array. It handles this via ``_http_build_query()``.
38
+ * See bug report here: {@link http://core.trac.wordpress.org/ticket/17052}
39
+ *
40
  * @package s2Member\Membership_Options_Page
41
  * @since 3.5
42
  *
43
  * @attaches-to: ``add_action("init");``
44
  *
45
+ * @return null Or exits script execution after redirection w/ `301` status.
46
  */
47
+ public static function /* Real Membership Options Page. */ membership_options_page ()
48
  {
49
  do_action ("ws_plugin__s2member_before_membership_options_page", get_defined_vars ());
50
  /**/
51
+ if (!empty ($_GET["s2member_membership_options_page"]) && is_array ($_g = c_ws_plugin__s2member_utils_strings::trim_deep (stripslashes_deep ($_GET))))
52
  {
53
+ $args = /* Initialize this to an empty array value. */ array ();
 
 
 
 
54
  /**/
55
+ foreach ($_g as $var => $value) /* Include all of the `_?s2member_` variables. */
56
+ /* Do NOT include `s2member_membership_options_page`; creates a redirection loop. */
57
+ if (preg_match ("/^_?s2member_/", $var) && $var !== "s2member_membership_options_page")
58
+ $args[$var] = /* Supports nested arrays. */ $value;
59
  /**/
60
+ wp_redirect (add_query_arg (urlencode_deep ($args), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), 301) . exit ();
61
  }
62
  /**/
63
  do_action ("ws_plugin__s2member_after_membership_options_page", get_defined_vars ());
64
  }
65
+ /**
66
+ * Redirects to Membership Options Page w/ MOP Vars.
67
+ *
68
+ * Redirection URLs containing array brackets MUST be URL encoded to get through: ``wp_sanitize_redirect()``.
69
+ * So we pass everything to ``urlencode_deep()``, as an array. It handles this via ``_http_build_query()``.
70
+ * See bug report here: {@link http://core.trac.wordpress.org/ticket/17052}
71
+ *
72
+ * @package s2Member\Membership_Options_Page
73
+ * @since 111101
74
+ *
75
+ * @param str $seeking_type Seeking content type. One of: `post|page|catg|ptag|file|ruri`.
76
+ * @param str|int $seeking_type_value Seeking content type data. String, or a Post/Page ID.
77
+ * @param str $req_type Access requirement type. One of these values: `level|ccap|sp`.
78
+ * @param str|int $req_type_value Access requirement. String, or a Post/Page ID.
79
+ * @param str $seeking_uri The full URI that access was attempted on.
80
+ * @param str $res_type Restriction type that's preventing access.
81
+ * One of: `post|page|catg|ptag|file|ruri|ccap|sp|sys`.
82
+ * Defaults to ``$seeking_type``.
83
+ * @return bool This function always returns true.
84
+ */
85
+ public static function wp_redirect_w_mop_vars ($seeking_type = FALSE, $seeking_type_value = FALSE, $req_type = FALSE, $req_type_value = FALSE, $seeking_uri = FALSE, $res_type = FALSE)
86
+ {
87
+ do_action ("ws_plugin__s2member_before_wp_redirect_w_mop_vars", get_defined_vars ());
88
+ /**/
89
+ $status = /* Allow Filters. Defaults to `301`. */ apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ());
90
+ $status = /* Allow Filters. Defaults to `301`. */ apply_filters ("ws_plugin__s2member_wp_redirect_w_mop_vars_status", $status, get_defined_vars ());
91
+ /**/
92
+ $seeking_uri = (strlen ((string)$seeking_uri) /* URIs are base64 encoded. */) ? base64_encode ((string)$seeking_uri) : (string)$seeking_uri;
93
+ $seeking_type_value = ((string)$seeking_type /* URIs are base64 encoded. */ === "ruri") ? base64_encode ((string)$seeking_type_value) : (string)$seeking_type_value;
94
+ /**/
95
+ $res_type = (!(string)$res_type) ? /* Restriction type preventing access. Defaults to ``$seeking_type`` if NOT passed in explicitly. */ (string)$seeking_type : (string)$res_type;
96
+ /**/
97
+ wp_redirect (add_query_arg (urlencode_deep (array ("_s2member_seeking" => array ("type" => (string)$seeking_type, urlencode ((string)$seeking_type)=> (string)$seeking_type_value, "_uri" => (string)$seeking_uri), "_s2member_req" => array ("type" => (string)$req_type, urlencode ((string)$req_type)=> (string)$req_type_value), "_s2member_res" => array ("type" => (string)$res_type), "s2member_seeking" => (string)$seeking_type . "-" . (string)$seeking_type_value, "s2member_" . urlencode ((string)$req_type) . "_req" => (string)$req_type_value)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), $status);
98
+ /**/
99
+ do_action ("ws_plugin__s2member_after_wp_redirect_w_mop_vars", get_defined_vars ());
100
+ /**/
101
+ return true; /* Always returns true here. */
102
+ }
103
  }
104
  }
105
  ?>
includes/classes/mo-page.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_mo_page"))
21
  {
@@ -47,6 +47,26 @@ if (!class_exists ("c_ws_plugin__s2member_mo_page"))
47
  return c_ws_plugin__s2member_mo_page_in::membership_options_page ();
48
  }
49
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
  }
52
  ?>
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_mo_page"))
21
  {
47
  return c_ws_plugin__s2member_mo_page_in::membership_options_page ();
48
  }
49
  }
50
+ /**
51
+ * Redirects to Membership Options Page w/ MOP Vars.
52
+ *
53
+ * @package s2Member\Membership_Options_Page
54
+ * @since 111101
55
+ *
56
+ * @param str $seeking_type Seeking content type. One of: `post|page|catg|ptag|file|ruri`.
57
+ * @param str|int $seeking_type_value Seeking content type data. String, or a Post/Page ID.
58
+ * @param str $req_type Access requirement type. One of these values: `level|ccap|sp`.
59
+ * @param str|int $req_type_value Access requirement. String, or a Post/Page ID.
60
+ * @param str $seeking_uri The full URI that access was attempted on.
61
+ * @param str $res_type Restriction type that's preventing access.
62
+ * One of: `post|page|catg|ptag|file|ruri|ccap|sp|sys`.
63
+ * Defaults to ``$seeking_type``.
64
+ * @return inner Return-value of inner routine.
65
+ */
66
+ public static function wp_redirect_w_mop_vars ($seeking_type = FALSE, $seeking_type_value = FALSE, $req_type = FALSE, $req_type_value = FALSE, $seeking_uri = FALSE, $res_type = FALSE)
67
+ {
68
+ return c_ws_plugin__s2member_mo_page_in::wp_redirect_w_mop_vars ($seeking_type, $seeking_type_value, $req_type, $req_type_value, $seeking_uri, $res_type);
69
+ }
70
  }
71
  }
72
  ?>
includes/classes/no-cache.inc.php CHANGED
@@ -157,7 +157,6 @@ if (!class_exists ("c_ws_plugin__s2member_no_cache"))
157
  $no_cache_headers_already_sent = true; /* Yep, sent. */
158
  break; /* Break now, no need to continue any further. */
159
  }
160
- /**/
161
  if (!$no_cache_headers_already_sent) /* Check here. */
162
  nocache_headers (); /* Only if NOT already sent. */
163
  /**/
157
  $no_cache_headers_already_sent = true; /* Yep, sent. */
158
  break; /* Break now, no need to continue any further. */
159
  }
 
160
  if (!$no_cache_headers_already_sent) /* Check here. */
161
  nocache_headers (); /* Only if NOT already sent. */
162
  /**/
includes/classes/pages-sp.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_pages_sp"))
21
  {
@@ -36,6 +36,8 @@ if (!class_exists ("c_ws_plugin__s2member_pages_sp"))
36
  * @param int|str $page_id Numeric Page ID.
37
  * @param bool $check_user Test permissions against the current User? Defaults to true.
38
  * @return null|array Non-empty array ( with details ) if access is denied, else null if access is allowed.
 
 
39
  */
40
  public static function check_specific_page_level_access ($page_id = FALSE, $check_user = TRUE)
41
  {
@@ -67,6 +69,9 @@ if (!class_exists ("c_ws_plugin__s2member_pages_sp"))
67
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] === "all" && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
68
  return apply_filters ("ws_plugin__s2member_check_specific_page_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
69
  /**/
 
 
 
70
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"])) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
71
  return apply_filters ("ws_plugin__s2member_check_specific_page_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
72
  }
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_pages_sp"))
21
  {
36
  * @param int|str $page_id Numeric Page ID.
37
  * @param bool $check_user Test permissions against the current User? Defaults to true.
38
  * @return null|array Non-empty array ( with details ) if access is denied, else null if access is allowed.
39
+ *
40
+ * @todo Provide more information in the return array ( like MOP Vars ).
41
  */
42
  public static function check_specific_page_level_access ($page_id = FALSE, $check_user = TRUE)
43
  {
69
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] === "all" && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
70
  return apply_filters ("ws_plugin__s2member_check_specific_page_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
71
  /**/
72
+ else if (strpos ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"], "all-") !== false && in_array ("all-pages", preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
73
+ return apply_filters ("ws_plugin__s2member_check_specific_page_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
74
+ /**/
75
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"])) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
76
  return apply_filters ("ws_plugin__s2member_check_specific_page_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
77
  }
includes/classes/pages.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_pages"))
21
  {
@@ -43,30 +43,33 @@ if (!class_exists ("c_ws_plugin__s2member_pages"))
43
  /**/
44
  $excluded = apply_filters ("ws_plugin__s2member_check_page_level_access_excluded", false, get_defined_vars ());
45
  /**/
46
- if (!$excluded && is_page () && is_object ($post) && ($page_id = (int)$post->ID) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
47
  {
48
  if (!c_ws_plugin__s2member_systematics::is_wp_systematic_use_page ()) /* Do NOT touch WordPress® Systematics. This excludes all WordPress® Systematics. */
49
  {
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_id === (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")) && $page_id !== (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
53
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
54
  /**/
55
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")) && $page_id !== (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
56
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
57
  /**/
58
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $page_id === (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")) && $page_id !== (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
59
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
60
  /**/
61
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Never restrict Systematics. However, there are 3 exceptions above. */
62
  {
63
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Page Level restrictions. Go through each Level. */
64
  {
65
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
66
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
 
 
 
67
  /**/
68
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
69
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
70
  }
71
  /**/
72
  if (has_tag ()) /* Here we take a look to see if this Page has any Tags. If so, we need to run the full set of routines against Tags also. */
@@ -74,10 +77,10 @@ if (!class_exists ("c_ws_plugin__s2member_pages"))
74
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Tag Level restrictions ( possibly through Page Tagger ). Go through each Level. */
75
  {
76
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
77
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
78
  /**/
79
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
80
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
81
  }
82
  }
83
  /**/
@@ -87,18 +90,18 @@ if (!class_exists ("c_ws_plugin__s2member_pages"))
87
  /**/
88
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
89
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
90
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
91
  }
92
  /**/
93
  if (is_array ($ccaps_req = get_post_meta ($page_id, "s2member_ccaps_req", true)) && !empty ($ccaps_req) && c_ws_plugin__s2member_no_cache::no_cache_constants (true))
94
  {
95
- foreach ($ccaps_req as $ccap) /* The ``$user`` MUST satisfy ALL Custom Capability requirements. Stored as a serialized array. */
96
- if (strlen ($ccap) && (!$user || !$user->has_cap ("access_s2member_ccap_" . $ccap)))
97
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_ccap_req" => $ccap)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
98
  }
99
  /**/
100
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && !c_ws_plugin__s2member_sp_access::sp_access ($page_id))
101
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "page-" . $page_id, "s2member_sp_req" => $page_id)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
102
  }
103
  /**/
104
  do_action ("ws_plugin__s2member_during_check_page_level_access", get_defined_vars ());
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_pages"))
21
  {
43
  /**/
44
  $excluded = apply_filters ("ws_plugin__s2member_check_page_level_access_excluded", false, get_defined_vars ());
45
  /**/
46
+ if (!$excluded && is_page () && is_object ($post) && !empty ($post->ID) && ($page_id = (int)$post->ID) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
47
  {
48
  if (!c_ws_plugin__s2member_systematics::is_wp_systematic_use_page ()) /* Do NOT touch WordPress® Systematics. This excludes all WordPress® Systematics. */
49
  {
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && $page_id === (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"] && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")) && $page_id !== (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
53
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", 0, $_SERVER["REQUEST_URI"], "sys") . exit ();
54
  /**/
55
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")) && $page_id !== (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
56
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", 0, $_SERVER["REQUEST_URI"], "sys") . exit ();
57
  /**/
58
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && $page_id === (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"] && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")) && $page_id !== (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
59
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", 0, $_SERVER["REQUEST_URI"], "sys") . exit ();
60
  /**/
61
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Never restrict Systematics. However, there are 3 exceptions above. */
62
  {
63
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Page Level restrictions. Go through each Level. */
64
  {
65
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
66
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
67
+ /**/
68
+ else if (strpos ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"], "all-") && in_array ("all-pages", preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
69
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", $n, $_SERVER["REQUEST_URI"], "post") . exit ();
70
  /**/
71
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
72
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
73
  }
74
  /**/
75
  if (has_tag ()) /* Here we take a look to see if this Page has any Tags. If so, we need to run the full set of routines against Tags also. */
77
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Tag Level restrictions ( possibly through Page Tagger ). Go through each Level. */
78
  {
79
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
80
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", $n, $_SERVER["REQUEST_URI"], "ptag") . exit ();
81
  /**/
82
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
83
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", $n, $_SERVER["REQUEST_URI"], "ptag") . exit ();
84
  }
85
  }
86
  /**/
90
  /**/
91
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
92
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
93
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "level", $n, $_SERVER["REQUEST_URI"], "ruri") . exit ();
94
  }
95
  /**/
96
  if (is_array ($ccaps_req = get_post_meta ($page_id, "s2member_ccaps_req", true)) && !empty ($ccaps_req) && c_ws_plugin__s2member_no_cache::no_cache_constants (true))
97
  {
98
+ foreach ($ccaps_req as $ccap) /* The ``$user`` MUST satisfy ALL Custom Capability requirements. Stored as an array of Custom Capabilities. */
99
+ if (strlen ($ccap) && (!$user || !$user->has_cap ("access_s2member_ccap_" . $ccap)) /* Does this ``$user``, have this Custom Capability? */)
100
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "ccap", $ccap, $_SERVER["REQUEST_URI"], "ccap") . exit ();
101
  }
102
  /**/
103
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($page_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && !c_ws_plugin__s2member_sp_access::sp_access ($page_id))
104
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("page", $page_id, "sp", $page_id, $_SERVER["REQUEST_URI"], "sp") . exit ();
105
  }
106
  /**/
107
  do_action ("ws_plugin__s2member_during_check_page_level_access", get_defined_vars ());
includes/classes/posts-sp.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_posts_sp"))
21
  {
@@ -61,6 +61,9 @@ if (!class_exists ("c_ws_plugin__s2member_posts_sp"))
61
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] === "all" && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
62
  return apply_filters ("ws_plugin__s2member_check_specific_post_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
63
  /**/
 
 
 
64
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
65
  return apply_filters ("ws_plugin__s2member_check_specific_post_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
66
  }
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_posts_sp"))
21
  {
61
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] === "all" && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
62
  return apply_filters ("ws_plugin__s2member_check_specific_post_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
63
  /**/
64
+ else if (strpos ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"], "all-") !== false && ($post_type = get_post_type ($post_id)) && in_array ("all-" . $post_type . "s", preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
65
+ return apply_filters ("ws_plugin__s2member_check_specific_post_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
66
+ /**/
67
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && (!$check_user || !$user || !$user->has_cap ("access_s2member_level" . $n)))
68
  return apply_filters ("ws_plugin__s2member_check_specific_post_level_access", array ("s2member_level_req" => $n), get_defined_vars ());
69
  }
includes/classes/posts.inc.php CHANGED
@@ -43,33 +43,36 @@ if (!class_exists ("c_ws_plugin__s2member_posts"))
43
  /**/
44
  $excluded = apply_filters ("ws_plugin__s2member_check_post_level_access_excluded", false, get_defined_vars ());
45
  /**/
46
- if (!$excluded && is_single () && is_object ($post) && ($post_id = (int)$post->ID) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
47
  {
48
  if (!c_ws_plugin__s2member_systematics::is_wp_systematic_use_page ()) /* Do NOT touch WordPress® Systematics. This excludes all WordPress® Systematics. */
49
  {
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
53
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
54
  /**/
55
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above. */
56
  {
57
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Post Level restrictions ( including Custom Post Types ). Go through each Level. */
58
  {
59
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
60
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
 
 
 
61
  /**/
62
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
63
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
64
  }
65
  /**/
66
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Category Level restrictions. Go through each Level. */
67
  {
68
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
69
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
70
  /**/
71
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] && (in_category (($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"])), $post_id) || c_ws_plugin__s2member_utils_conds::in_descendant_category ($catgs, $post_id)) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
72
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
73
  }
74
  /**/
75
  if (has_tag ()) /* Here we take a look to see if this Post has any Tags. If so, we need to run the full set of routines against Tags also. */
@@ -77,10 +80,10 @@ if (!class_exists ("c_ws_plugin__s2member_posts"))
77
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Tag Level restrictions. Go through each Level. */
78
  {
79
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
80
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
81
  /**/
82
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
83
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
84
  }
85
  }
86
  /**/
@@ -90,18 +93,18 @@ if (!class_exists ("c_ws_plugin__s2member_posts"))
90
  /**/
91
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
92
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
93
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
94
  }
95
  /**/
96
  if (is_array ($ccaps_req = get_post_meta ($post_id, "s2member_ccaps_req", true)) && !empty ($ccaps_req) && c_ws_plugin__s2member_no_cache::no_cache_constants (true))
97
  {
98
- foreach ($ccaps_req as $ccap) /* The ``$user`` MUST satisfy ALL Custom Capability requirements. Stored as a serialized array. */
99
- if (strlen ($ccap) && (!$user || !$user->has_cap ("access_s2member_ccap_" . $ccap)))
100
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_ccap_req" => $ccap)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
101
  }
102
  /**/
103
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && !c_ws_plugin__s2member_sp_access::sp_access ($post_id))
104
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "post-" . $post_id, "s2member_sp_req" => $post_id)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
105
  }
106
  /**/
107
  do_action ("ws_plugin__s2member_during_check_post_level_access", get_defined_vars ());
43
  /**/
44
  $excluded = apply_filters ("ws_plugin__s2member_check_post_level_access_excluded", false, get_defined_vars ());
45
  /**/
46
+ if (!$excluded && is_single () && is_object ($post) && !empty ($post->ID) && ($post_id = (int)$post->ID) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
47
  {
48
  if (!c_ws_plugin__s2member_systematics::is_wp_systematic_use_page ()) /* Do NOT touch WordPress® Systematics. This excludes all WordPress® Systematics. */
49
  {
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
53
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", 0, $_SERVER["REQUEST_URI"], "sys") . exit ();
54
  /**/
55
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above. */
56
  {
57
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Post Level restrictions ( including Custom Post Types ). Go through each Level. */
58
  {
59
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
60
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
61
+ /**/
62
+ else if (strpos ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"], "all-") !== false && in_array ("all-" . $post->post_type . "s", preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
63
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
64
  /**/
65
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
66
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
67
  }
68
  /**/
69
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Category Level restrictions. Go through each Level. */
70
  {
71
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
72
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"], "catg") . exit ();
73
  /**/
74
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] && (in_category (($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"])), $post_id) || c_ws_plugin__s2member_utils_conds::in_descendant_category ($catgs, $post_id)) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
75
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"], "catg") . exit ();
76
  }
77
  /**/
78
  if (has_tag ()) /* Here we take a look to see if this Post has any Tags. If so, we need to run the full set of routines against Tags also. */
80
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Tag Level restrictions. Go through each Level. */
81
  {
82
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
83
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"], "ptag") . exit ();
84
  /**/
85
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && has_tag (preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
86
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"], "ptag") . exit ();
87
  }
88
  }
89
  /**/
93
  /**/
94
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
95
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
96
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "level", $n, $_SERVER["REQUEST_URI"], "ruri") . exit ();
97
  }
98
  /**/
99
  if (is_array ($ccaps_req = get_post_meta ($post_id, "s2member_ccaps_req", true)) && !empty ($ccaps_req) && c_ws_plugin__s2member_no_cache::no_cache_constants (true))
100
  {
101
+ foreach ($ccaps_req as $ccap) /* The ``$user`` MUST satisfy ALL Custom Capability requirements. Stored as an array of Custom Capabilities. */
102
+ if (strlen ($ccap) && (!$user || !$user->has_cap ("access_s2member_ccap_" . $ccap)) /* Does this ``$user``, have this Custom Capability? */)
103
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "ccap", $ccap, $_SERVER["REQUEST_URI"], "ccap") . exit ();
104
  }
105
  /**/
106
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && in_array ($post_id, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && !c_ws_plugin__s2member_sp_access::sp_access ($post_id))
107
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("post", $post_id, "sp", $post_id, $_SERVER["REQUEST_URI"], "sp") . exit ();
108
  }
109
  /**/
110
  do_action ("ws_plugin__s2member_during_check_post_level_access", get_defined_vars ());
includes/classes/ptags.inc.php CHANGED
@@ -43,24 +43,24 @@ if (!class_exists ("c_ws_plugin__s2member_ptags"))
43
  /**/
44
  $excluded = apply_filters ("ws_plugin__s2member_check_ptag_level_access_excluded", false, get_defined_vars ());
45
  /**/
46
- if (!$excluded && is_tag () && is_object ($tag = $wp_query->get_queried_object ()) && ($tag_id = (int)$tag->term_id) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
47
  {
48
  if (!c_ws_plugin__s2member_systematics::is_wp_systematic_use_page ()) /* Do NOT touch WordPress® Systematics. This excludes all WordPress® Systematics. */
49
  {
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
53
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
54
  /**/
55
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above. */
56
  {
57
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Tag Level restrictions. Go through each Level. */
58
  {
59
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
60
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
61
  /**/
62
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && (is_tag ($tags = preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"])) || in_array ($tag_id, $tags)) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
63
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
64
  }
65
  /**/
66
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* URIs. Go through each Level. */
@@ -69,7 +69,7 @@ if (!class_exists ("c_ws_plugin__s2member_ptags"))
69
  /**/
70
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
71
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
72
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ptag-" . $tag_id, "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
73
  }
74
  }
75
  /**/
43
  /**/
44
  $excluded = apply_filters ("ws_plugin__s2member_check_ptag_level_access_excluded", false, get_defined_vars ());
45
  /**/
46
+ if (!$excluded && is_tag () && is_object ($tag = $wp_query->get_queried_object ()) && !empty ($tag->term_id) && ($tag_id = (int)$tag->term_id) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])
47
  {
48
  if (!c_ws_plugin__s2member_systematics::is_wp_systematic_use_page ()) /* Do NOT touch WordPress® Systematics. This excludes all WordPress® Systematics. */
49
  {
50
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
51
  /**/
52
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
53
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("ptag", $tag_id, "level", 0, $_SERVER["REQUEST_URI"], "sys") . exit ();
54
  /**/
55
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above. */
56
  {
57
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Tag Level restrictions. Go through each Level. */
58
  {
59
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] === "all" && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
60
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("ptag", $tag_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
61
  /**/
62
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && (is_tag ($tags = preg_split ("/[\r\n\t;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"])) || in_array ($tag_id, $tags)) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
63
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("ptag", $tag_id, "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
64
  }
65
  /**/
66
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* URIs. Go through each Level. */
69
  /**/
70
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
71
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
72
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("ptag", $tag_id, "level", $n, $_SERVER["REQUEST_URI"], "ruri") . exit ();
73
  }
74
  }
75
  /**/
includes/classes/querys.inc.php CHANGED
@@ -79,11 +79,14 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
79
  * @param bool $force Optional. Defaults to false. If true, we bypass all standard conditions.
80
  * However, s2Member will NEVER bypass `supress_filters`.
81
  * @return null
 
 
 
82
  */
83
  public static function query_level_access (&$wp_query = FALSE, $force = FALSE)
84
  {
85
- global $wpdb; /* Global database object reference. */
86
- static $initial_query = true; /* Tracks initial query. */
87
  c_ws_plugin__s2member_querys::$current_wp_query = &$wp_query;
88
  /**/
89
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
@@ -116,28 +119,28 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
116
  /**/
117
  if ((is_user_logged_in () && is_object ($user = wp_get_current_user ()) && ($user_id = $user->ID)) || !($user = false))
118
  {
119
- if (!$user && ($lwp = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]))
120
  {
121
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), array ($lwp))));
122
- $wp_query->set ("post__not_in", array_unique (array_merge ((array)$wp_query->get ("post__not_in"), array ($lwp))));
123
  }
124
  /**/
125
- if (!$user && ($dep = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))
126
  {
127
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), array ($dep))));
128
- $wp_query->set ("post__not_in", array_unique (array_merge ((array)$wp_query->get ("post__not_in"), array ($dep))));
129
  }
130
  /**/
131
- if (is_array ($ccaps = c_ws_plugin__s2member_utils_gets::get_singular_ids_with_ccaps_req ($user)) && !empty ($ccaps))
132
  {
133
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), $ccaps)));
134
- $wp_query->set ("post__not_in", array_unique (array_merge ((array)$wp_query->get ("post__not_in"), $ccaps)));
135
  }
136
  /**/
137
- if (is_array ($sps = c_ws_plugin__s2member_utils_gets::get_singular_ids_with_sp_req ()) && !empty ($sps))
138
  {
139
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), $sps)));
140
- $wp_query->set ("post__not_in", array_unique (array_merge ((array)$wp_query->get ("post__not_in"), $sps)));
141
  }
142
  /**/
143
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Category Level Restrictions. */
@@ -146,17 +149,19 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
146
  {
147
  $wp_query->set ("category__in", array ()); /* Include no other Categories. */
148
  $wp_query->set ("category__not_in", ($catgs = c_ws_plugin__s2member_utils_gets::get_all_category_ids ()));
149
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($catgs))));
 
150
  break; /* All Categories will be locked down. */
151
  }
152
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
153
  {
154
- foreach (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"]) as $catg)
155
- $catgs = array_merge ((array)$catgs, array ($catg), c_ws_plugin__s2member_utils_gets::get_all_child_category_ids ($catg));
156
  /**/
157
- $wp_query->set ("category__in", array_unique (array_diff ((array)$wp_query->get ("category__in"), $catgs)));
158
- $wp_query->set ("category__not_in", array_unique (array_merge ((array)$wp_query->get ("category__not_in"), $catgs)));
159
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($catgs))));
 
160
  }
161
  }
162
  /**/
@@ -166,16 +171,18 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
166
  {
167
  $wp_query->set ("tag__in", array ()); /* Include no other Tags. */
168
  $wp_query->set ("tag__not_in", ($tags = c_ws_plugin__s2member_utils_gets::get_all_tag_ids ()));
169
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($tags))));
 
170
  break; /* ALL Tags will be locked down. */
171
  }
172
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
173
  {
174
- $tags = c_ws_plugin__s2member_utils_gets::convert_tags_2_ids ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"]);
175
  /**/
176
- $wp_query->set ("tag__in", array_unique (array_diff ((array)$wp_query->get ("tag__in"), $tags)));
177
- $wp_query->set ("tag__not_in", array_unique (array_merge ((array)$wp_query->get ("tag__not_in"), $tags)));
178
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($tags))));
 
179
  }
180
  }
181
  /**/
@@ -189,10 +196,16 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
189
  }
190
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
191
  {
192
- $posts = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]);
 
 
 
 
 
 
193
  /**/
194
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), $posts)));
195
- $wp_query->set ("post__not_in", array_unique (array_merge ((array)$wp_query->get ("post__not_in"), $posts)));
196
  }
197
  }
198
  /**/
@@ -206,10 +219,10 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
206
  }
207
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
208
  {
209
- $pages = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]);
210
  /**/
211
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), $pages)));
212
- $wp_query->set ("post__not_in", array_unique (array_merge ((array)$wp_query->get ("post__not_in"), $pages)));
213
  }
214
  }
215
  }
@@ -243,7 +256,7 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
243
  */
244
  public static function _query_level_access_sys (&$wp_query = FALSE)
245
  {
246
- global $wpdb; /* Global database object reference. */
247
  /**/
248
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
249
  do_action ("_ws_plugin__s2member_before_query_level_access_sys", get_defined_vars ());
@@ -252,10 +265,11 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
252
  if (is_object ($wpdb) && is_object ($wp_query) && !($suppressing_filters = $wp_query->get ("suppress_filters")))
253
  if ((!is_admin () && ($wp_query->is_search () || $wp_query->is_feed ())) || c_ws_plugin__s2member_querys::_is_admin_ajax_search ($wp_query))
254
  {
255
- $s = array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
 
256
  /**/
257
- $wp_query->set ("post__in", array_unique (array_diff ((array)$wp_query->get ("post__in"), $s)));
258
- $wp_query->set ("post__not_in", array_unique (array_merge ((array)$wp_query->get ("post__not_in"), $s)));
259
  /**/
260
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
261
  do_action ("_ws_plugin__s2member_during_query_level_access_sys", get_defined_vars ());
@@ -281,27 +295,24 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
281
  */
282
  public static function _query_level_access_navs ($items = FALSE)
283
  {
284
- global $wpdb; /* Global database object reference. */
285
  $wp_query = &c_ws_plugin__s2member_querys::$current_wp_query;
286
  /**/
287
- if (is_array ($items) && is_object ($wpdb) && is_object ($wp_query) && $wp_query->get ("suppress_filters") !== "n/a")
288
  {
289
- $objs = array_merge ((array)$wp_query->get ("post__not_in"));
290
- $objs = array_unique (array_merge ($objs, (array)$wp_query->get ("tag__not_in")));
291
- $objs = array_unique (array_merge ($objs, (array)$wp_query->get ("category__not_in")));
292
  /**/
293
- foreach ($items as $item_key => $item) /* Filter through all nav menu items. */
294
- if (isset ($item->ID, $item->object_id) && /* And NOT defaulted to the item `ID`. */ (int)$item->ID !== (int)$item->object_id)
295
- if (in_array ($item->object_id, $objs)) /* If it is protected by query Filters, we need to remove it. */
296
  {
297
- foreach ($items as $child_item_key => $child_item)
298
  if (!empty ($child_item->menu_item_parent) && (int)$child_item->menu_item_parent === (int)$item->ID)
299
- unset($items[$child_item_key]);
300
- /**/
301
- unset($items[$item_key]);
302
  }
303
  }
304
- /**/
305
  remove_filter ("wp_get_nav_menu_items", "c_ws_plugin__s2member_querys::_query_level_access_navs", 100);
306
  return apply_filters ("_ws_plugin__s2member_query_level_access_navs", $items, get_defined_vars ());
307
  }
@@ -319,16 +330,17 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
319
  */
320
  public static function _query_level_access_coms ($cwhere = FALSE, &$wp_query = FALSE)
321
  {
322
- global $wpdb; /* Global database object reference. */
323
  /**/
324
  if (is_string ($cwhere) && is_object ($wpdb) && is_object ($wp_query) && !$wp_query->get ("suppress_filters"))
325
  {
326
- $terms = array_unique (array_merge ((array)$wp_query->get ("category__not_in"), (array)$wp_query->get ("tag__not_in")));
 
 
327
  /**/
328
  $cwhere .= " AND `" . $wpdb->comments . "`.`comment_post_ID` NOT IN('" . implode ("','", (array)$wp_query->get ("post__not_in")) . "')";
329
- $cwhere .= " AND `" . $wpdb->comments . "`.`comment_post_ID` NOT IN('" . implode ("','", c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($terms)) . "')";
330
  }
331
- /**/
332
  remove_filter ("comment_feed_where", "c_ws_plugin__s2member_querys::_query_level_access_coms", 100, 2);
333
  return apply_filters ("_ws_plugin__s2member_query_level_access_coms", $cwhere, get_defined_vars ());
334
  }
@@ -343,7 +355,7 @@ if (!class_exists ("c_ws_plugin__s2member_querys"))
343
  */
344
  public static function _is_admin_ajax_search (&$wp_query = FALSE)
345
  {
346
- global $wpdb; /* Global database object reference. */
347
  /**/
348
  if (is_object ($wpdb) && is_object ($wp_query) && is_admin () && $wp_query->is_search ())
349
  if (defined ("DOING_AJAX") && DOING_AJAX && !empty ($_REQUEST["action"]) && (did_action ("wp_ajax_nopriv_" . $_REQUEST["action"]) || did_action ("wp_ajax_" . $_REQUEST["action"])))
79
  * @param bool $force Optional. Defaults to false. If true, we bypass all standard conditions.
80
  * However, s2Member will NEVER bypass `supress_filters`.
81
  * @return null
82
+ *
83
+ * @todo For improved reliability, modify other query vars associated with exclusions/inclusions. Like `tag_slug__in`?
84
+ * See: {@link http://codex.wordpress.org/Class_Reference/WP_Query#Parameters WP_Query#Parameters}
85
  */
86
  public static function query_level_access (&$wp_query = FALSE, $force = FALSE)
87
  {
88
+ global $wpdb; /* Need this global DB object reference here. */
89
+ static $initial_query = true; /* Tracks the initial query. */
90
  c_ws_plugin__s2member_querys::$current_wp_query = &$wp_query;
91
  /**/
92
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
119
  /**/
120
  if ((is_user_logged_in () && is_object ($user = wp_get_current_user ()) && ($user_id = $user->ID)) || !($user = false))
121
  {
122
+ if (!$user && ($lwp = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]))
123
  {
124
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), array ($lwp))));
125
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), array ($lwp))));
126
  }
127
  /**/
128
+ if (!$user && ($dep = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]))
129
  {
130
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), array ($dep))));
131
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), array ($dep))));
132
  }
133
  /**/
134
+ if (is_array ($ccaps = c_ws_plugin__s2member_utils_gets::get_unavailable_singular_ids_with_ccaps ($user)) && !empty ($ccaps))
135
  {
136
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $ccaps)));
137
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), $ccaps)));
138
  }
139
  /**/
140
+ if (is_array ($sps = c_ws_plugin__s2member_utils_gets::get_unavailable_singular_ids_with_sp ()) && !empty ($sps))
141
  {
142
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $sps)));
143
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), $sps)));
144
  }
145
  /**/
146
  for ($n = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n >= 0; $n--) /* Category Level Restrictions. */
149
  {
150
  $wp_query->set ("category__in", array ()); /* Include no other Categories. */
151
  $wp_query->set ("category__not_in", ($catgs = c_ws_plugin__s2member_utils_gets::get_all_category_ids ()));
152
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), ($singulars = c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($catgs)))));
153
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $singulars)));
154
  break; /* All Categories will be locked down. */
155
  }
156
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
157
  {
158
+ foreach (($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"])) as $catg)
159
+ $catgs = array_merge ($catgs, c_ws_plugin__s2member_utils_gets::get_all_child_category_ids ($catg));
160
  /**/
161
+ $wp_query->set ("category__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("category__in")), $catgs)));
162
+ $wp_query->set ("category__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("category__not_in")), $catgs)));
163
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), ($singulars = c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($catgs)))));
164
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $singulars)));
165
  }
166
  }
167
  /**/
171
  {
172
  $wp_query->set ("tag__in", array ()); /* Include no other Tags. */
173
  $wp_query->set ("tag__not_in", ($tags = c_ws_plugin__s2member_utils_gets::get_all_tag_ids ()));
174
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), ($singulars = c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($tags)))));
175
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $singulars)));
176
  break; /* ALL Tags will be locked down. */
177
  }
178
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
179
  {
180
+ $tags = c_ws_plugin__s2member_utils_gets::get_tags_converted_to_ids ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"]);
181
  /**/
182
+ $wp_query->set ("tag__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("tag__in")), $tags)));
183
+ $wp_query->set ("tag__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("tag__not_in")), $tags)));
184
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), ($singulars = c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($tags)))));
185
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $singulars)));
186
  }
187
  }
188
  /**/
196
  }
197
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
198
  {
199
+ foreach (($posts = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) as $p)
200
+ if (strpos ($p, "all-") === 0 && preg_match ("/^all-(.+)$/", $p, $m) /* Protecting `all-` of a specific Post Type? */)
201
+ if (is_array ($p_of_type = c_ws_plugin__s2member_utils_gets::get_all_post_ids ($m[1])) && !empty ($p_of_type))
202
+ $posts = array_merge /* Merge all Posts of this Post Type. */ ($posts, $p_of_type);
203
+ unset /* A little housekeeping here. */ ($p, $m, $p_of_type);
204
+ /**/
205
+ $posts = array_unique ( /* Force integers. */c_ws_plugin__s2member_utils_arrays::force_integers ($posts));
206
  /**/
207
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $posts)));
208
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), $posts)));
209
  }
210
  }
211
  /**/
219
  }
220
  else if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] && (!$user || !current_user_can ("access_s2member_level" . $n)))
221
  {
222
+ $pages = c_ws_plugin__s2member_utils_arrays::force_integers (preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
223
  /**/
224
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $pages)));
225
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), $pages)));
226
  }
227
  }
228
  }
256
  */
257
  public static function _query_level_access_sys (&$wp_query = FALSE)
258
  {
259
+ global $wpdb; /* Need this global DB object reference here. */
260
  /**/
261
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
262
  do_action ("_ws_plugin__s2member_before_query_level_access_sys", get_defined_vars ());
265
  if (is_object ($wpdb) && is_object ($wp_query) && !($suppressing_filters = $wp_query->get ("suppress_filters")))
266
  if ((!is_admin () && ($wp_query->is_search () || $wp_query->is_feed ())) || c_ws_plugin__s2member_querys::_is_admin_ajax_search ($wp_query))
267
  {
268
+ $s = $systematics = array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
269
+ $s = $systematics = c_ws_plugin__s2member_utils_arrays::force_integers /* Force integer values here. */ ($s);
270
  /**/
271
+ $wp_query->set ("post__not_in", array_unique (array_merge (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__not_in")), $s)));
272
+ $wp_query->set ("post__in", array_unique (array_diff (c_ws_plugin__s2member_utils_arrays::force_integers ((array)$wp_query->get ("post__in")), $s)));
273
  /**/
274
  eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
275
  do_action ("_ws_plugin__s2member_during_query_level_access_sys", get_defined_vars ());
295
  */
296
  public static function _query_level_access_navs ($items = FALSE)
297
  {
298
+ global $wpdb; /* Need this global DB object reference here. */
299
  $wp_query = &c_ws_plugin__s2member_querys::$current_wp_query;
300
  /**/
301
+ if (is_array ($items) && !empty ($items) && is_object ($wpdb) && is_object ($wp_query) && $wp_query->get ("suppress_filters") !== "n/a")
302
  {
303
+ $x_ids = array_merge ((array)$wp_query->get ("post__not_in"), (array)$wp_query->get ("category__not_in"), (array)$wp_query->get ("tag__not_in"));
304
+ $x_ids = c_ws_plugin__s2member_utils_arrays::force_integers /* Force integer values here. */ ($x_ids);
 
305
  /**/
306
+ foreach ($items as $key => $item) /* Filter through all navigational menu ``$items``. We may need to exclude some of them. */
307
+ if (isset ($item->ID, $item->object_id) && /* And NOT defaulted to the ``$item->ID``. */ (int)$item->ID !== (int)$item->object_id)
308
+ if (in_array ($item->object_id, $x_ids)) /* If it is protected by query Filters, we need to exclude it. */
309
  {
310
+ foreach ($items as $child_key => $child_item /* Loop back through all ``$items``, looking for children. */)
311
  if (!empty ($child_item->menu_item_parent) && (int)$child_item->menu_item_parent === (int)$item->ID)
312
+ unset /* Remove this ``$child_item``, belonging to an excluded parent. */($items[$child_key]);
313
+ unset /* Exclude the parent ``$item`` now. */($items[$key]);
 
314
  }
315
  }
 
316
  remove_filter ("wp_get_nav_menu_items", "c_ws_plugin__s2member_querys::_query_level_access_navs", 100);
317
  return apply_filters ("_ws_plugin__s2member_query_level_access_navs", $items, get_defined_vars ());
318
  }
330
  */
331
  public static function _query_level_access_coms ($cwhere = FALSE, &$wp_query = FALSE)
332
  {
333
+ global $wpdb; /* Need this global DB object reference here. */
334
  /**/
335
  if (is_string ($cwhere) && is_object ($wpdb) && is_object ($wp_query) && !$wp_query->get ("suppress_filters"))
336
  {
337
+ $x_terms = array_merge ((array)$wp_query->get ("category__not_in"), (array)$wp_query->get ("tag__not_in"));
338
+ $x_terms = array_unique (c_ws_plugin__s2member_utils_arrays::force_integers /* Force integer values here. */ ($x_terms));
339
+ $x_singulars = /* Singulars. */ c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($x_terms);
340
  /**/
341
  $cwhere .= " AND `" . $wpdb->comments . "`.`comment_post_ID` NOT IN('" . implode ("','", (array)$wp_query->get ("post__not_in")) . "')";
342
+ $cwhere .= " AND `" . $wpdb->comments . "`.`comment_post_ID` NOT IN('" . implode ("','", $x_singulars) . "')";
343
  }
 
344
  remove_filter ("comment_feed_where", "c_ws_plugin__s2member_querys::_query_level_access_coms", 100, 2);
345
  return apply_filters ("_ws_plugin__s2member_query_level_access_coms", $cwhere, get_defined_vars ());
346
  }
355
  */
356
  public static function _is_admin_ajax_search (&$wp_query = FALSE)
357
  {
358
+ global $wpdb; /* Need this global DB object reference here. */
359
  /**/
360
  if (is_object ($wpdb) && is_object ($wp_query) && is_admin () && $wp_query->is_search ())
361
  if (defined ("DOING_AJAX") && DOING_AJAX && !empty ($_REQUEST["action"]) && (did_action ("wp_ajax_nopriv_" . $_REQUEST["action"]) || did_action ("wp_ajax_" . $_REQUEST["action"])))
includes/classes/registrations.inc.php CHANGED
@@ -898,7 +898,7 @@ if (!class_exists ("c_ws_plugin__s2member_registrations"))
898
  {
899
  if ($urls = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"])
900
  /**/
901
- foreach (preg_split ("/[\r\n\t]+/", $urls) as $url) /* Notify each of the urls. */
902
  /**/
903
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
904
  if (($url = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($role)), $url)))
898
  {
899
  if ($urls = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["registration_notification_urls"])
900
  /**/
901
+ foreach (preg_split ("/[\r\n\t]+/", $urls) as $url) /* Notify each of the URLs. */
902
  /**/
903
  if (($url = preg_replace ("/%%cv([0-9]+)%%/ei", 'urlencode(trim($cv[$1]))', $url)))
904
  if (($url = preg_replace ("/%%role%%/i", c_ws_plugin__s2member_utils_strings::esc_ds (urlencode ($role)), $url)))
includes/classes/ruris.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_ruris"))
21
  {
@@ -48,7 +48,7 @@ if (!class_exists ("c_ws_plugin__s2member_ruris"))
48
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
49
  /**/
50
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
51
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ruri-" . base64_encode ($_SERVER["REQUEST_URI"]), "s2member_level_req" => "0")), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
52
  /**/
53
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
54
  {
@@ -58,7 +58,7 @@ if (!class_exists ("c_ws_plugin__s2member_ruris"))
58
  /**/
59
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
60
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
61
- wp_redirect (add_query_arg (urlencode_deep (array ("s2member_seeking" => "ruri-" . base64_encode ($_SERVER["REQUEST_URI"]), "s2member_level_req" => $n)), get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"])), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ())) . exit ();
62
  }
63
  }
64
  /**/
@@ -76,20 +76,23 @@ if (!class_exists ("c_ws_plugin__s2member_ruris"))
76
  * @package s2Member\URIs
77
  * @since 3.5
78
  *
 
 
79
  * @return str Collective string of input URIs, with Replacement Codes having been filled.
80
  */
81
  public static function fill_ruri_level_access_rc_vars ($uris = FALSE, $user = FALSE)
82
  {
83
- eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
84
  do_action ("ws_plugin__s2member_before_fill_ruri_level_access_rc_vars", get_defined_vars ());
85
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
86
  /**/
 
87
  $orig_uris = $uris; /* Record the original URIs that were passed in; collectively. */
88
  /**/
89
  $user = ((is_object ($user) || is_object ($user = (is_user_logged_in ()) ? wp_get_current_user () : false)) && !empty ($user->ID)) ? $user : false;
90
  /**/
91
- $user_login = ($user) ? (string)strtolower ($user->user_login) : "";
92
  $user_id = ($user) ? (string)$user->ID : "";
 
93
  /**/
94
  $user_level = (string)c_ws_plugin__s2member_user_access::user_access_level ($user);
95
  $user_role = (string)c_ws_plugin__s2member_user_access::user_access_role ($user);
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_ruris"))
21
  {
48
  $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && !empty ($user->ID)) ? $user : false; /* Current User's object. */
49
  /**/
50
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_redirection_override"] && ($login_redirection_uri = c_ws_plugin__s2member_login_redirects::login_redirection_uri ($user, "root-returns-false")) && preg_match ("/^" . preg_quote ($login_redirection_uri, "/") . "$/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level0")))
51
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("ruri", $_SERVER["REQUEST_URI"], "level", 0, $_SERVER["REQUEST_URI"], "sys") . exit ();
52
  /**/
53
  else if (!c_ws_plugin__s2member_systematics::is_systematic_use_page ()) /* Do NOT protect Systematics. However, there is 1 exception above ^. */
54
  {
58
  /**/
59
  foreach (preg_split ("/[\r\n\t]+/", c_ws_plugin__s2member_ruris::fill_ruri_level_access_rc_vars ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ruris"], $user)) as $str)
60
  if ($str && preg_match ("/" . preg_quote ($str, "/") . "/", $_SERVER["REQUEST_URI"]) && c_ws_plugin__s2member_no_cache::no_cache_constants (true) && (!$user || !$user->has_cap ("access_s2member_level" . $n)))
61
+ c_ws_plugin__s2member_mo_page::wp_redirect_w_mop_vars /* Configure MOP Vars here. */ ("ruri", $_SERVER["REQUEST_URI"], "level", $n, $_SERVER["REQUEST_URI"]) . exit ();
62
  }
63
  }
64
  /**/
76
  * @package s2Member\URIs
77
  * @since 3.5
78
  *
79
+ * @param str $uris A URI string, or a string of multiple URIs is also fine.
80
+ * @param obj $user Optional. A `WP_User` object. Defaults to the current User, if logged-in.
81
  * @return str Collective string of input URIs, with Replacement Codes having been filled.
82
  */
83
  public static function fill_ruri_level_access_rc_vars ($uris = FALSE, $user = FALSE)
84
  {
85
+ eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
86
  do_action ("ws_plugin__s2member_before_fill_ruri_level_access_rc_vars", get_defined_vars ());
87
  unset ($__refs, $__v); /* Unset defined __refs, __v. */
88
  /**/
89
+ $uris = (string)$uris; /* Force ``$uris`` to a string value. */
90
  $orig_uris = $uris; /* Record the original URIs that were passed in; collectively. */
91
  /**/
92
  $user = ((is_object ($user) || is_object ($user = (is_user_logged_in ()) ? wp_get_current_user () : false)) && !empty ($user->ID)) ? $user : false;
93
  /**/
 
94
  $user_id = ($user) ? (string)$user->ID : "";
95
+ $user_login = ($user) ? (string)strtolower ($user->user_login) : "";
96
  /**/
97
  $user_level = (string)c_ws_plugin__s2member_user_access::user_access_level ($user);
98
  $user_role = (string)c_ws_plugin__s2member_user_access::user_access_role ($user);
includes/classes/systematics.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_systematics"))
21
  {
@@ -120,7 +120,7 @@ if (!class_exists ("c_ws_plugin__s2member_systematics"))
120
  {
121
  return ($is_wp_systematic = apply_filters ("ws_plugin__s2member_is_wp_systematic_use_page", true, get_defined_vars ()));
122
  }
123
- else if ($_SERVER["REMOTE_ADDR"] === $_SERVER["SERVER_ADDR"] && stripos ($_SERVER["HTTP_HOST"], "localhost") === false && strpos ($_SERVER["HTTP_HOST"], "127.0.0.1") === false && (!defined ("LOCALHOST") || !LOCALHOST))
124
  {
125
  return ($is_wp_systematic = apply_filters ("ws_plugin__s2member_is_wp_systematic_use_page", true, get_defined_vars ()));
126
  }
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_systematics"))
21
  {
120
  {
121
  return ($is_wp_systematic = apply_filters ("ws_plugin__s2member_is_wp_systematic_use_page", true, get_defined_vars ()));
122
  }
123
+ else if ($_SERVER["REMOTE_ADDR"] === $_SERVER["SERVER_ADDR"] && !c_ws_plugin__s2member_utils_conds::is_localhost ())
124
  {
125
  return ($is_wp_systematic = apply_filters ("ws_plugin__s2member_is_wp_systematic_use_page", true, get_defined_vars ()));
126
  }
includes/classes/utils-arrays.inc.php CHANGED
@@ -119,28 +119,70 @@ if (!class_exists ("c_ws_plugin__s2member_utils_arrays"))
119
  * Removes all null-value array keys from an array *( or even a multi-dimensional array )*.
120
  *
121
  * @package s2Member\Utilities
122
- * @since 110720
123
  *
124
  * @param array $array An input array.
125
- * @return array|mixed The output array, or whatever was passed in.
126
  */
127
- public static function remove_null_keys ($array = FALSE)
128
  {
129
- if (is_array ($array) && !empty ($array))
 
 
130
  {
131
- foreach ($array as $key => &$value)
132
- {
133
- if (is_array ($value)) /* Recursive function call here. */
134
- $value = c_ws_plugin__s2member_utils_arrays::remove_null_keys ($value);
135
- /**/
136
- else if (is_null ($value)) /* Is it null? */
137
- unset ($array[$key]);
138
- }
139
  /**/
140
- return $array;
 
141
  }
142
- else /* Return same. */
143
- return $array;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  }
145
  }
146
  }
119
  * Removes all null-value array keys from an array *( or even a multi-dimensional array )*.
120
  *
121
  * @package s2Member\Utilities
122
+ * @since 111101
123
  *
124
  * @param array $array An input array.
125
+ * @return array Returns the ``$array`` after having reduced it to a non-null set of values.
126
  */
127
+ public static function remove_nulls ($array = FALSE)
128
  {
129
+ $array = (array)$array;
130
+ /**/
131
+ foreach ($array as $key => &$value)
132
  {
133
+ if (is_array ($value)) /* Recursive function call here. */
134
+ $value = c_ws_plugin__s2member_utils_arrays::remove_null_keys ($value);
 
 
 
 
 
 
135
  /**/
136
+ else if (is_null ($value)) /* Is it null? */
137
+ unset ($array[$key]);
138
  }
139
+ return $array;
140
+ }
141
+ /**
142
+ * Forces string values on each array value *( also supports multi-dimensional arrays )*.
143
+ *
144
+ * @package s2Member\Utilities
145
+ * @since 111101
146
+ *
147
+ * @param array $array An input array.
148
+ * @return array Returns the ``$array`` after having forced it to set of string values.
149
+ */
150
+ public static function force_strings ($array = FALSE)
151
+ {
152
+ $array = (array)$array;
153
+ /**/
154
+ foreach ($array as &$value)
155
+ {
156
+ if (is_array ($value)) /* Recursive function call here. */
157
+ $value = c_ws_plugin__s2member_utils_arrays::force_strings ($value);
158
+ /**/
159
+ else if (!is_string ($value)) /* String? */
160
+ $value = (string)$value;
161
+ }
162
+ return $array;
163
+ }
164
+ /**
165
+ * Forces integer values on each array value *( also supports multi-dimensional arrays )*.
166
+ *
167
+ * @package s2Member\Utilities
168
+ * @since 111101
169
+ *
170
+ * @param array $array An input array.
171
+ * @return array Returns the ``$array`` after having forced it to set of integer values.
172
+ */
173
+ public static function force_integers ($array = FALSE)
174
+ {
175
+ $array = (array)$array;
176
+ /**/
177
+ foreach ($array as &$value)
178
+ {
179
+ if (is_array ($value)) /* Recursive function call here. */
180
+ $value = c_ws_plugin__s2member_utils_arrays::force_integers ($value);
181
+ /**/
182
+ else if (!is_integer ($value)) /* Integer? */
183
+ $value = (int)$value;
184
+ }
185
+ return $array;
186
  }
187
  }
188
  }
includes/classes/utils-conds.inc.php CHANGED
@@ -130,6 +130,21 @@ if (!class_exists ("c_ws_plugin__s2member_utils_conds"))
130
  return false;
131
  }
132
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  * Checks to see if we're using Amazon® S3.
134
  *
135
  * @package s2Member\Utilities
130
  return false;
131
  }
132
  /**
133
+ * Checks to see if we're in a localhost environment.
134
+ *
135
+ * @package s2Member\Utilities
136
+ * @since 111101
137
+ *
138
+ * @return bool True if we're in a localhost environment, else false.
139
+ */
140
+ public static function is_localhost ()
141
+ {
142
+ if ((defined ("LOCALHOST") && LOCALHOST) || stripos ($_SERVER["HTTP_HOST"], "localhost") !== false || strpos ($_SERVER["HTTP_HOST"], "127.0.0.1") !== false)
143
+ return true;
144
+ /**/
145
+ return false;
146
+ }
147
+ /**
148
  * Checks to see if we're using Amazon® S3.
149
  *
150
  * @package s2Member\Utilities
includes/classes/utils-gets.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_utils_gets"))
21
  {
@@ -28,196 +28,334 @@ if (!class_exists ("c_ws_plugin__s2member_utils_gets"))
28
  class c_ws_plugin__s2member_utils_gets
29
  {
30
  /**
31
- * Retrieves a list of all Category IDs in the database.
32
  *
33
  * @package s2Member\Utilities
34
  * @since 3.5
35
  *
36
- * @return array Array of all Category IDs.
 
 
37
  */
38
  public static function get_all_category_ids ()
39
  {
40
- $category_ids = get_all_category_ids ();
 
41
  /**/
42
- return (array)$category_ids;
43
  }
44
  /**
45
- * Retrieves a list of all child Category IDs from the database.
46
  *
47
  * @package s2Member\Utilities
48
  * @since 3.5
49
  *
50
- * @param int|str $parent Expects a numeric Category ID.
51
- * @return array Array of all Category IDs under the ``$parent``.
52
  */
53
- public static function get_all_child_category_ids ($parent = FALSE)
54
  {
55
- if (is_numeric ($parent) && is_array ($categories = get_categories ("child_of=" . $parent)))
56
- foreach ($categories as $child_category)
57
- $child_ids[] = $child_category->term_id;
58
  /**/
59
- return (isset ($child_ids)) ? (array)$child_ids : array ();
60
  }
61
  /**
62
- * Retrieves a list of all Tag IDs in the database.
63
  *
64
  * @package s2Member\Utilities
65
  * @since 3.5
66
  *
67
- * @return array Array of all Tag IDs.
68
  */
69
  public static function get_all_tag_ids ()
70
  {
71
- global $wpdb; /* Need global DB obj. */
72
- /**/
73
- foreach ((array)get_tags () as $tag)
74
- $tag_ids[] = $tag->term_id;
75
  /**/
76
- return (isset ($tag_ids)) ? (array)$tag_ids : array ();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
78
  /**
79
- * Retrieves a list of all Post IDs in the database.
80
  *
81
  * @package s2Member\Utilities
82
  * @since 3.5
83
  *
84
- * @return array Array of all Post IDs.
85
- * Includes Custom Post Types. Excludes `page|attachment|revision`.
 
86
  */
87
- public static function get_all_post_ids ()
88
  {
89
- global $wpdb; /* Need global DB obj. */
90
  /**/
91
- $post_ids = $wpdb->get_col ("SELECT `ID` FROM `" . $wpdb->posts . "` WHERE `post_status` = 'publish' AND `post_type` NOT IN('page','attachment','revision')");
 
92
  /**/
93
- return (array)$post_ids;
94
  }
95
  /**
96
- * Retrieves a list of all Page IDs from the database.
97
  *
98
  * @package s2Member\Utilities
99
  * @since 3.5
100
  *
101
- * @return array Array of all Page IDs.
102
  */
103
  public static function get_all_page_ids ()
104
  {
105
- global $wpdb; /* Need global DB obj. */
106
  /**/
107
- $page_ids = $wpdb->get_col ("SELECT `ID` FROM `" . $wpdb->posts . "` WHERE `post_status` = 'publish' AND `post_type` = 'page'");
 
108
  /**/
109
- return (array)$page_ids;
110
  }
111
  /**
112
- * Converts a comma-delimited list of: Tag slugs/names/ids - into all IDs.
113
  *
114
  * @package s2Member\Utilities
115
- * @since 3.5
116
  *
117
- * @param str $tags Tag slugs/names/IDs, comma-delimited.
118
- * @return array Array of all Tag IDs.
119
  */
120
- public static function convert_tags_2_ids ($tags = FALSE)
121
  {
122
- foreach (preg_split ("/[\r\n\t;,]+/", $tags) as $tag)
123
- {
124
- if (($tag = trim ($tag)) && is_numeric ($tag))
125
- $tag_ids[] = $tag;
126
- /**/
127
- else if ($tag && is_string ($tag))
128
- {
129
- if (is_object ($term = get_term_by ("name", $tag, "post_tag")))
130
- $tag_ids[] = $term->term_id;
131
- /**/
132
- else if (is_object ($term = get_term_by ("slug", $tag, "post_tag")))
133
- $tag_ids[] = $term->term_id;
134
- }
135
- }
136
  /**/
137
- return (isset ($tag_ids)) ? (array)$tag_ids : array ();
 
 
 
138
  }
139
  /**
140
- * Retrieves a list of singular IDs from the database.
141
  *
142
- * Only returns singular IDs that require Custom Capabilities;
143
  * and ONLY those which are NOT satisfied by ``$user``.
144
  *
145
  * @package s2Member\Utilities
146
- * @since 3.5
147
  *
148
- * @param obj $user Optional. A `WP_User` object.
149
- * @return array Array of all singular IDs not available to ``$user`` because of Custom Capability restrictions.
150
  */
151
- public static function get_singular_ids_with_ccaps_req ($user = FALSE)
152
  {
153
- global $wpdb; /* Need global DB obj. */
154
  /**/
155
  if (is_array ($results = $wpdb->get_results ("SELECT `post_id`, `meta_value` FROM `" . $wpdb->postmeta . "` WHERE `meta_key` = 's2member_ccaps_req' AND `meta_value` != ''")))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  {
157
- foreach ($results as $result) /* Now we need to check Custom Capabilities against $user. */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  {
159
- if (!is_object ($user) || empty ($user->ID)) /* No ``$user``, not logged-in?. */
160
- $singular_ids[] = $result->post_id; /* No way to satisfy. */
 
 
 
 
 
161
  /**/
162
- else if (is_array ($ccaps = @unserialize ($result->meta_value)))
163
- /**/
164
- foreach ($ccaps as $ccap) /* Test Capability requirements. */
165
- /**/
166
- if (strlen ($ccap)) /* Quick (empty) check here. */
167
- if (!$user->has_cap ("access_s2member_ccap_" . $ccap))
168
- {
169
- $singular_ids[] = $result->post_id;
170
- break;
171
- }
172
  }
 
 
 
173
  }
174
- /**/
175
- return (isset ($singular_ids)) ? (array)$singular_ids : array ();
176
  }
177
  /**
178
- * Retrieves a list of singular IDs from the database.
179
  *
180
- * Only returns singular IDs that require Specific Post/Page Access;
181
  * and ONLY those which are NOT satisfied by the current Visitor.
182
  *
183
  * @package s2Member\Utilities
184
- * @since 3.5
185
  *
186
- * @return array Array of all singular IDs not available to ``$user`` because of Specific Post/Page restrictions.
 
 
 
187
  */
188
- public static function get_singular_ids_with_sp_req ()
189
  {
190
- global $wpdb; /* Need global DB obj. */
 
 
 
191
  /**/
192
- if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && is_array ($sps = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
193
  {
194
- foreach ($sps as $sp) /* Now check access against the current Visitor. */
195
- if ($sp && !c_ws_plugin__s2member_sp_access::sp_access ($sp, "read-only"))
196
- $singular_ids[] = $sp;
 
197
  }
198
  /**/
199
- return (isset ($singular_ids)) ? (array)$singular_ids : array ();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  }
201
  /**
202
- * Retrieves a list of singular IDs from the database.
203
  *
204
- * Only returns singular IDs that are within the ``$terms``;
205
- * passed through the argument to this function.
206
  *
207
  * @package s2Member\Utilities
208
  * @since 110912
209
  *
210
  * @param array $terms Required. An array of term IDs.
211
- * @return array Array of all singular IDs not available to ``$user`` because of Specific Post/Page restrictions.
212
  */
213
  public static function get_singular_ids_in_terms ($terms = FALSE)
214
  {
215
- global $wpdb; /* Need global DB obj. */
216
  /**/
217
- if (is_array ($terms) && !empty ($terms))
218
- $singular_ids = $wpdb->get_col ("SELECT `object_id` FROM `" . $wpdb->term_relationships . "` WHERE `term_taxonomy_id` IN (SELECT `term_taxonomy_id` FROM `" . $wpdb->term_taxonomy . "` WHERE `term_id` IN('" . implode ("','", $terms) . "'))");
219
  /**/
220
- return (isset ($singular_ids)) ? (array)$singular_ids : array ();
221
  }
222
  }
223
  }
15
  * @since 3.5
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_utils_gets"))
21
  {
28
  class c_ws_plugin__s2member_utils_gets
29
  {
30
  /**
31
+ * Retrieves a unique array of all Category IDs in the database.
32
  *
33
  * @package s2Member\Utilities
34
  * @since 3.5
35
  *
36
+ * @uses {@link http://codex.wordpress.org/Function_Reference/get_all_category_ids get_all_category_ids()}
37
+ *
38
+ * @return array Unique array of all Category IDs *( as integers )*.
39
  */
40
  public static function get_all_category_ids ()
41
  {
42
+ if (is_array ($category_ids = /* Uses the WordPress® function for this. */ get_all_category_ids ()))
43
+ $category_ids = c_ws_plugin__s2member_utils_arrays::force_integers ($category_ids);
44
  /**/
45
+ return (!empty ($category_ids) && is_array ($category_ids)) ? array_unique ($category_ids) : array ();
46
  }
47
  /**
48
+ * Retrieves a unique array of all child Category IDs, within a specific parent Category.
49
  *
50
  * @package s2Member\Utilities
51
  * @since 3.5
52
  *
53
+ * @param int|str $parent_category A numeric Category ID.
54
+ * @return array Unique array of all Category IDs *( as integers )* in ``$parent_category``.
55
  */
56
+ public static function get_all_child_category_ids ($parent_category = FALSE)
57
  {
58
+ if (is_numeric ($parent_category) && is_array ($child_categories = get_categories ("child_of=" . $parent_category . "&hide_empty=0")))
59
+ foreach ($child_categories as /* Go through child Categories. */ $child_category)
60
+ $child_category_ids[] = (int)$child_category->term_id;
61
  /**/
62
+ return (!empty ($child_category_ids) && is_array ($child_category_ids)) ? array_unique ($child_category_ids) : array ();
63
  }
64
  /**
65
+ * Retrieves a unique array of all Tag IDs in the database.
66
  *
67
  * @package s2Member\Utilities
68
  * @since 3.5
69
  *
70
+ * @return array Unique array of all Tag IDs *( as integers )*.
71
  */
72
  public static function get_all_tag_ids ()
73
  {
74
+ foreach ((array)get_tags ("hide_empty=0") as $tag)
75
+ $tag_ids[] = (int)$tag->term_id; /* Collect Tag's ID. */
 
 
76
  /**/
77
+ return (!empty ($tag_ids) && is_array ($tag_ids)) ? array_unique ($tag_ids) : array ();
78
+ }
79
+ /**
80
+ * Converts a comma-delimited list of: Tag slugs/names/ids, into a unique array of all IDs.
81
+ *
82
+ * @package s2Member\Utilities
83
+ * @since 111101
84
+ *
85
+ * @param str $tags Tag slugs/names/IDs; comma-delimited.
86
+ * @return array Unique array of Tag IDs *( as integers )*. With Tag slugs/names converted to IDs.
87
+ */
88
+ public static function get_tags_converted_to_ids ($tags = FALSE)
89
+ {
90
+ foreach (preg_split ("/[\r\n\t;,]+/", (string)$tags) as $tag)
91
+ {
92
+ if (($tag = trim ($tag)) && is_numeric ($tag)) /* Force integers. */
93
+ $tag_ids[] = ($tag_id = (int)$tag); /* Force integer values here. */
94
+ /**/
95
+ else if ($tag && is_string /* A string ( i.e. a tag name or a tag slug )? */ ($tag))
96
+ {
97
+ if (is_object ($term = get_term_by ("name", $tag, "post_tag")))
98
+ $tag_ids[] = (int)$term->term_id;
99
+ /**/
100
+ else if (is_object ($term = get_term_by ("slug", $tag, "post_tag")))
101
+ $tag_ids[] = (int)$term->term_id;
102
+ }
103
+ }
104
+ return (!empty ($tag_ids) && is_array ($tag_ids)) ? array_unique ($tag_ids) : array ();
105
  }
106
  /**
107
+ * Retrieves a unique array of all published Post IDs in the database.
108
  *
109
  * @package s2Member\Utilities
110
  * @since 3.5
111
  *
112
+ * @param str $post_type Optional. If provided, return all Post IDs of a specific Post Type.
113
+ * Otherwise, return all Post IDs that are NOT of these Post Types: `page|attachment|nav_menu_item|revision`.
114
+ * @return array Unique array of all Post IDs *( as integers )*, including Custom Post Types; or all Post IDs of a specific Post Type.
115
  */
116
+ public static function get_all_post_ids ($post_type = FALSE)
117
  {
118
+ global $wpdb; /* Need this global DB object reference here. */
119
  /**/
120
+ if (is_array ($post_ids = $wpdb->get_col ("SELECT `ID` FROM `" . $wpdb->posts . "` WHERE `post_status` = 'publish' AND " . (($post_type) ? "`post_type` = '" . esc_sql ((string)$post_type) . "'" : "`post_type` NOT IN('page','attachment','nav_menu_item','revision')"))))
121
+ $post_ids = c_ws_plugin__s2member_utils_arrays::force_integers ($post_ids);
122
  /**/
123
+ return (!empty ($post_ids) && is_array ($post_ids)) ? array_unique ($post_ids) : array ();
124
  }
125
  /**
126
+ * Retrieves a unique array of all published Page IDs in the database.
127
  *
128
  * @package s2Member\Utilities
129
  * @since 3.5
130
  *
131
+ * @return array Unique array of all Page IDs *( as integers )*.
132
  */
133
  public static function get_all_page_ids ()
134
  {
135
+ global $wpdb; /* Need this global DB object reference here. */
136
  /**/
137
+ if (is_array ($page_ids = $wpdb->get_col ("SELECT `ID` FROM `" . $wpdb->posts . "` WHERE `post_status` = 'publish' AND `post_type` = 'page'")))
138
+ $page_ids = c_ws_plugin__s2member_utils_arrays::force_integers ($page_ids);
139
  /**/
140
+ return (!empty ($page_ids) && is_array ($page_ids)) ? array_unique ($page_ids) : array ();
141
  }
142
  /**
143
+ * Retrieves a unique array of all Singular IDs in the database that require Custom Capabilities.
144
  *
145
  * @package s2Member\Utilities
146
+ * @since 111101
147
  *
148
+ * @return array Unique array of all Singular IDs *( as integers )* that require Custom Capabilities.
 
149
  */
150
+ public static function get_all_singular_ids_with_ccaps ()
151
  {
152
+ global $wpdb; /* Need this global DB object reference here. */
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  /**/
154
+ if (is_array ($singular_ids = $wpdb->get_col ("SELECT `post_id` FROM `" . $wpdb->postmeta . "` WHERE `meta_key` = 's2member_ccaps_req' AND `meta_value` != ''")))
155
+ $singular_ids = c_ws_plugin__s2member_utils_arrays::force_integers ($singular_ids);
156
+ /**/
157
+ return (!empty ($singular_ids) && is_array ($singular_ids)) ? array_unique ($singular_ids) : array ();
158
  }
159
  /**
160
+ * Retrieves a unique array of unavailable Singular IDs that require Custom Capabilities.
161
  *
162
+ * Only returns Singular IDs that require Custom Capabilities;
163
  * and ONLY those which are NOT satisfied by ``$user``.
164
  *
165
  * @package s2Member\Utilities
166
+ * @since 111101
167
  *
168
+ * @param obj $user Optional. A `WP_User` object. If this is a valid `WP_User` object, test against this ``$user``, else all are unavailable.
169
+ * @return array Unique array of all Singular IDs *( as integers )* NOT available to ``$user``, due to Custom Capability Restrictions.
170
  */
171
+ public static function get_unavailable_singular_ids_with_ccaps ($user = FALSE)
172
  {
173
+ global $wpdb; /* Need this global DB object reference here. */
174
  /**/
175
  if (is_array ($results = $wpdb->get_results ("SELECT `post_id`, `meta_value` FROM `" . $wpdb->postmeta . "` WHERE `meta_key` = 's2member_ccaps_req' AND `meta_value` != ''")))
176
+ foreach ($results as $r) /* Now we need to check Custom Capabilities against ``$user``. If ``$user`` is a valid `WP_User` object, else all are unavailable. */
177
+ {
178
+ if (!is_object ($user) || empty ($user->ID)) /* No ``$user`` object? Maybe not logged-in?. */
179
+ $singular_ids[] = (int)$r->post_id; /* It's NOT available. There is no ``$user``. */
180
+ /**/
181
+ else if (is_array ($ccaps = /* Make sure we unserialize. */ @unserialize ($r->meta_value)))
182
+ {
183
+ foreach ($ccaps as $ccap) /* Test for Custom Capability Restrictions now. */
184
+ if (strlen ($ccap) && !$user->has_cap ("access_s2member_ccap_" . $ccap))
185
+ {
186
+ $singular_ids[] = (int)$r->post_id; /* It's NOT available. */
187
+ break; /* Break now, no need to continue in this loop. */
188
+ }
189
+ }
190
+ }
191
+ return (!empty ($singular_ids) && is_array ($singular_ids)) ? array_unique ($singular_ids) : array ();
192
+ }
193
+ /**
194
+ * Retrieves a unique array of all Singular IDs that require Specific Post/Page Access.
195
+ *
196
+ * @package s2Member\Utilities
197
+ * @since 111101
198
+ *
199
+ * @param bool $exclude_conflicts Optional. Defaults to false. If true, return ONLY those which are NOT in conflict with any other Restriction Types.
200
+ * The ``$exclude_conflicts`` argument should be used whenever we introduce a list of option values to a site owner. Helping them avoid mishaps.
201
+ * Please note, the ``$exclude_conflicts`` argument implements a resource-intensive processing routine.
202
+ * @return array Unique array of all Singular IDs *( as integers )* that require Specific Post/Page Access.
203
+ */
204
+ public static function get_all_singular_ids_with_sp ($exclude_conflicts = FALSE)
205
+ {
206
+ if (is_array (($singular_ids = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && is_array ($singular_ids = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]))) ? $singular_ids : array ())))
207
+ $singular_ids = c_ws_plugin__s2member_utils_arrays::force_integers ($singular_ids);
208
+ /**/
209
+ if (!empty ($singular_ids) && is_array ($singular_ids) && $exclude_conflicts /* Return ONLY those which are NOT in conflict with other Restrictions? */)
210
  {
211
+ $x_ids = array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
212
+ /**/
213
+ $x_ids = array_merge ($x_ids, c_ws_plugin__s2member_utils_gets::get_all_singular_ids_with_ccaps ());
214
+ /**/
215
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
216
+ {
217
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"] === "all")
218
+ {
219
+ $catgs = c_ws_plugin__s2member_utils_gets::get_all_category_ids ();
220
+ $x_ids = array_merge ($x_ids, c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($catgs));
221
+ continue; /* Continue. The `all` specification is absolute. There's nothing more. */
222
+ }
223
+ /**/
224
+ foreach (($catgs = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_catgs"])) as $catg)
225
+ $catgs = array_merge ($catgs, c_ws_plugin__s2member_utils_gets::get_all_child_category_ids ($catg));
226
+ /**/
227
+ $x_ids = /* Exclude the full list. */ array_merge ($x_ids, c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($catgs));
228
+ unset /* Just a little housekeeping here. */ ($catgs, $catg);
229
+ }
230
+ /**/
231
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
232
+ {
233
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"] === "all")
234
+ {
235
+ $tags = c_ws_plugin__s2member_utils_gets::get_all_tag_ids ();
236
+ $x_ids = array_merge ($x_ids, c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($tags));
237
+ continue; /* Continue. The `all` specification is absolute. There's nothing more. */
238
+ }
239
+ /**/
240
+ $tags = c_ws_plugin__s2member_utils_gets::get_tags_converted_to_ids ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_ptags"]);
241
+ /**/
242
+ $x_ids = /* Exclude the full list. */ array_merge ($x_ids, c_ws_plugin__s2member_utils_gets::get_singular_ids_in_terms ($tags));
243
+ unset /* Just a little housekeeping here. */ ($tags);
244
+ }
245
+ /**/
246
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
247
+ {
248
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"] === "all")
249
+ {
250
+ $x_ids = array_merge ($x_ids, c_ws_plugin__s2member_utils_gets::get_all_post_ids ());
251
+ continue; /* Continue. The `all` specification is absolute. There's nothing more. */
252
+ }
253
+ /**/
254
+ foreach (($posts = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"])) as $p)
255
+ if (strpos ($p, "all-") === 0 && preg_match ("/^all-(.+)$/", $p, $m) /* Protecting `all-` of a specific Post Type? */)
256
+ if (is_array ($p_of_type = c_ws_plugin__s2member_utils_gets::get_all_post_ids ($m[1])) && !empty ($p_of_type))
257
+ $x_ids = array_merge /* Merge all Posts of this Post Type. */ ($x_ids, $p_of_type);
258
+ /**/
259
+ $x_ids = /* Exclude the full list too. */ array_merge ($x_ids, $posts);
260
+ unset /* Just a little housekeeping here. */ ($posts, $p, $m, $p_of_type);
261
+ }
262
+ /**/
263
+ for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
264
  {
265
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"] === "all")
266
+ {
267
+ $x_ids = array_merge ($x_ids, c_ws_plugin__s2member_utils_gets::get_all_page_ids ());
268
+ continue; /* Continue. The `all` specification is absolute. There's nothing more. */
269
+ }
270
+ /**/
271
+ $pages = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]);
272
  /**/
273
+ $x_ids = /* Exclude the full list. */ array_merge ($x_ids, $pages);
274
+ unset /* Just a little housekeeping here. */ ($pages);
 
 
 
 
 
 
 
 
275
  }
276
+ /**/
277
+ $x_ids = array_unique (c_ws_plugin__s2member_utils_arrays::force_integers ($x_ids));
278
+ $singular_ids = /* Exclude all of the ``$x_ids`` now. */ array_diff ($singular_ids, $x_ids);
279
  }
280
+ return (!empty ($singular_ids) && is_array ($singular_ids)) ? array_unique ($singular_ids) : array ();
 
281
  }
282
  /**
283
+ * Retrieves a unique array of unavailable Singular IDs that require Specific Post/Page Access.
284
  *
285
+ * Only returns Singular IDs that require Specific Post/Page Access;
286
  * and ONLY those which are NOT satisfied by the current Visitor.
287
  *
288
  * @package s2Member\Utilities
289
+ * @since 111101
290
  *
291
+ * @param bool $exclude_conflicts Optional. Defaults to false. If true, return ONLY those which are NOT in conflict with any other Restriction Types.
292
+ * The ``$exclude_conflicts`` argument should be used whenever we introduce a list of option values to a site owner. Helping them avoid mishaps.
293
+ * Please note, the ``$exclude_conflicts`` argument implements a resource-intensive processing routine.
294
+ * @return array Unique array of all Singular IDs *( as integers )* NOT available to current Visitor, due to Specific Post/Page Restrictions.
295
  */
296
+ public static function get_unavailable_singular_ids_with_sp ($exclude_conflicts = FALSE)
297
  {
298
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && is_array ($_singular_ids = preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"])))
299
+ foreach ($_singular_ids as $_singular_id) /* Now check access to this Singular, against the current Visitor, via read-only ``c_ws_plugin__s2member_sp_access::sp_access()``. */
300
+ if (is_numeric ($_singular_id) && !c_ws_plugin__s2member_sp_access::sp_access ($_singular_id, "read-only"))
301
+ $singular_ids[] = (int)$_singular_id;
302
  /**/
303
+ if (!empty ($singular_ids) && is_array ($singular_ids) /* And, are we excluding conflicts in this instance? */ && $exclude_conflicts)
304
  {
305
+ $all_singular_ids_not_conflicting = c_ws_plugin__s2member_utils_gets::get_all_singular_ids_with_sp ("exclude-conflicts");
306
+ foreach /* Weed out anything that's in conflict here. */ ($singular_ids as $s => $singular_id)
307
+ if (!in_array ($singular_id, $all_singular_ids_not_conflicting))
308
+ unset ($singular_ids[$s]);
309
  }
310
  /**/
311
+ return (!empty ($singular_ids) && is_array ($singular_ids)) ? array_unique ($singular_ids) : array ();
312
+ }
313
+ /**
314
+ * Retrieves a unique array of all published Singulars, protected with Specific Post/Page Access.
315
+ *
316
+ * @package s2Member\Utilities
317
+ * @since 111101
318
+ *
319
+ * @uses {@link http://codex.wordpress.org/Function_Reference/get_posts get_posts()}
320
+ *
321
+ * @param bool $exclude_conflicts Optional. Defaults to false. If true, return ONLY those which are NOT in conflict with any other Restriction Types.
322
+ * The ``$exclude_conflicts`` argument should be used whenever we introduce a list of option values to a site owner. Helping them avoid mishaps.
323
+ * Please note, the ``$exclude_conflicts`` argument implements a resource-intensive processing routine.
324
+ * @return array Unique array of all Singulars *(i.e. Posts/Pages )* protected with Specific Post/Page Access.
325
+ * Includes Custom Post Types also, as specified by site owner's Specific Post/Page Restrictions.
326
+ */
327
+ public static function get_all_singulars_with_sp ($exclude_conflicts = FALSE)
328
+ {
329
+ $singulars = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"] && is_array ($singulars = get_posts ("post_status=publish&post_type=any&include=" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]))) ? $singulars : array ();
330
+ /**/
331
+ if (!empty ($singulars) && is_array ($singulars) /* And, are we excluding conflicts in this instance? */ && $exclude_conflicts)
332
+ {
333
+ $all_singular_ids_not_conflicting = c_ws_plugin__s2member_utils_gets::get_all_singular_ids_with_sp ("exclude-conflicts");
334
+ foreach /* Weed out anything that's in conflict here. */ ($singulars as $s => $singular)
335
+ if (!in_array ($singular->ID, $all_singular_ids_not_conflicting))
336
+ unset ($singulars[$s]);
337
+ }
338
+ return (!empty ($singulars) && is_array ($singulars)) ? c_ws_plugin__s2member_utils_arrays::array_unique ($singulars) : array ();
339
  }
340
  /**
341
+ * Retrieves a unique array of Singular IDs in the database, within specific term IDs.
342
  *
343
+ * Only returns Singular IDs that are within the ``$terms`` passed through this function.
 
344
  *
345
  * @package s2Member\Utilities
346
  * @since 110912
347
  *
348
  * @param array $terms Required. An array of term IDs.
349
+ * @return array Unique array of all Singular IDs *( as integers )* within the ``$terms`` passed through this function.
350
  */
351
  public static function get_singular_ids_in_terms ($terms = FALSE)
352
  {
353
+ global $wpdb; /* Need this global DB object reference here. */
354
  /**/
355
+ if (!empty ($terms) && is_array ($terms) && is_array ($singular_ids = $wpdb->get_col ("SELECT `object_id` FROM `" . $wpdb->term_relationships . "` WHERE `term_taxonomy_id` IN (SELECT `term_taxonomy_id` FROM `" . $wpdb->term_taxonomy . "` WHERE `term_id` IN('" . implode ("','", $terms) . "'))")))
356
+ $singular_ids = c_ws_plugin__s2member_utils_arrays::force_integers ($singular_ids);
357
  /**/
358
+ return (!empty ($singular_ids) && is_array ($singular_ids)) ? array_unique ($singular_ids) : array ();
359
  }
360
  }
361
  }
includes/dropins/bridges/_s2member-bbpress-bridge.php DELETED
@@ -1,285 +0,0 @@
1
- <?php
2
- /**
3
- * s2Member Bridge plugin for bbPress®.
4
- *
5
- * Copyright: © 2009-2011
6
- * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
7
- * ( coded in the USA )
8
- *
9
- * Released under the terms of the GNU General Public License.
10
- * You should have received a copy of the GNU General Public License,
11
- * along with this software. In the main directory, see: /licensing/
12
- * If not, see: {@link http://www.gnu.org/licenses/}.
13
- *
14
- * @package s2Member\Dropins\Bridges\bbPress
15
- * @deprecated Use bbPress® 2.0+ when possible.
16
- * @since 3.0
17
- */
18
- /* -- This section for bbPress® parsing. --------------------------------------------------------------------------------
19
-
20
- Version: 110604
21
- Stable tag: 110604
22
- Framework: WS-BB-DIP-110523
23
-
24
- Tested up to: 1.0.3
25
- Requires at least: 1.0.3
26
- Requires: s2Member 110604+, bbPress® 1.0.3+
27
-
28
- Copyright: © 2009 WebSharks, Inc.
29
- License: GNU General Public License
30
- Contributors: WebSharks, PriMoThemes
31
- Author URI: http://www.primothemes.com/
32
- Author: PriMoThemes.com / WebSharks, Inc.
33
- Donate link: http://www.primothemes.com/donate/
34
-
35
- Plugin Name: s2Member Bridge
36
- Pro Module / Prices: http://www.s2member.com/prices/
37
- Forum URI: http://www.primothemes.com/forums/viewforum.php?f=4
38
- Privacy URI: http://www.primothemes.com/about/privacy-policy/
39
- Professional Installation URI: http://www.s2member.com/professional-installation/
40
- Plugin URI: http://www.primothemes.com/post/product/s2member-membership-plugin-with-paypal/
41
- Description: Blocks all non-Member access to bbPress® forums. Only the login-page is available. Forum registration is redirected to your Membership Options Page for s2Member ( on your main WordPress® installation ). This way, a visitor can signup on your site, and gain Membership Access to your forums. This plugin will NOT work, until you've successfully integrated WordPress® into bbPress®. See: `bbPress® -> Settings -> WordPress® Integration`.
42
- Tags: membership, members, member, register, signup, paypal, pay pal, s2member, subscriber, members only, bbpress, bb press, forums, forum, buddypress, buddy press, buddy press compatible, shopping cart, checkout, api, options panel included, websharks framework, w3c validated code, multi widget support, includes extensive documentation, highly extensible
43
-
44
- -- end section for bbPress® parsing. --------------------------------------------------------------------------------- */
45
- if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
46
- exit ("Do not access this file directly.");
47
- /* ------------------------------------------------------------------------------------------------------------------- */
48
- /**
49
- * Numeric string 1|0 indicating true or false.
50
- *
51
- * The %%ovg%% string is replaced dynamically by the s2Member installer.
52
- *
53
- * @package s2Member\Dropins\Bridges\bbPress
54
- * @since 3.5.8
55
- *
56
- * @var str
57
- */
58
- if (!defined ("WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_ALLOW_OPEN_VIEWING"))
59
- define ("WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_ALLOW_OPEN_VIEWING", "%%ovg%%");
60
- /**
61
- * Numeric string [0-9]+ indicating an s2Member Access Level.
62
- *
63
- * The %%min%% string is replaced dynamically by the s2Member installer.
64
- *
65
- * @package s2Member\Dropins\Bridges\bbPress
66
- * @since 3.0
67
- *
68
- * @var str
69
- */
70
- if (!defined ("WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_MIN_PARTICIPATION_LEVEL"))
71
- define ("WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_MIN_PARTICIPATION_LEVEL", "%%min%%");
72
- /* ------------------------------------------------------------------------------------------------------------------- */
73
- /*
74
- Adds an action for the function below.
75
- */
76
- add_action ("bb_init", "ws_plugin__s2member_bridge_bbpress_roles", 1);
77
- /**/
78
- if (!function_exists ("ws_plugin__s2member_bridge_bbpress_roles"))
79
- {
80
- /**
81
- * Converts s2Member Roles into bbPress® "Members" on-the-fly.
82
- *
83
- * Only when no bbPress® Role has been assigned yet.
84
- * This way a site owner can still modify Roles.
85
- *
86
- * @package s2Member\Dropins\Bridges\bbPress
87
- * @since 3.0
88
- *
89
- * @return null
90
- */
91
- function ws_plugin__s2member_bridge_bbpress_roles () /* On-the-fly. */
92
- {
93
- if (is_object ($user = bb_get_current_user ()) && $user->ID) /* Logged in? */
94
- {
95
- if (empty ($user->roles)) /* Only if/when no bbPress® Role is assigned. */
96
- {
97
- bb_give_user_default_role ($user); /* Assign default Role. */
98
- }
99
- }
100
- /**/
101
- return; /* Return for uniformity. */
102
- }
103
- }
104
- /* ------------------------------------------------------------------------------------------------------------------- */
105
- /*
106
- Adds an action for the function below.
107
- */
108
- add_action ("bb_init", "ws_plugin__s2member_bridge_bbpress_access", 1);
109
- /**/
110
- if (!function_exists ("ws_plugin__s2member_bridge_bbpress_access"))
111
- {
112
- /**
113
- * Overall bbPress® security gate for s2Member.
114
- *
115
- * Deny all access to the bbPress® registration page.
116
- * This will leave the bbPress® login page available, as it should be.
117
- *
118
- * @package s2Member\Dropins\Bridges\bbPress
119
- * @since 3.0
120
- *
121
- * @return null
122
- */
123
- function ws_plugin__s2member_bridge_bbpress_access ()
124
- {
125
- $location = bb_get_location (); /* The current location. */
126
- /**/
127
- $wp_caps = bb_get_option ("wp_table_prefix") . "capabilities";
128
- /**/
129
- $ovg = (int)WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_ALLOW_OPEN_VIEWING;
130
- $min = (int)WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_MIN_PARTICIPATION_LEVEL;
131
- /**/
132
- $open_viewing_possible = $ovg; /* Use this for additional clarity. */
133
- /**/
134
- if (!in_array ($location, array ("login-page", "register-page")))
135
- {
136
- if ($url = bb_get_option ("wp_siteurl")) /* WordPress® integrated? */
137
- {
138
- if (!$open_viewing_possible) /* If Open Viewing is NOT possible. */
139
- {
140
- if (!bb_is_user_logged_in () || !bb_current_user_can ("participate"))
141
- {
142
- $bbPress = bb_get_option ("url"); /* bbPress® URL location. */
143
- /**/
144
- if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
145
- wp_redirect ($url, apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
146
- /**/
147
- else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
148
- wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
149
- /**/
150
- exit (); /* Clean exit. */
151
- }
152
- else if (is_object ($user = bb_get_current_user ()) && $user->ID && isset ($user->$wp_caps) && is_array ($user->$wp_caps))
153
- {
154
- $wp_role = reset (array_keys ($user->$wp_caps)); /* Looking for ^(subscriber|s2member_level[0-9]+)$. */
155
- /**/
156
- if (preg_match ("/^(subscriber|s2member_level[0-9]+)$/", $wp_role)) /* Subscribers and/or s2 Roles. */
157
- {
158
- if (($wp_role === "subscriber" && $min > 0) || ($level = str_replace ("s2member_level", "", $wp_role)) < $min)
159
- {
160
- $bbPress = bb_get_option ("url"); /* bbPress® URL location. */
161
- /**/
162
- if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
163
- wp_redirect ($url, apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
164
- /**/
165
- else /* Otherwise, redirect this User to your Membership Options Page. */
166
- wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
167
- /**/
168
- exit (); /* Clean exit. */
169
- }
170
- }
171
- }
172
- }
173
- else if ($open_viewing_possible) /* Else, if Open Viewing IS possible. */
174
- {
175
- add_filter ("bb_current_user_can", "_ws_plugin__s2member_bridge_bbpress_access_caps", 10, 2);
176
- /**/
177
- if (!function_exists ("_ws_plugin__s2member_bridge_bbpress_access_caps"))
178
- {
179
- /**
180
- * Filters `bb_current_user_can()` whenever Open Viewing is possible.
181
- *
182
- * @package s2Member\Dropins\Bridges\bbPress
183
- * @since 3.5.8
184
- *
185
- * @param bool $can bbPress® default return value from `bb_current_user_can()`.
186
- * @param str $cap bbPress® Role ID or bbPress® Capability *( i.e. `member`, `participate` )*.
187
- * @return bool true if the current bbPress® User has the specified Role or Capability, else false.
188
- */
189
- function _ws_plugin__s2member_bridge_bbpress_access_caps ($can = FALSE, $cap = FALSE)
190
- {
191
- $wp_caps = bb_get_option ("wp_table_prefix") . "capabilities";
192
- /**/
193
- $min = (int)WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_MIN_PARTICIPATION_LEVEL;
194
- /**/
195
- if (!bb_is_user_logged_in ()) /* If/when they're NOT logged in; read-only. */
196
- {
197
- return ($cap === "read") ? true : false; /* Read-only access. */
198
- }
199
- else if (is_object ($user = bb_get_current_user ()) && $user->ID && isset ($user->$wp_caps) && is_array ($user->$wp_caps))
200
- {
201
- $wp_role = reset (array_keys ($user->$wp_caps)); /* Looking for ^(subscriber|s2member_level[0-9]+)$. */
202
- /**/
203
- if (preg_match ("/^(subscriber|s2member_level[0-9]+)$/", $wp_role)) /* Subscribers and/or s2 Roles. */
204
- {
205
- if (($wp_role === "subscriber" && $min > 0) || ($level = str_replace ("s2member_level", "", $wp_role)) < $min)
206
- {
207
- return ($cap === "read") ? true : false;
208
- }
209
- }
210
- }
211
- /**/
212
- return $can; /* Return true|false. */
213
- }
214
- }
215
- /**/
216
- add_action ("post_post_form", "_ws_plugin__s2member_bridge_bbpress_access_post_form");
217
- /**/
218
- if (!function_exists ("_ws_plugin__s2member_bridge_bbpress_access_post_form"))
219
- {
220
- /**
221
- * Displays a message whenever the current bbPress® User is unable to participate.
222
- *
223
- * @package s2Member\Dropins\Bridges\bbPress
224
- * @since 3.5.8
225
- *
226
- * @return null
227
- */
228
- function _ws_plugin__s2member_bridge_bbpress_access_post_form ()
229
- {
230
- $min = (int)WS_PLUGIN__S2MEMBER_BRIDGE_BBPRESS_MIN_PARTICIPATION_LEVEL;
231
- /**/
232
- if (bb_is_user_logged_in () && !bb_current_user_can ("participate")) /* Unable to participate? */
233
- {
234
- echo '<p class="upgrade-line">Your Membership needs to be <a href="' . esc_attr (bb_get_option ("wp_siteurl") . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min)) . '" class="upgrade-link">upgraded</a> before you can Post.</p>';
235
- }
236
- /**/
237
- return; /* Return for uniformity. */
238
- }
239
- }
240
- }
241
- }
242
- }
243
- else if (in_array ($location, array ("register-page"))) /* Send registration requests through WP. */
244
- {
245
- if ($url = bb_get_option ("wp_siteurl")) /* This will redirect registrants to your Membership Options Page. */
246
- {
247
- wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
248
- /**/
249
- exit (); /* Clean exit. */
250
- }
251
- }
252
- /**/
253
- return; /* Return for uniformity. */
254
- }
255
- }
256
- /* ------------------------------------------------------------------------------------------------------------------- */
257
- /*
258
- API function for Role Conditionals in bbPress®.
259
- */
260
- if (!function_exists ("current_wp_user_is"))
261
- {
262
- /**
263
- * API function for Role Conditionals in bbPress®.
264
- *
265
- * @package s2Member\Dropins\Bridges\bbPress
266
- * @since 3.5.8
267
- *
268
- * @param str $role WordPress® Role ID *( i.e. `s2member_level[0-9]+`, `administrator`, `editor`, `author`, `contributor`, `subscriber` )*.
269
- * @return bool true if the current bbPress® User has the specified Role, else false.
270
- */
271
- function current_wp_user_is ($role = FALSE)
272
- {
273
- $wp_caps = bb_get_option ("wp_table_prefix") . "capabilities";
274
- /**/
275
- if ($role && is_object ($user = bb_get_current_user ()) && $user->ID && isset ($user->$wp_caps) && is_array ($user->$wp_caps))
276
- {
277
- $wp_role = reset (array_keys ($user->$wp_caps));
278
- /**/
279
- return ($wp_role === $role);
280
- }
281
- else /* Nope. */
282
- return false;
283
- }
284
- }
285
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/menu-pages/code-samples/api-mop-vars-e.x-php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* --------------------------------------------------------------- */
3
+
4
+ $_g = stripslashes_deep ($_GET);
5
+
6
+ /* ------------------------------------------------------------------------------------ */
7
+
8
+ if (isset ($_g["_s2member_seeking"]["type"]) /* One of: page|post|catg|ptag|file|ruri */ )
9
+ echo 'You were trying to access a protected: ' . esc_html ($_g["_s2member_seeking"]["type"]) . '.';
10
+
11
+ /* --------------------------------------------------------------- */
12
+
13
+ if (isset ($_g["_s2member_seeking"]["page"]))
14
+ echo 'You were trying to access Page ID #' . esc_html ($_g["_s2member_seeking"]["page"]) . '.';
15
+
16
+ else if (isset ($_g["_s2member_seeking"]["post"]))
17
+ echo 'You were trying to access Post ID #' . esc_html ($_g["_s2member_seeking"]["post"]) . '.';
18
+
19
+ else if (isset ($_g["_s2member_seeking"]["catg"]))
20
+ echo 'You were trying to access Category ID #' . esc_html ($_g["_s2member_seeking"]["catg"]) . '.';
21
+
22
+ else if (isset ($_g["_s2member_seeking"]["ptag"]))
23
+ echo 'You were trying to access the Tag ID #' . esc_html ($_g["_s2member_seeking"]["ptag"]) . '.';
24
+
25
+ else if (isset ($_g["_s2member_seeking"]["file"]))
26
+ echo 'You were trying to access the File: ' . esc_html ($_g["_s2member_seeking"]["file"]) . '.';
27
+
28
+ else if (isset ($_g["_s2member_seeking"]["ruri"]) /* Full URI they were trying to access. */)
29
+ echo 'You were trying to access URI: ' . esc_html (base64_decode ($_g["_s2member_seeking"]["ruri"])) . '.';
30
+ /* See also: <http://codex.wordpress.org/Function_Reference/site_url>. */
31
+ /* See also: <http://php.net/manual/en/function.base64-decode.php>. */
32
+
33
+ /* --------------------------------------------------------------- */
34
+
35
+ if (isset ($_g["_s2member_seeking"]["_uri"]) /* Full URI they were trying to access. */ )
36
+ echo 'You were trying to access URL: ' . esc_html (site_url(base64_decode($_g["_s2member_seeking"]["_uri"]))) . '.';
37
+ /* See also: <http://codex.wordpress.org/Function_Reference/site_url>. */
38
+ /* See also: <http://php.net/manual/en/function.base64-decode.php>. */
39
+
40
+ /* ------------------------------------------------------------------------------------ */
41
+
42
+ if (isset ($_g["_s2member_req"]["type"]) /* One of: level|ccap|sp */)
43
+ echo 'You were trying to access content that requires: ' . esc_html ($_g["_s2member_req"]["type"]) . '.';
44
+
45
+ /* --------------------------------------------------------------- */
46
+
47
+ if (isset ($_g["_s2member_req"]["level"]))
48
+ echo 'You must be a Member at Level #' . esc_html ($_g["_s2member_req"]["level"]) . ' or higher.';
49
+
50
+ else if (isset ($_g["_s2member_req"]["ccap"]))
51
+ echo 'You must be a Member with Custom Capability: ' . esc_html ($_g["_s2member_req"]["ccap"]) . '.';
52
+
53
+ else if (isset ($_g["_s2member_req"]["sp"]))
54
+ echo 'You must purchase Specific Post/Page ID #' . esc_html ($_g["_s2member_req"]["sp"]) . '.';
55
+
56
+ /* ------------------------------------------------------------------------------------ */
57
+
58
+ if (isset ($_g["_s2member_res"]["type"]) /* One of: post|page|catg|ptag|file|ruri|ccap|sp|sys */)
59
+ echo 'You were trying to access content protected via s2Member: ' . esc_html ($_g["_s2member_res"]["type"]) . ' restrictions.';
60
+ ?>
includes/menu-pages/code-samples/api-mop-vars-o.x-php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -----------------------------------------------------------------------------------------------------------
2
+ These example redirection links include all possible MOP Variable variations in the query string.
3
+ -----------------------------------------------------------------------------------------------------------
4
+
5
+ .../membership-options-page/?s2member_seeking=page-587&s2member_level_req=1
6
+ .../membership-options-page/?s2member_seeking=post-545&s2member_level_req=2
7
+ .../membership-options-page/?s2member_seeking=catg-698&s2member_level_req=4
8
+ .../membership-options-page/?s2member_seeking=ptag-447&s2member_level_req=3
9
+ .../membership-options-page/?s2member_seeking=page-887&s2member_ccap_req=music
10
+ .../membership-options-page/?s2member_seeking=post-871&s2member_ccap_req=videos
11
+ .../membership-options-page/?s2member_seeking=post-369&s2member_sp_req=369
12
+ .../membership-options-page/?s2member_seeking=bbpress&s2member_level_req=1
13
+ .../membership-options-page/?s2member_seeking=ruri-aHR0cDovL3d3dy5leGFtcGxlLmNvbS8&s2member_level_req=1
14
+ .../membership-options-page/?s2member_seeking=file-example.zip&s2member_level_req=1
15
+
16
+ -----------------------------------------------------------------------------------------------------------
17
+
18
+ Here is a breakdown on each of these Variables:
19
+
20
+ * `s2member_seeking` = [post|page|catg|ptag]-[ID number] ( Post ID, Page ID, Category ID, Tag ID )
21
+ Or: `s2member_seeking` = ruri-[base64 encoded URI] ( only applies w/ Membership URI Restrictions )
22
+ Or: `s2member_seeking` = file-[protected file name] ( only applies w/ Download Restrictions )
23
+ Or: `s2member_seeking` = bbpress ( only applies when the s2Member -> bbPress Bridge is installed )
24
+ * `s2member_level_req` = a Membership Level # required for access ( only applies to Membership Level Access )
25
+ * `s2member_ccap_req` = a Custom Capability required for access ( only applies to Custom Capability Restrictions )
26
+ * `s2member_sp_req` = a Specific Post/Page ID required ( only applies to Specific Post/Page Access Restrictions )
27
+
28
+ `s2member_seeking` is always passed in; it is never excluded.
29
+ `s2member_level_req`, `s2member_ccap_req`, `s2member_sp_req` are mutually exclusive.
30
+ Only ONE of these three Variables will be passed in combination with `s2member_seeking`.
31
+
32
+ -----------------------------------------------------------------------------------------------------------
33
+
34
+ * These old MOP Vars are deprecated ( they will NOT be available in future versions of s2Member ).
includes/menu-pages/code-samples/api-mop-vars.x-php CHANGED
@@ -1,33 +1,54 @@
1
  -----------------------------------------------------------------------------------------------------------
2
- These example redirection links include all possible MOP Variable variations in the query string.
3
  -----------------------------------------------------------------------------------------------------------
4
 
5
- .../membership-options-page/?s2member_seeking=page-587&s2member_level_req=1
6
- .../membership-options-page/?s2member_seeking=post-545&s2member_level_req=2
7
- .../membership-options-page/?s2member_seeking=catg-698&s2member_level_req=4
8
- .../membership-options-page/?s2member_seeking=ptag-447&s2member_level_req=3
9
- .../membership-options-page/?s2member_seeking=page-887&s2member_ccap_req=music
10
- .../membership-options-page/?s2member_seeking=post-871&s2member_ccap_req=videos
11
- .../membership-options-page/?s2member_seeking=post-369&s2member_sp_req=369
12
- .../membership-options-page/?s2member_seeking=bbpress&s2member_level_req=1
13
- .../membership-options-page/?s2member_seeking=ruri-aHR0cDovL3d3dy5leGFtcGxlLmNvbS8&s2member_level_req=1
14
- .../membership-options-page/?s2member_seeking=file-example.zip&s2member_level_req=1
15
 
16
  -----------------------------------------------------------------------------------------------------------
17
 
18
  Here is a breakdown on each of these Variables:
19
 
20
- * `s2member_seeking` = [post|page|catg|ptag]-[ID number] ( Post ID, Page ID, Category ID, Tag ID )
21
- Or: `s2member_seeking` = ruri-[base64 encoded URI] ( only applies w/ Membership URI Restrictions )
22
- Or: `s2member_seeking` = file-[protected file name] ( only applies w/ Download Restrictions )
23
- Or: `s2member_seeking` = bbpress ( only applies when the s2Member -> bbPress Bridge is installed )
24
- * `s2member_level_req` = a Membership Level # required for access ( only applies to Membership Level Access )
25
- * `s2member_ccap_req` = a Custom Capability required for access ( only applies to Custom Capability Restrictions )
26
- * `s2member_sp_req` = a Specific Post/Page ID required ( only applies to Specific Post/Page Access Restrictions )
27
-
28
- `s2member_seeking` is always passed in; it is never excluded.
29
- `s2member_level_req`, `s2member_ccap_req`, `s2member_sp_req` are mutually exclusive.
30
- Only ONE of these three Variables will be passed in combination with `s2member_seeking`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  -----------------------------------------------------------------------------------------------------------
33
 
1
  -----------------------------------------------------------------------------------------------------------
2
+ Example redirection links, including many of the possible MOP Variable variations.
3
  -----------------------------------------------------------------------------------------------------------
4
 
5
+ .../membership-options-page/?_s2member_seeking[post]=369&_s2member_req[sp]=369
6
+ .../membership-options-page/?_s2member_seeking[page]=559&_s2member_req[sp]=559
7
+ .../membership-options-page/?_s2member_seeking[page]=587&_s2member_req[level]=1
8
+ .../membership-options-page/?_s2member_seeking[post]=545&_s2member_req[level]=2
9
+ .../membership-options-page/?_s2member_seeking[catg]=698&_s2member_req[level]=4
10
+ .../membership-options-page/?_s2member_seeking[ptag]=447&_s2member_req[level]=3
11
+ .../membership-options-page/?_s2member_seeking[page]=887&_s2member_req[ccap]=music
12
+ .../membership-options-page/?_s2member_seeking[post]=871&_s2member_req[ccap]=videos
13
+ .../membership-options-page/?_s2member_seeking[file]=example.zip&_s2member_req[level]=1
14
+ .../membership-options-page/?_s2member_seeking[ruri]=aHR0cDov...&_s2member_req[level]=1
15
 
16
  -----------------------------------------------------------------------------------------------------------
17
 
18
  Here is a breakdown on each of these Variables:
19
 
20
+ * `_s2member_seeking[post|page|catg|ptag|file|ruri]` = ( Post ID, Page ID, Category ID, Tag ID, File, URI )
21
+ Tip: `_s2member_seeking[file]` = ( File path, relative to /s2member-files/, or your Amazon® S3 Bucket )
22
+ Tip: `_s2member_seeking[ruri]` = ( A base 64 encoded URI; only applies w/ Membership URI Restrictions )
23
+ Tip: These array elements are mutually exclusive: [post|page|catg|ptag|file|ruri].
24
+ Only ONE of these array elements ( i.e. Content Types ) will be specified.
25
+
26
+ * `_s2member_req[level]` = a Membership Level # required for access ( only applies to Membership Level Access )
27
+ * `_s2member_req[ccap]` = a Custom Capability required for access ( only applies to Custom Capability Restrictions )
28
+ * `_s2member_req[sp]` = a Specific Post/Page ID required ( only applies to Specific Post/Page Access Restrictions )
29
+ Tip: `_s2member_req[level|ccap|sp]` are mutually exclusive Requirement Types.
30
+ Only ONE of these three elements will be passed in combination with:
31
+ `_s2member_seeking[post|page|catg|ptag|file|ruri]`.
32
+
33
+ -----------------------------------------------------------------------------------------------------------
34
+
35
+ Additional Variables that might be useful to developers:
36
+
37
+ * `_s2member_seeking[_uri]` = ( A base 64 encoded URI; the URI they were originally seeking )
38
+ Tip: this is ALWAYS passed through, regardless of which Content Type was protected.
39
+
40
+ * `_s2member_seeking[type]` = ( A string. One of: post|page|catg|ptag|file|ruri )
41
+ Tip: this is ALWAYS passed through, regardless of which Content Type was protected.
42
+
43
+ * `_s2member_req[type]` = ( A string. One of: level|ccap|sp )
44
+ Tip: this Requirement Type Variable is ALWAYS passed through.
45
+
46
+ * `_s2member_res[type]` = ( A string. One of: post|page|catg|ptag|file|ruri|ccap|sp|sys )
47
+ Tip: Actual Restriction Type that's preventing access; may differ from `_s2member_seeking[type]`.
48
+ Tip: Restriction Type `sys` Systematic ( i.e. something s2Member protects automatically )
49
+ Tip: Restriction Type `ccap` represents Custom Capability Restrictions by s2Member.
50
+ Tip: Restriction Type `sp` represents Specific Post/Page Access Restrictions.
51
+ Tip: this Restriction Type Variable is ALWAYS passed through.
52
 
53
  -----------------------------------------------------------------------------------------------------------
54
 
includes/menu-pages/down-ops.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_down_ops"))
21
  {
@@ -350,7 +350,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_down_ops"))
350
  echo '<p><em><strong>Dev Note w/Technical Details:</strong> s2Member\'s auto-configuration routines for Amazon® CloudFront (below), are designed to create &amp; configure various components on your Amazon® Web Services account, which are all requirements for you to <a href="http://docs.amazonwebservices.com/AmazonCloudFront/2010-11-01/DeveloperGuide/index.html?HowToPrivateContent.html" target="_blank" rel="external">serve protected files through the Amazon® S3/CloudFront combination</a>. These components include: an Origin Access Identity, read permissions for the Origin Access Identity, and two private content Distributions. One private content Distribution for file downloads, and another private content Distribution for streaming media files; both connected to and sourced by your Amazon® S3 Bucket. In addition, s2Member will automatically configure an ACL &amp; Policy ( i.e. permissions ) on your Amazon® S3 Bucket to make sure your protected object/files are NOT available to the public.</em></p>' . "\n";
351
  echo '<p><em><strong>Linking To Protected Files:</strong> Streamed files are special, but nothing else changes. s2Member\'s integration with Amazon® S3/CloudFront serves protected files through the same links that all s2Member site owners use. For example, you might use: <code>' . esc_html (site_url ("/?s2member_file_download=example-file.zip")) . '</code>, where <strong>s2member_file_download</strong> = the file, relative to the root of your Amazon® S3 Bucket. In other words, just the file name in most cases. s2Member will redirect Users/Members to a digitally signed Amazon® CloudFront URL, which allows them access to a particular file via Amazon® CloudFront. For further details, please review this section of your Dashboard: <code>s2Member -> Download Options -> Basic Download Restrictions</code>. Also see: <code>s2Member -> Download Options -> Advanced Mod-Rewrite Linkage</code>. For streaming audio/video files, please review the section below: <code>JW Player® &amp; RTMP Protocol Examples</code>.</em></p>' . "\n";
352
  echo '<p><em><strong>Content Type, Disposition &amp; Inline Files:</strong> An IMPORTANT issue. The query string parameter <code>&amp;s2member_file_inline=yes</code> does NOTHING for files served via Amazon® CloudFront. s2Member has NO control over the <code>Content-Type</code> and/or <code>Content-Disposition</code> headers for a file being served through Amazon® CloudFront, and CloudFront servers do NOT automatically determine the MIME type for the objects they serve. Therefore, when you upload a file to your Amazon® S3 Bucket, you should set its Content-Type header. That is, you MUST configure headers yourself ( such as <code>Content-Type: video/webm</code>, or <code>Content-Disposition: inline|attachment</code> ) that you want Amazon® CloudFront to send for a particular file. It\'s quite easy. You do this by setting <code>Properties -> Metadata ( i.e. headers )</code> on a per-file basis, from inside your Amazon® S3 Management Console. In short, when you upload a file to your Amazon® S3 Bucket, if you want that file to be served a certain way, be sure to configure its <code>Properties -> Metadata</code> accordingly.</em></p>' . "\n";
353
- echo (stripos (PHP_OS, "win") === 0 && (stripos ($_SERVER["HTTP_HOST"], "localhost") !== false || strpos ($_SERVER["HTTP_HOST"], "127.0.0.1") !== false || (defined ("LOCALHOST") && LOCALHOST))) ? '<p><em><strong>Localhost Developers:</strong> s2Member\'s Amazon® CloudFront integration requires the <a href="http://php.net/manual/en/function.openssl-sign.php" target="_blank" rel="external">openssl_sign()</a> function in PHP so it can digitially sign CloudFront® URLs. This function is sometimes problematic on localhost servers such as WAMP &amp; EasyPHP. We recommend installing <a href="http://www.slproweb.com/products/Win32OpenSSL.html" target="_blank" rel="external">this lightweight alternative for Windows®</a> while you\'re developing. s2Member will automatically find it here: <code>C:\OpenSSL-Win[32/64]\bin\openssl.exe</code>.' . ((file_exists ("c:\openssl-win32\bin\openssl.exe") || file_exists ("c:\openssl-win64\bin\openssl.exe")) ? ' <strong class="ws-menu-page-hilite">( s2Member has detected that OpenSSL-Win[32/64] IS installed in the correct location, thank you! )</strong>' : ' <strong class="ws-menu-page-hilite">( s2Member has detected that OpenSSL-Win[32/64] is NOT currently available )</strong>') . '</em></p>' . "\n" : '';
354
  /**/
355
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"] === "configured")
356
  echo '<p><em class="ws-menu-page-hilite"><strong>Your Amazon® CloudFront Distributions are: ( ALREADY configured! )</strong></em>' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) ? '<br /><em class="ws-menu-page-hilite">Downloads Distribution CNAME:</em> <em><code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' &mdash;&raquo; ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) ? '<br /><em class="ws-menu-page-hilite">Streaming Distribution CNAME:</em> <em><code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' &mdash;&raquo; ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : '') . '</p>' . "\n";
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_down_ops"))
21
  {
350
  echo '<p><em><strong>Dev Note w/Technical Details:</strong> s2Member\'s auto-configuration routines for Amazon® CloudFront (below), are designed to create &amp; configure various components on your Amazon® Web Services account, which are all requirements for you to <a href="http://docs.amazonwebservices.com/AmazonCloudFront/2010-11-01/DeveloperGuide/index.html?HowToPrivateContent.html" target="_blank" rel="external">serve protected files through the Amazon® S3/CloudFront combination</a>. These components include: an Origin Access Identity, read permissions for the Origin Access Identity, and two private content Distributions. One private content Distribution for file downloads, and another private content Distribution for streaming media files; both connected to and sourced by your Amazon® S3 Bucket. In addition, s2Member will automatically configure an ACL &amp; Policy ( i.e. permissions ) on your Amazon® S3 Bucket to make sure your protected object/files are NOT available to the public.</em></p>' . "\n";
351
  echo '<p><em><strong>Linking To Protected Files:</strong> Streamed files are special, but nothing else changes. s2Member\'s integration with Amazon® S3/CloudFront serves protected files through the same links that all s2Member site owners use. For example, you might use: <code>' . esc_html (site_url ("/?s2member_file_download=example-file.zip")) . '</code>, where <strong>s2member_file_download</strong> = the file, relative to the root of your Amazon® S3 Bucket. In other words, just the file name in most cases. s2Member will redirect Users/Members to a digitally signed Amazon® CloudFront URL, which allows them access to a particular file via Amazon® CloudFront. For further details, please review this section of your Dashboard: <code>s2Member -> Download Options -> Basic Download Restrictions</code>. Also see: <code>s2Member -> Download Options -> Advanced Mod-Rewrite Linkage</code>. For streaming audio/video files, please review the section below: <code>JW Player® &amp; RTMP Protocol Examples</code>.</em></p>' . "\n";
352
  echo '<p><em><strong>Content Type, Disposition &amp; Inline Files:</strong> An IMPORTANT issue. The query string parameter <code>&amp;s2member_file_inline=yes</code> does NOTHING for files served via Amazon® CloudFront. s2Member has NO control over the <code>Content-Type</code> and/or <code>Content-Disposition</code> headers for a file being served through Amazon® CloudFront, and CloudFront servers do NOT automatically determine the MIME type for the objects they serve. Therefore, when you upload a file to your Amazon® S3 Bucket, you should set its Content-Type header. That is, you MUST configure headers yourself ( such as <code>Content-Type: video/webm</code>, or <code>Content-Disposition: inline|attachment</code> ) that you want Amazon® CloudFront to send for a particular file. It\'s quite easy. You do this by setting <code>Properties -> Metadata ( i.e. headers )</code> on a per-file basis, from inside your Amazon® S3 Management Console. In short, when you upload a file to your Amazon® S3 Bucket, if you want that file to be served a certain way, be sure to configure its <code>Properties -> Metadata</code> accordingly.</em></p>' . "\n";
353
+ echo (stripos (PHP_OS, "win") === 0 && c_ws_plugin__s2member_utils_conds::is_localhost ()) ? '<p><em><strong>Localhost Developers:</strong> s2Member\'s Amazon® CloudFront integration requires the <a href="http://php.net/manual/en/function.openssl-sign.php" target="_blank" rel="external">openssl_sign()</a> function in PHP so it can digitially sign CloudFront® URLs. This function is sometimes problematic on localhost servers such as WAMP &amp; EasyPHP. We recommend installing <a href="http://www.slproweb.com/products/Win32OpenSSL.html" target="_blank" rel="external">this lightweight alternative for Windows®</a> while you\'re developing. s2Member will automatically find it here: <code>C:\OpenSSL-Win[32/64]\bin\openssl.exe</code>.' . ((file_exists ("c:\openssl-win32\bin\openssl.exe") || file_exists ("c:\openssl-win64\bin\openssl.exe")) ? ' <strong class="ws-menu-page-hilite">( s2Member has detected that OpenSSL-Win[32/64] IS installed in the correct location, thank you! )</strong>' : ' <strong class="ws-menu-page-hilite">( s2Member has detected that OpenSSL-Win[32/64] is NOT currently available )</strong>') . '</em></p>' . "\n" : '';
354
  /**/
355
  if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distros_auto_config_status"] === "configured")
356
  echo '<p><em class="ws-menu-page-hilite"><strong>Your Amazon® CloudFront Distributions are: ( ALREADY configured! )</strong></em>' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) ? '<br /><em class="ws-menu-page-hilite">Downloads Distribution CNAME:</em> <em><code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' &mdash;&raquo; ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) ? '<br /><em class="ws-menu-page-hilite">Streaming Distribution CNAME:</em> <em><code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' &mdash;&raquo; ' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : '') . '</p>' . "\n";
includes/menu-pages/els-ops.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
21
  {
@@ -51,10 +51,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
51
  echo '<div class="ws-menu-page-group" title="MailChimp® Integration">' . "\n";
52
  /**/
53
  echo '<div class="ws-menu-page-section ws-plugin--s2member-mailchimp-section">' . "\n";
54
- echo '<a href="http://www.mailchimp.com/signup/?aid=8f347da54d66b5298d13237d9&afl=1" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/mailchimp-stamp.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
55
  echo '<h3>MailChimp® List Server Integration ( optional )</h3>' . "\n";
56
- echo '<p>s2Member can be integrated with MailChimp®. MailChimp® is an email marketing service. MailChimp® makes it easy to send email newsletters to your Customers, manage your MailChimp® subscriber lists, and track campaign performance. Although s2Member can be integrated with almost ANY list server, we highly recommend MailChimp®; because of their <a href="http://apidocs.mailchimp.com/?aid=8f347da54d66b5298d13237d9&afl=1" target="_blank" rel="external">powerful API for MailChimp® services</a>. In future versions of s2Member, we plan to build additional features into s2Member that work with, and extend, MailChimp® services.</p>' . "\n";
57
- echo '<p>For now, we\'ve covered the basics. You can have your Members automatically subscribed to your MailChimp® marketing lists <em>( e.g. newsletters / auto-responders )</em>. You\'ll need a <a href="http://www.mailchimp.com/signup/?aid=8f347da54d66b5298d13237d9&afl=1" target="_blank" rel="external">MailChimp® account</a>, a <a href="https://admin.mailchimp.com/account/api/" target="_blank" rel="external">MailChimp® API Key</a>, and your <a href="#" onclick="alert(\'To obtain your MailChimp® List ID(s), log into your MailChimp® account and click the Lists tab. Now click the (View) button, for the List(s) you want to integrate with s2Member. Then, click the (Settings) link. At the bottom of the (Settings) page, for each list; you\\\'ll find a Unique List ID.\'); return false;">MailChimp® List IDs</a>.</p>' . "\n";
58
  do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_mailchimp", get_defined_vars ());
59
  /**/
60
  echo '<table class="form-table">' . "\n";
@@ -72,7 +72,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
72
  /**/
73
  echo '<td>' . "\n";
74
  echo '<input type="password" name="ws_plugin__s2member_mailchimp_api_key" id="ws-plugin--s2member-mailchimp-api-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]) . '" /><br />' . "\n";
75
- echo 'Once you have a MailChimp® account, you\'ll need to <a href="https://admin.mailchimp.com/account/api/" target="_blank" rel="external">add an API Key</a>.' . "\n";
76
  echo '</td>' . "\n";
77
  /**/
78
  echo '</tr>' . "\n";
@@ -116,10 +116,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
116
  echo '<div class="ws-menu-page-group" title="AWeber® Integration">' . "\n";
117
  /**/
118
  echo '<div class="ws-menu-page-section ws-plugin--s2member-aweber-section">' . "\n";
119
- echo '<a href="http://aweber.com/?348037" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/aweber-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
120
  echo '<h3>AWeber® List Server Integration ( optional )</h3>' . "\n";
121
  echo '<p>s2Member can be integrated with AWeber®. AWeber® is an email marketing service. Whether you\'re looking to get your first email campaign off the ground, or you\'re a seasoned veteran who wants to dig into advanced tools like detailed email web analytics, activity based segmentation, geo-targeting and broadcast split-testing, AWeber\'s got just what you need to make email marketing work for you.</p>' . "\n";
122
- echo '<p>You can have your Members automatically subscribed to your AWeber® marketing lists <em>( e.g. newsletters / auto-responders )</em>. You\'ll need an <a href="http://aweber.com/?348037" target="_blank" rel="external">AWeber® account</a> and your <a href="#" onclick="alert(\'To obtain your AWeber® List ID(s), log into your AWeber® account. Click on the Lists tab. On that page you\\\'ll find a Unique List ID associated with each of your lists. AWeber® sometimes refers to this as a List Name instead of a List ID.\'); return false;">AWeber® List IDs</a>. You will ALSO need to configure a <a href="http://www.primothemes.com/forums/viewtopic.php?f=36&t=15496" target="_blank" rel="external">Custom Email Parser</a> inside your AWeber® account.</p>' . "\n";
123
  echo '<p>Log into AWeber®, and go to <em>My Lists -> Email Parser</em>. If you like, choose the PayPal® Parser <em>( even if you\'re not using PayPal® as your Payment Gateway )</em>. You can safely ignore the additional instructions they provide. s2Member just needs the PayPal® box checked, and that\'s all. Or, even better, integrate <a href="http://www.primothemes.com/forums/viewtopic.php?f=36&t=15496" target="_blank" rel="external">s2Member\'s Custom Email Parser</a> for AWeber, which <strong>will improve reliability</strong> and flexibility.</p>' . "\n";
124
  do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_aweber", get_defined_vars ());
125
  /**/
@@ -226,7 +226,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
226
  echo '<div class="ws-menu-page-section ws-plugin--s2member-opt-out-section">' . "\n";
227
  echo '<h3>Automate Un-Subscribe/Opt-Out Removals ( optional )</h3>' . "\n";
228
  echo '<p>s2Member can automatically <em>( and silently )</em> remove Users/Members from the List Servers you\'ve configured above. s2Member is also capable of automating this, based on your own personal configuration preferences. Below, you can choose which Events you consider grounds for List Removal. It is also important to point out that s2Member will ONLY remove Users/Members from the Lists you\'ve configured at the Level the User/Member is or was at during the time of the Event. For example, if a Level #1 Member is deleted, they will ONLY be removed from the List(s) you\'ve configured at Level #1. If an account is upgraded from Level #1 to Level #2, they will ONLY be removed from the List(s) you\'ve configured at Level #1. Of course, all of this is based on the configuration below.</p>' . "\n";
229
- echo '<p><em><strong>*Regarding AWeber®*</strong> these will NOT work for AWeber® until you <a href="http://www.aweber.com/faq/questions/62/Can+I+Unsubscribe+People+Via+Email%3F" target="_blank" rel="external">add a Notification Email</a> to your AWeber® account matching the "EMail From Address" configured in <code>s2Member -> General Options -> EMail Configuration</code>. Which is currently set to: <code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]) . '</code>. This is a required step if you want s2Member to be authenticated when it emails List Removal requests to AWeber®.</em></p>' . "\n";
230
  do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_opt_out", get_defined_vars ());
231
  /**/
232
  echo '<table class="form-table">' . "\n";
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_els_ops"))
21
  {
51
  echo '<div class="ws-menu-page-group" title="MailChimp® Integration">' . "\n";
52
  /**/
53
  echo '<div class="ws-menu-page-section ws-plugin--s2member-mailchimp-section">' . "\n";
54
+ echo '<a href="http://www.s2member.com/mailchimp" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/mailchimp-stamp.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
55
  echo '<h3>MailChimp® List Server Integration ( optional )</h3>' . "\n";
56
+ echo '<p>s2Member can be integrated with MailChimp®. MailChimp® is an email marketing service. MailChimp® makes it easy to send email newsletters to your Customers, manage your MailChimp® subscriber lists, and track campaign performance. Although s2Member can be integrated with almost ANY list server, we highly recommend MailChimp®; because of their <a href="http://www.s2member.com/mailchimp-api-docs" target="_blank" rel="external">powerful API for MailChimp® services</a>. In future versions of s2Member, we plan to build additional features into s2Member that work with, and extend, MailChimp® services.</p>' . "\n";
57
+ echo '<p>For now, we\'ve covered the basics. You can have your Members automatically subscribed to your MailChimp® marketing lists <em>( e.g. newsletters / auto-responders )</em>. You\'ll need a <a href="http://www.s2member.com/mailchimp" target="_blank" rel="external">MailChimp® account</a>, a <a href="http://www.s2member.com/mailchimp-api-key" target="_blank" rel="external">MailChimp® API Key</a>, and your <a href="#" onclick="alert(\'To obtain your MailChimp® List ID(s), log into your MailChimp® account and click the Lists tab. Now click the (View) button, for the List(s) you want to integrate with s2Member. Then, click the (Settings) link. At the bottom of the (Settings) page, for each list; you\\\'ll find a Unique List ID.\'); return false;">MailChimp® List IDs</a>.</p>' . "\n";
58
  do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_mailchimp", get_defined_vars ());
59
  /**/
60
  echo '<table class="form-table">' . "\n";
72
  /**/
73
  echo '<td>' . "\n";
74
  echo '<input type="password" name="ws_plugin__s2member_mailchimp_api_key" id="ws-plugin--s2member-mailchimp-api-key" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["mailchimp_api_key"]) . '" /><br />' . "\n";
75
+ echo 'Once you have a MailChimp® account, you\'ll need to <a href="http://www.s2member.com/mailchimp-api-key" target="_blank" rel="external">add an API Key</a>.' . "\n";
76
  echo '</td>' . "\n";
77
  /**/
78
  echo '</tr>' . "\n";
116
  echo '<div class="ws-menu-page-group" title="AWeber® Integration">' . "\n";
117
  /**/
118
  echo '<div class="ws-menu-page-section ws-plugin--s2member-aweber-section">' . "\n";
119
+ echo '<a href="http://www.s2member.com/aweber" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/aweber-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
120
  echo '<h3>AWeber® List Server Integration ( optional )</h3>' . "\n";
121
  echo '<p>s2Member can be integrated with AWeber®. AWeber® is an email marketing service. Whether you\'re looking to get your first email campaign off the ground, or you\'re a seasoned veteran who wants to dig into advanced tools like detailed email web analytics, activity based segmentation, geo-targeting and broadcast split-testing, AWeber\'s got just what you need to make email marketing work for you.</p>' . "\n";
122
+ echo '<p>You can have your Members automatically subscribed to your AWeber® marketing lists <em>( e.g. newsletters / auto-responders )</em>. You\'ll need an <a href="http://www.s2member.com/aweber" target="_blank" rel="external">AWeber® account</a> and your <a href="#" onclick="alert(\'To obtain your AWeber® List ID(s), log into your AWeber® account. Click on the Lists tab. On that page you\\\'ll find a Unique List ID associated with each of your lists. AWeber® sometimes refers to this as a List Name instead of a List ID.\'); return false;">AWeber® List IDs</a>. You will ALSO need to configure a <a href="http://www.primothemes.com/forums/viewtopic.php?f=36&t=15496" target="_blank" rel="external">Custom Email Parser</a> inside your AWeber® account.</p>' . "\n";
123
  echo '<p>Log into AWeber®, and go to <em>My Lists -> Email Parser</em>. If you like, choose the PayPal® Parser <em>( even if you\'re not using PayPal® as your Payment Gateway )</em>. You can safely ignore the additional instructions they provide. s2Member just needs the PayPal® box checked, and that\'s all. Or, even better, integrate <a href="http://www.primothemes.com/forums/viewtopic.php?f=36&t=15496" target="_blank" rel="external">s2Member\'s Custom Email Parser</a> for AWeber, which <strong>will improve reliability</strong> and flexibility.</p>' . "\n";
124
  do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_aweber", get_defined_vars ());
125
  /**/
226
  echo '<div class="ws-menu-page-section ws-plugin--s2member-opt-out-section">' . "\n";
227
  echo '<h3>Automate Un-Subscribe/Opt-Out Removals ( optional )</h3>' . "\n";
228
  echo '<p>s2Member can automatically <em>( and silently )</em> remove Users/Members from the List Servers you\'ve configured above. s2Member is also capable of automating this, based on your own personal configuration preferences. Below, you can choose which Events you consider grounds for List Removal. It is also important to point out that s2Member will ONLY remove Users/Members from the Lists you\'ve configured at the Level the User/Member is or was at during the time of the Event. For example, if a Level #1 Member is deleted, they will ONLY be removed from the List(s) you\'ve configured at Level #1. If an account is upgraded from Level #1 to Level #2, they will ONLY be removed from the List(s) you\'ve configured at Level #1. Of course, all of this is based on the configuration below.</p>' . "\n";
229
+ echo '<p><em><strong>*Regarding AWeber®*</strong> these will NOT work for AWeber® until you <a href="http://www.s2member.com/aweber-notification-email" target="_blank" rel="external">add a Notification Email</a> to your AWeber® account matching the "EMail From Address" configured in <code>s2Member -> General Options -> EMail Configuration</code>. Which is currently set to: <code>' . esc_html ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]) . '</code>. This is a required step if you want s2Member to be authenticated when it emails List Removal requests to AWeber®.</em></p>' . "\n";
230
  do_action ("ws_plugin__s2member_during_els_ops_page_during_left_sections_during_opt_out", get_defined_vars ());
231
  /**/
232
  echo '<table class="form-table">' . "\n";
includes/menu-pages/gen-ops.inc.php CHANGED
@@ -158,7 +158,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
158
  echo '<h3>Security Badge &amp; Footer Configuration ( optional )</h3>' . "\n";
159
  echo '<div class="ws-menu-page-right">' . c_ws_plugin__s2member_utilities::s_badge_gen ("1", true, true) . '</div>' . "\n";
160
  echo '<p>An s2Member® Security Badge <em>( optional )</em>, can be used to express your site\'s concern for security; demonstrating to all Users/Members that your site <em>( and the s2Member software )</em>, takes security seriously. However, in order to qualify your site, you MUST generate a Security Encryption Key <em>( previous section )</em>, and then click "Save All Changes". Only then, will s2Member officially verify your installation <em>( verification occurs automatically )</em>.</p>' . "\n";
161
- echo '<p>Once you\'ve properly configured all aspects of s2Member, your s2Member® Security Badge will be verified. To see the "verified" version of your Security Badge, you might need to refresh your browser after saving all changes <em>( i.e. after you create a Security Encryption Key )</em>. Also, s2Member will NOT "verify" your site if you turn off Unique IP Restrictions, Brute Force Login Protection, or if your <code>/wp-config.php</code> file lacks <a href="http://codex.wordpress.org/Editing_wp-config.php#Security_Keys" target="_blank" rel="external">Security Keys</a> <em>( each at least 60 chars in length )</em>. In addition, it\'s NOT possible for s2Member to verify your Security Badge, if your site is in a <code>localhost</code> environment; i.e. not connected to the web.</p>' . "\n";
162
  echo '<p><strong>How does s2Member know when my site is secure?</strong><br />If enabled below, an API call for "Security Badge Status", will allow web service connections to determine your status. Clicking <a href="' . esc_attr (site_url ("/?s2member_s_badge_status=1")) . '" target="_blank" rel="external">this link</a> will report <code>1</code> <em>( secure )</em>, <code>0</code> <em>( at risk )</em>, or <code>-</code> <em>( API disabled )</em>. Once all security considerations are satisfied, s2Member will report <code>1</code> <em>( secure )</em> for your installation. *Note, this simple API will NOT, and should not, report any other information. It will ONLY report the current status of your Security Badge, as determined by your installation of s2Member. When/if you install the s2Member Security Badge, s2Member will make a connection to your site "once per day", to test your status.</p>' . "\n";
163
  do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_s_badge_wp_footer_code", get_defined_vars ());
164
  /**/
158
  echo '<h3>Security Badge &amp; Footer Configuration ( optional )</h3>' . "\n";
159
  echo '<div class="ws-menu-page-right">' . c_ws_plugin__s2member_utilities::s_badge_gen ("1", true, true) . '</div>' . "\n";
160
  echo '<p>An s2Member® Security Badge <em>( optional )</em>, can be used to express your site\'s concern for security; demonstrating to all Users/Members that your site <em>( and the s2Member software )</em>, takes security seriously. However, in order to qualify your site, you MUST generate a Security Encryption Key <em>( previous section )</em>, and then click "Save All Changes". Only then, will s2Member officially verify your installation <em>( verification occurs automatically )</em>.</p>' . "\n";
161
+ echo '<p>Once you\'ve <a href="http://www.primothemes.com/forums/viewtopic.php?f=4&t=15600&p=48551#p48550" target="_blank" rel="external">properly configured all security aspects of s2Member</a>, your s2Member® Security Badge will be verified. To see the "verified" version of your Security Badge, you might need to refresh your browser after saving all changes <em>( i.e. after you create a Security Encryption Key )</em>. Also, s2Member will NOT "verify" your site if you turn off Unique IP Restrictions, Brute Force Login Protection, or if your <code>/wp-config.php</code> file lacks <a href="http://codex.wordpress.org/Editing_wp-config.php#Security_Keys" target="_blank" rel="external">Security Keys</a> <em>( each at least 60 chars in length )</em>. In addition, it\'s NOT possible for s2Member to verify your Security Badge, if your site is in a <code>localhost</code> environment; i.e. not connected to the web.</p>' . "\n";
162
  echo '<p><strong>How does s2Member know when my site is secure?</strong><br />If enabled below, an API call for "Security Badge Status", will allow web service connections to determine your status. Clicking <a href="' . esc_attr (site_url ("/?s2member_s_badge_status=1")) . '" target="_blank" rel="external">this link</a> will report <code>1</code> <em>( secure )</em>, <code>0</code> <em>( at risk )</em>, or <code>-</code> <em>( API disabled )</em>. Once all security considerations are satisfied, s2Member will report <code>1</code> <em>( secure )</em> for your installation. *Note, this simple API will NOT, and should not, report any other information. It will ONLY report the current status of your Security Badge, as determined by your installation of s2Member. When/if you install the s2Member Security Badge, s2Member will make a connection to your site "once per day", to test your status.</p>' . "\n";
163
  do_action ("ws_plugin__s2member_during_gen_ops_page_during_left_sections_during_s_badge_wp_footer_code", get_defined_vars ());
164
  /**/
includes/menu-pages/integrations.inc.php CHANGED
@@ -45,12 +45,12 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_integrations"))
45
  {
46
  do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_before_bbpress", get_defined_vars ());
47
  /**/
48
- echo '<div class="ws-menu-page-group" title="bbPress® Plugin Integration ( 2.0+ plugin version )">' . "\n";
49
  /**/
50
  echo '<div class="ws-menu-page-section ws-plugin--s2member-bbpress-section">' . "\n";
51
  echo '<h3>bbPress® Plugin Integration ( easy peasy )</h3>' . "\n";
52
  echo '<input type="button" value="Update Roles/Capabilities" class="ws-menu-page-right ws-plugin--s2member-update-roles-button" style="min-width:175px;" />' . "\n";
53
- echo '<p>The plugin version of <a href="http://bbpress.org/" target="_blank" rel="external">bbPress® 2.0+</a> integrates seamlessly with WordPress®. If bbPress® was already installed when you activated s2Member, your s2Member Roles/Capabilities are already configured to work in harmony with bbPress®. If you didn\'t, you can simply click the "Update Roles/Capabilities" button here. That\'s all it takes. Once your Roles/Capbilities are updated, s2Member and bbPress® are fully integrated with each other.</p>' . "\n";
54
  echo '<h3>bbPress® Forums and s2Member Roles/Capabilities</h3>' . "\n";
55
  echo '<p>s2Member configures your Membership Roles ( by default, these include: <em>s2Member Level 1</em>, <em>s2Member Level 2</em>, <em>s2Member Level 3</em>, <em>s2Member Level 4</em> ), with a default set of permissions that allow all Members to access and particpate in your forums, just as if they were a WordPress® Subscriber Role. This is how bbPress® expects s2Member to behave. bbPress® also adds a new Role to your WordPress® installation: <em>Forum Moderator</em>. s2Member allows Forum Moderators full access to all content protected by s2Member, just like <em>Administrators</em>, <em>Editors</em>, <em>Authors</em>, and <em>Contributors</em>.</p>' . "\n";
56
  echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
@@ -65,97 +65,6 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_integrations"))
65
  /**/
66
  do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_after_bbpress", get_defined_vars ());
67
  }
68
- /* This remains for backward compatibility with bbPress® v1.0.3 and prior. */
69
- if (apply_filters ("ws_plugin__s2member_during_integrations_page_during_left_sections_display_bbpress", true, get_defined_vars ()))
70
- {
71
- do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_before_bbpress", get_defined_vars ());
72
- /**/
73
- echo '<div class="ws-menu-page-group" title="bbPress® Bridge Integration ( 1.0.3- legacy )">' . "\n";
74
- /**/
75
- echo '<div class="ws-menu-page-section ws-plugin--s2member-bbpress-section">' . "\n";
76
- echo '<h3>bbPress® Bridge Integration ( install/uninstall )</h3>' . "\n";
77
- echo '<p>If you\'re running <a href="http://bbpress.org/" target="_blank" rel="external">bbPress® forums</a> v1.0.3 or prior, you can protect them with the s2Member plugin. BUT, you will need to install this Bridge/plugin first. This bbPress® Bridge/plugin will block all non-Member access to your forums. Only the bbPress® login-page will be available. Forum registration will be redirected to your Membership Options Page for s2Member <em>( on your main WordPress® installation )</em>. This way, a visitor can signup on your site, and gain Membership Access to your forums.</p>' . "\n";
78
- echo '<p><em>* This Bridge/plugin will NOT work, until you\'ve successfully integrated WordPress® into bbPress®. For more information, log into your bbPress® Dashboard, and go to: <code>bbPress® -> Settings -> WordPress® Integration</code>. Once you have WordPress® integrated ( <a href="http://wordpress.org/extend/plugins/bbpress-integration/" target="_blank" rel="external">install this plugin</a> ) and follow the instructions regarding your <code>/wp-config.php</code> file. Then, come back here, and install the s2Member Bridge/plugin. * This Bridge Integration could also be installed manually. You\'ll find the bbPress® Bridge/plugin inside <code>/s2member/includes/dropins/bridges/_s2member-bbpress-bridge.php</code>. Pop that file into the `my-plugins/` directory for bbPress®, or just click the Install button below; s2Member will do this part for you automatically.</em></p>' . "\n";
79
- echo '<p><em>* This Bridge/plugin will also add a PHP Conditional Tag to your installation of bbPress®. This is 100% optional. Once installed, you could do something like this inside your bbPress® theme files with PHP code: ' . c_ws_plugin__s2member_utils_strings::highlight_php ('<?php if(current_wp_user_is("s2member_level2")){ /* Content. */ } ?>') . ' ... you can test for any WordPress® Role. The most common Roles associated with s2Member are: <code>subscriber</code>, <code>s2member_level1</code>, <code>s2member_level2</code>, <code>s2member_level3</code>, <code>s2member_level4</code>. This may come in handy for a developer integrating bbPress® in creative ways.</em></p>' . "\n";
80
- do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_during_api_easy_way", get_defined_vars ());
81
- /**/
82
- echo '<form method="post" name="ws_plugin__s2member_bridge_bbpress_form" id="ws-plugin--s2member-bridge-bbpress-form">' . "\n";
83
- echo '<input type="hidden" name="ws_plugin__s2member_bridge_bbpress" id="ws-plugin--s2member-bridge-bbpress" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-bridge-bbpress")) . '" />' . "\n";
84
- /**/
85
- echo '<table class="form-table">' . "\n";
86
- echo '<tbody>' . "\n";
87
- echo '<tr>' . "\n";
88
- /**/
89
- echo '<th>' . "\n";
90
- echo '<label for="ws_plugin--s2member-bridge-bbpress-plugins-dir">' . "\n";
91
- echo 'Server path to your bbPress® plugins directory:' . "\n";
92
- echo '</label>' . "\n";
93
- echo '</th>' . "\n";
94
- /**/
95
- echo '</tr>' . "\n";
96
- echo '<tr>' . "\n";
97
- /**/
98
- echo '<td>' . "\n";
99
- echo '<input type="text" name="ws_plugin__s2member_bridge_bbpress_plugins_dir" id="ws_plugin--s2member-bridge-bbpress-plugins-dir" value="' . format_to_edit ($_POST["ws_plugin__s2member_bridge_bbpress_plugins_dir"]) . '" /><br />' . "\n";
100
- echo 'Something like: <code>' . esc_html (rtrim ($_SERVER["DOCUMENT_ROOT"], DIRECTORY_SEPARATOR . "/") . "/bbpress/my-plugins") . '</code>' . "\n";
101
- echo '</td>' . "\n";
102
- /**/
103
- echo '</tr>' . "\n";
104
- echo '<tr>' . "\n";
105
- /**/
106
- echo '<th>' . "\n";
107
- echo '<label for="ws_plugin--s2member-bridge-bbpress-ovg">' . "\n";
108
- echo 'Allow Open Viewing? ( can public visitors read forum posts? )' . "\n";
109
- echo '</label>' . "\n";
110
- echo '</th>' . "\n";
111
- /**/
112
- echo '</tr>' . "\n";
113
- echo '<tr>' . "\n";
114
- /**/
115
- echo '<td>' . "\n";
116
- echo '<select name="ws_plugin__s2member_bridge_bbpress_ovg" id="ws-plugin--s2member-bbpress-ovg">' . "\n";
117
- echo '<option value="0"' . ((!$_POST["ws_plugin__s2member_bridge_bbpress_min_level"]) ? ' selected="selected"' : '') . '>No ( my bbPress® forums are off-limits to the public )</option>' . "\n";
118
- echo '<option value="1"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"]) ? ' selected="selected"' : '') . '>Yes ( enable Open Viewing for public visitors ) read-only</option>' . "\n";
119
- echo '</select><span id="ws-plugin--s2member-bbpress-ovg-off-note" style="display:none;"><br />When this is <code>No</code>, the next setting below will include both read-access &amp; participation together ( as one concept ).</span>' . "\n";
120
- echo '</td>' . "\n";
121
- /**/
122
- echo '</tr>' . "\n";
123
- echo '<tr>' . "\n";
124
- /**/
125
- echo '<th>' . "\n";
126
- echo '<label for="ws_plugin--s2member-bridge-bbpress-min-level">' . "\n";
127
- echo 'Minimum Level to participate in your bbPress® forums.' . "\n";
128
- echo '</label>' . "\n";
129
- echo '</th>' . "\n";
130
- /**/
131
- echo '</tr>' . "\n";
132
- echo '<tr>' . "\n";
133
- /**/
134
- echo '<td>' . "\n";
135
- echo '<select name="ws_plugin__s2member_bridge_bbpress_min_level" id="ws-plugin--s2member-bbpress-min-level">' . "\n";
136
- echo '<option value="0"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "0") ? ' selected="selected"' : '') . '>Require s2Member Level #0 ( to participate )</option>' . "\n";
137
- echo '<option value="1"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "1") ? ' selected="selected"' : '') . '>Require s2Member Level #1 ( to participate )</option>' . "\n";
138
- echo '<option value="2"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "2") ? ' selected="selected"' : '') . '>Require s2Member Level #2 ( to participate )</option>' . "\n";
139
- echo '<option value="3"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "3") ? ' selected="selected"' : '') . '>Require s2Member Level #3 ( to participate )</option>' . "\n";
140
- echo '<option value="4"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "4") ? ' selected="selected"' : '') . '>Require s2Member Level #4 ( to participate )</option>' . "\n";
141
- echo '</select>' . "\n";
142
- echo '</td>' . "\n";
143
- /**/
144
- echo '</tr>' . "\n";
145
- echo '</tbody>' . "\n";
146
- echo '</table>' . "\n";
147
- /**/
148
- echo '<br />' . "\n";
149
- /**/
150
- echo '<p class="submit"><input type="submit" name="ws_plugin__s2member_bridge_bbpress_action" class="button-primary" value="Install / Re-Install" /> &nbsp;&nbsp; <input type="submit" name="ws_plugin__s2member_bridge_bbpress_action" class="button-primary" value="Un-Install" /></p>' . "\n";
151
- /**/
152
- echo '</form>' . "\n";
153
- echo '</div>' . "\n";
154
- /**/
155
- echo '</div>' . "\n";
156
- /**/
157
- do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_after_bbpress", get_defined_vars ());
158
- }
159
  /**/
160
  do_action ("ws_plugin__s2member_during_integrations_page_after_left_sections", get_defined_vars ());
161
  /**/
45
  {
46
  do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_before_bbpress", get_defined_vars ());
47
  /**/
48
+ echo '<div class="ws-menu-page-group" title="bbPress® Plugin Integration ( 2.0+ plugin version )" default-state="open">' . "\n";
49
  /**/
50
  echo '<div class="ws-menu-page-section ws-plugin--s2member-bbpress-section">' . "\n";
51
  echo '<h3>bbPress® Plugin Integration ( easy peasy )</h3>' . "\n";
52
  echo '<input type="button" value="Update Roles/Capabilities" class="ws-menu-page-right ws-plugin--s2member-update-roles-button" style="min-width:175px;" />' . "\n";
53
+ echo '<p>The plugin version of <a href="http://www.s2member.com/bbpress-plugin" target="_blank" rel="external">bbPress® 2.0+</a> integrates seamlessly with WordPress®. If bbPress® was already installed when you activated s2Member, your s2Member Roles/Capabilities are already configured to work in harmony with bbPress®. If you didn\'t, you can simply click the "Update Roles/Capabilities" button here. That\'s all it takes. Once your Roles/Capbilities are updated, s2Member and bbPress® are fully integrated with each other.</p>' . "\n";
54
  echo '<h3>bbPress® Forums and s2Member Roles/Capabilities</h3>' . "\n";
55
  echo '<p>s2Member configures your Membership Roles ( by default, these include: <em>s2Member Level 1</em>, <em>s2Member Level 2</em>, <em>s2Member Level 3</em>, <em>s2Member Level 4</em> ), with a default set of permissions that allow all Members to access and particpate in your forums, just as if they were a WordPress® Subscriber Role. This is how bbPress® expects s2Member to behave. bbPress® also adds a new Role to your WordPress® installation: <em>Forum Moderator</em>. s2Member allows Forum Moderators full access to all content protected by s2Member, just like <em>Administrators</em>, <em>Editors</em>, <em>Authors</em>, and <em>Contributors</em>.</p>' . "\n";
56
  echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
65
  /**/
66
  do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_after_bbpress", get_defined_vars ());
67
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  /**/
69
  do_action ("ws_plugin__s2member_during_integrations_page_after_left_sections", get_defined_vars ());
70
  /**/
includes/menu-pages/paypal-buttons.inc.php CHANGED
@@ -176,7 +176,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
176
  echo '</select></p>' . "\n";
177
  /**/
178
  echo '<p id="ws-plugin--s2member-modification-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-modification-trial-term">' . trim (c_ws_plugin__s2member_utilities::evl (file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" id="ws-plugin--s2member-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
179
- 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">' . trim (c_ws_plugin__s2member_utilities::evl (file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.php"))) . '</select><span id="ws-plugin--s2member-modification-20p-rule"><br /><small>* Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details are <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_WPRecurringPayments#id086530108PM__id08653060UE6" target="_blank" rel="external">documented here</a>.<br />* <strong>Tip</strong> <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a> are NOT subjected to this ridiculous 20% rule.</small></span></p>' . "\n";
180
  echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency">' . trim (c_ws_plugin__s2member_utilities::evl (file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
181
  echo '<p>Description: <input type="text" id="ws-plugin--s2member-modification-desc" value="Description and pricing details here." size="73" /></p>' . "\n";
182
  echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-modification-ccaps" size="40" maxlength="125" /></p>' . "\n";
@@ -456,28 +456,18 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
456
  echo '<p><select id="ws-plugin--s2member-sp-leading-id">' . "\n";
457
  echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
458
  /**/
459
- $ws_plugin__s2member_temp_a_pp = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) ? (array)get_posts ("post_type=any&include=" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) : array ();
460
  /**/
461
- $ws_plugin__s2member_temp_a_pp_excludes = array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
462
- /**/
463
- for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
464
- $ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
465
- /**/
466
- for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
467
- $ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
468
- /**/
469
- foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
470
- if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
471
- echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
472
  /**/
473
  echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
474
  /**/
475
  echo '<p><select id="ws-plugin--s2member-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
476
  echo '<optgroup label="&mdash; Package Additional Posts/Pages that you\'ve protected &mdash;">' . "\n";
477
  /**/
478
- foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
479
- if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
480
- echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
481
  /**/
482
  echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
483
  /**/
@@ -550,28 +540,18 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
550
  echo '<p><select id="ws-plugin--s2member-sp-link-leading-id">' . "\n";
551
  echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
552
  /**/
553
- $ws_plugin__s2member_temp_a_pp = ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) ? (array)get_posts ("post_type=any&include=" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["specific_ids"]) : array ();
554
- /**/
555
- $ws_plugin__s2member_temp_a_pp_excludes = array ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]);
556
- /**/
557
- for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
558
- $ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]));
559
- /**/
560
- for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
561
- $ws_plugin__s2member_temp_a_pp_excludes = array_merge ($ws_plugin__s2member_temp_a_pp_excludes, preg_split ("/[\r\n\t\s;,]+/", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_pages"]));
562
  /**/
563
- foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
564
- if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
565
- echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
566
  /**/
567
  echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
568
  /**/
569
  echo '<p><select id="ws-plugin--s2member-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n";
570
  echo '<optgroup label="&mdash; Package Additional Posts/Pages that you\'ve protected &mdash;">' . "\n";
571
  /**/
572
- foreach (($ws_plugin__s2member_temp_a = $ws_plugin__s2member_temp_a_pp) as $ws_plugin__s2member_temp_o)
573
- if (!in_array ($ws_plugin__s2member_temp_o->ID, $ws_plugin__s2member_temp_a_pp_excludes))
574
- echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
575
  /**/
576
  echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
577
  /**/
@@ -612,7 +592,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_buttons"))
612
  echo (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? '<li><code>ccaps="music,videos"</code> A comma-delimited list of Custom Capabilities. Only valid w/ Membership Level Access and/or Independent Custom Capabilities.</li>' . "\n" : '';
613
  echo '<li><code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '"</code> must start with your domain. Additional values can be piped in ( ex: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3|etc"</code> ). Not valid when <code>cancel="1"</code>.</li>' . "\n";
614
  echo '<li><code>desc="Gold Membership"</code> A brief purchase Description. Not valid when <code>cancel="1"</code>.</li>' . "\n";
615
- echo '<li><code>dg="0"</code> The Digital Goods directive. s2Member will eventually be integrated with <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_IntroducingExpressCheckoutDG" target="_blank" rel="external">Digital Goods</a> for inline Express Checkout. But for now, this should always be <code>0</code>.</li>' . "\n";
616
  echo '<li><code>exp="72"</code> Access Expires ( in hours ). Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
617
  echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
618
  echo '<li><code>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default PayPal® Button, <code>http://...</code> = location of your custom Image.</li>' . "\n";
176
  echo '</select></p>' . "\n";
177
  /**/
178
  echo '<p id="ws-plugin--s2member-modification-trial-line">I\'ll offer the first <input type="text" id="ws-plugin--s2member-modification-trial-period" value="0" size="6" /> <select id="ws-plugin--s2member-modification-trial-term">' . trim (c_ws_plugin__s2member_utilities::evl (file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-trial-terms.php"))) . '</select> @ $<input type="text" id="ws-plugin--s2member-modification-trial-amount" value="0.00" size="4" /></p>' . "\n";
179
+ 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">' . trim (c_ws_plugin__s2member_utilities::evl (file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-membership-regular-terms.php"))) . '</select><span id="ws-plugin--s2member-modification-20p-rule"><br /><small>* Watch out for <a href="https://www.x.com/thread/41748" target="_blank" rel="external">the 20% rule</a>. Additional details are <a href="http://www.s2member.com/paypal-20p-rule" target="_blank" rel="external">documented here</a>.<br />* <strong>Tip</strong> <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a> are NOT subjected to this ridiculous 20% rule.</small></span></p>' . "\n";
180
  echo '<p>Checkout Page Style <a href="#" onclick="alert(\'Optional. This can be configured inside your PayPal® account. PayPal® allows you to create Custom Page Styles, and assign a unique name to them. You can add your own header image and color selection to the checkout form. Once you\\\'ve created a Custom Page Style at PayPal®, you can enter that Page Style here.\\n\\nIn addition. The Shortcode below, provided by s2Member; supports an image attribute: image=\\\'\\\'default\\\'\\\'. This can be changed to a full URL, pointing to a custom image of your own; instead of the default PayPal® Button image.\'); return false;" tabindex="-1">[?]</a>: <input type="text" id="ws-plugin--s2member-modification-page-style" value="paypal" size="18" /> <select id="ws-plugin--s2member-modification-currency">' . trim (c_ws_plugin__s2member_utilities::evl (file_get_contents (dirname (dirname (__FILE__)) . "/templates/options/paypal-currencies.php"))) . '</select> <input type="button" value="Generate Button Code" onclick="ws_plugin__s2member_paypalButtonGenerate(\'modification\');" class="button-primary" /></p>' . "\n";
181
  echo '<p>Description: <input type="text" id="ws-plugin--s2member-modification-desc" value="Description and pricing details here." size="73" /></p>' . "\n";
182
  echo '<p' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? ' style="display:none;"' : '') . '>Custom Capabilities ( comma-delimited ) <a href="#" onclick="alert(\'Optional. This is VERY advanced.\\nSee: s2Member -> API Scripting -> Custom Capabilities.\\n\\n*ADVANCED TIP: You can specifiy a list of Custom Capabilities that will be (Added) with this purchase. Or, you could tell s2Member to (Remove All) Custom Capabilities that may or may not already exist for a particular Member, and (Add) only the new ones that you specify. To do this, just start your list of Custom Capabilities with `-all`.\\n\\nSo instead of just (Adding) Custom Capabilities:\\nmusic,videos,archives,gifts\\n\\nYou could (Remove All) that may already exist, and then (Add) new ones:\\n-all,calendar,forums,tools\\n\\nOr to just (Remove All) and (Add) nothing:\\n-all\'); return false;" tabindex="-1">[?]</a> <input type="text" id="ws-plugin--s2member-modification-ccaps" size="40" maxlength="125" /></p>' . "\n";
456
  echo '<p><select id="ws-plugin--s2member-sp-leading-id">' . "\n";
457
  echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
458
  /**/
459
+ $ws_plugin__s2member_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp ("exclude-conflicts");
460
  /**/
461
+ foreach ($ws_plugin__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o)
462
+ echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
 
 
 
 
 
 
 
 
 
463
  /**/
464
  echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
465
  /**/
466
  echo '<p><select id="ws-plugin--s2member-sp-additional-ids" multiple="multiple" style="height:100px;">' . "\n";
467
  echo '<optgroup label="&mdash; Package Additional Posts/Pages that you\'ve protected &mdash;">' . "\n";
468
  /**/
469
+ foreach ($ws_plugin__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o)
470
+ echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
 
471
  /**/
472
  echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
473
  /**/
540
  echo '<p><select id="ws-plugin--s2member-sp-link-leading-id">' . "\n";
541
  echo '<option value="">&mdash; Select a Leading Post/Page that you\'ve protected &mdash;</option>' . "\n";
542
  /**/
543
+ $ws_plugin__s2member_temp_a_singulars = c_ws_plugin__s2member_utils_gets::get_all_singulars_with_sp ("exclude-conflicts");
 
 
 
 
 
 
 
 
544
  /**/
545
+ foreach ($ws_plugin__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o)
546
+ echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
 
547
  /**/
548
  echo '</select> <a href="#" onclick="alert(\'Required. The Leading Post/Page, is what your Customers will land on after checkout.\n\n*Tip* If there are no Posts/Pages in the menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
549
  /**/
550
  echo '<p><select id="ws-plugin--s2member-sp-link-additional-ids" multiple="multiple" style="height:100px; min-width:450px;">' . "\n";
551
  echo '<optgroup label="&mdash; Package Additional Posts/Pages that you\'ve protected &mdash;">' . "\n";
552
  /**/
553
+ foreach ($ws_plugin__s2member_temp_a_singulars as $ws_plugin__s2member_temp_o)
554
+ echo '<option value="' . esc_attr ($ws_plugin__s2member_temp_o->ID) . '">' . esc_html ($ws_plugin__s2member_temp_o->post_title) . '</option>' . "\n";
 
555
  /**/
556
  echo '</optgroup></select> <a href="#" onclick="alert(\'Hold down your `Ctrl` key to select multiples.\\n\\nOptional. If you include Additional Posts/Pages, Customers will still land on your Leading Post/Page; BUT, they\\\'ll ALSO have access to some Additional Posts/Pages that you\\\'ve protected. This gives you the ability to create Post/Page Packages.\\n\\nIn other words, a Customer is sold a Specific Post/Page ( they\\\'ll land on your Leading Post/Page after checkout ), which might contain links to some other Posts/Pages that you\\\'ve packaged together under one transaction.\\n\\nBundling Additional Posts/Pages into one Package, authenticates the Customer for access to the Additional Posts/Pages automatically ( e.g. only one Access Link is needed, and s2Member generates this automatically ). However, you will STILL need to design your Leading Post/Page ( which is what a Customer will actually land on ), with links pointing to the other Posts/Pages. This way your Customers will have clickable links to everything they\\\'ve paid for.\\n\\n*Quick Summary* s2Member sends Customers to your Leading Post/Page, and also authenticates them for access to any Additional Posts/Pages automatically. You handle it from there.\\n\\n*Tip* If there are no Posts/Pages in this menu, it\\\'s because you\\\'ve not configured s2Member for Specific Post/Page Access yet. See: s2Member -> Restriction Options -> Specific Post/Page Access.\'); return false;" tabindex="-1">[?]</a></p>' . "\n";
557
  /**/
592
  echo (!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? '<li><code>ccaps="music,videos"</code> A comma-delimited list of Custom Capabilities. Only valid w/ Membership Level Access and/or Independent Custom Capabilities.</li>' . "\n" : '';
593
  echo '<li><code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '"</code> must start with your domain. Additional values can be piped in ( ex: <code>custom="' . esc_html ($_SERVER["HTTP_HOST"]) . '|cv1|cv2|cv3|etc"</code> ). Not valid when <code>cancel="1"</code>.</li>' . "\n";
594
  echo '<li><code>desc="Gold Membership"</code> A brief purchase Description. Not valid when <code>cancel="1"</code>.</li>' . "\n";
595
+ echo '<li><code>dg="0"</code> The Digital Goods directive. s2Member will eventually be integrated with <a href="http://www.s2member.com/paypal-express-co-digitals" target="_blank" rel="external">Digital Goods</a> for inline Express Checkout. But for now, this should always be <code>0</code>.</li>' . "\n";
596
  echo '<li><code>exp="72"</code> Access Expires ( in hours ). Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
597
  echo '<li><code>ids="14"</code> A Post/Page ID#, or a comma-delimited list of IDs. Only valid when <code>sp="1"</code> for Specific Post/Page Access.</li>' . "\n";
598
  echo '<li><code>image="default"</code> Button Image Location. Possible values: <code>default</code> = use the default PayPal® Button, <code>http://...</code> = location of your custom Image.</li>' . "\n";
includes/menu-pages/paypal-ops.inc.php CHANGED
@@ -52,10 +52,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_ops"))
52
  echo '<div class="ws-menu-page-group" title="PayPal® Account Details">' . "\n";
53
  /**/
54
  echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-account-details-section">' . "\n";
55
- echo '<a href="https://www.paypal.com/us/mrb/pal=KMEJ5UCMUQVAW" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/paypal-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
56
  echo '<h3>PayPal® Account Details ( required, if using PayPal® )</h3>' . "\n";
57
- echo '<p>This plugin works in conjunction with <a href="https://www.paypal.com/us/mrb/pal=KMEJ5UCMUQVAW" target="_blank" rel="external">PayPal® Website Payments Standard</a>, for businesses. You do NOT need a PayPal® Pro account. You just need to upgrade your Personal PayPal® account to a Business status, which is free. A PayPal® account can be <a href="http://pages.ebay.com/help/buy/questions/upgrade-paypal-account.html" target="_blank" rel="external">upgraded</a> from a Personal account to a Business account, simply by going to the `Profile` button under the `My Account` tab, selecting the `Personal Business Information` button, and then clicking the `Upgrade Your Account` button.</p>' . "\n";
58
- echo '<p><em><strong>*PayPal® API Credentials*</strong> Once you have a PayPal® Business account, you\'ll need access to your <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_profile-api-access" target="_blank" rel="external">PayPal® API Credentials</a>. Log into your PayPal® account, and navigate to <code>Profile -> API Access (or Request API Credentials)</code>. You\'ll choose <code>( Request API Signature )</code>.</em></p>' . "\n";
59
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_details", get_defined_vars ());
60
  /**/
61
  echo '<table class="form-table">' . "\n";
@@ -149,7 +149,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_ops"))
149
  /**/
150
  echo '<td>' . "\n";
151
  echo '<input type="radio" name="ws_plugin__s2member_paypal_sandbox" id="ws-plugin--s2member-paypal-sandbox-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-sandbox-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_paypal_sandbox" id="ws-plugin--s2member-paypal-sandbox-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-sandbox-1">Yes, enable support for Sandbox testing.</label><br />' . "\n";
152
- echo '<em>Only enable this if you\'ve provided Sandbox credentials above.<br />This puts the API, IPN, PDT and Form/Button Generators all into Sandbox mode.<br />See: <a href="https://developer.paypal.com/" target="_blank" rel="external">https://developer.paypal.com</a></em>' . "\n";
153
  echo '</td>' . "\n";
154
  /**/
155
  echo '</tr>' . "\n";
@@ -221,7 +221,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_ops"))
221
  /**/
222
  echo '<h3>More Information ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-details\').toggle(); return false;" class="ws-dotted-link">click here</a> )</h3>' . "\n";
223
  echo '<div id="ws-plugin--s2member-paypal-ipn-details" style="display:none;">' . "\n";
224
- echo '<p><em><strong>*Quick Tip*</strong> In addition to the <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNSetup" target="_blank" rel="external">default IPN settings inside your PayPal® account</a>, the IPN URL is also set on a per-transaction basis by the special PayPal® Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal® account, that\'s OK. s2Member dynamically sets the IPN URL for each transaction. The result is that the IPN URL configured from within your PayPal® account, becomes the default, which is then overwritten on a per-transaction basis. In fact, PayPal® recently updated their system to support IPN URL preservation. One PayPal® account can handle multiple sites, all using different IPN URLs.</em></p>' . "\n";
225
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_quick_tip", get_defined_vars ());
226
  echo '<p><em><strong>*IPN Communications*</strong> You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds &amp; chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene. The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</em></p>' . "\n";
227
  echo '</div>' . "\n";
@@ -232,7 +232,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_ops"))
232
  echo '<div id="ws-plugin--s2member-paypal-ipn-proxy-details" style="display:none;">' . "\n";
233
  echo '<p>If you\'re using a 3rd-party application that needs to POST simulated IPN transactions to your s2Member installation, you can use this alternate IPN URL, which includes a Proxy Key. This encrypted Proxy Key verifies incoming data being received by s2Member\'s IPN processor. You can change <em>[proxy-gateway]</em> to whatever you like. The <em>[proxy-gateway]</em> value is required. It will be stored by s2Member as the Customer\'s Paid Subscr. Gateway. Your [proxy-gateway] value will also be reflected in s2Member\'s IPN log.</p>' . "\n";
234
  echo '<input type="text" value="' . format_to_edit (site_url ("/?s2member_paypal_notify=1&s2member_paypal_proxy=[proxy-gateway]&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen ()))) . '" style="width:99%;" />' . "\n";
235
- echo '<p><em>Any 3rd-party application that is sending IPN transactions to your s2Member installation, must ALWAYS include the <code>custom</code> POST variable, and that variable must always start with your installation domain ( i.e. custom=<code>' . esc_html ($_SERVER["HTTP_HOST"]) . '</code> ). In addition, the <code>item_number</code> variable, must always match a format that s2Member looks for. Generally speaking, the <code>item_number</code> should be <code>1, 2, 3, or 4</code>, indicating a specific s2Member Level #. However, s2Member also uses some advanced formats in this field. Just to be sure, we suggest creating a PayPal® Button with the s2Member Button Generator, and then taking a look at the Full Button Code to see how s2Member expects <code>item_number</code> to be formatted. Other than the aforementioned exceptions; all other POST variables should follow PayPal® standards. Please see: <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables" target="_blank" rel="external">PayPal\'s IPN/PDT reference guide</a> for full documentation.</em></p>' . "\n";
236
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_proxy", get_defined_vars ());
237
  echo '</div>' . "\n";
238
  echo '</div>' . "\n";
@@ -282,7 +282,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_paypal_ops"))
282
  /**/
283
  echo '<h3>More Information ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-pdt-details\').toggle(); return false;" class="ws-dotted-link">click here</a> )</h3>' . "\n";
284
  echo '<div id="ws-plugin--s2member-paypal-pdt-details" style="display:none;">' . "\n";
285
- echo '<p><em><strong>*Quick Tip*</strong> In addition to the <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_paymentdatatransfer" target="_blank" rel="external">default Auto-Return/PDT configuration inside your PayPal® account</a>, the Auto-Return URL is also set on a per-transaction basis from within the special PayPal® Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal® account, that\'s OK. s2Member dynamically sets the Auto-Return URL for each transaction. The result is that the Auto-Return URL configured from within your PayPal® account, becomes the default, which is then overwritten on a per-transaction basis.</em></p>' . "\n";
286
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt_after_quick_tip", get_defined_vars ());
287
  echo '</div>' . "\n";
288
  /**/
52
  echo '<div class="ws-menu-page-group" title="PayPal® Account Details">' . "\n";
53
  /**/
54
  echo '<div class="ws-menu-page-section ws-plugin--s2member-paypal-account-details-section">' . "\n";
55
+ echo '<a href="http://www.s2member.com/paypal" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/paypal-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
56
  echo '<h3>PayPal® Account Details ( required, if using PayPal® )</h3>' . "\n";
57
+ echo '<p>This plugin works in conjunction with <a href="http://www.s2member.com/paypal" target="_blank" rel="external">PayPal® Website Payments Standard</a>, for businesses. You do NOT need a PayPal® Pro account. You just need to upgrade your Personal PayPal® account to a Business status, which is free. A PayPal® account can be <a href="http://pages.ebay.com/help/buy/questions/upgrade-paypal-account.html" target="_blank" rel="external">upgraded</a> from a Personal account to a Business account, simply by going to the `Profile` button under the `My Account` tab, selecting the `Personal Business Information` button, and then clicking the `Upgrade Your Account` button.</p>' . "\n";
58
+ echo '<p><em><strong>*PayPal® API Credentials*</strong> Once you have a PayPal® Business account, you\'ll need access to your <a href="http://www.s2member.com/paypal-profile-api-access" target="_blank" rel="external">PayPal® API Credentials</a>. Log into your PayPal® account, and navigate to <code>Profile -> API Access (or Request API Credentials)</code>. You\'ll choose <code>( Request API Signature )</code>.</em></p>' . "\n";
59
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_account_details", get_defined_vars ());
60
  /**/
61
  echo '<table class="form-table">' . "\n";
149
  /**/
150
  echo '<td>' . "\n";
151
  echo '<input type="radio" name="ws_plugin__s2member_paypal_sandbox" id="ws-plugin--s2member-paypal-sandbox-0" value="0"' . ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-sandbox-0">No</label> &nbsp;&nbsp;&nbsp; <input type="radio" name="ws_plugin__s2member_paypal_sandbox" id="ws-plugin--s2member-paypal-sandbox-1" value="1"' . (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? ' checked="checked"' : '') . ' /> <label for="ws-plugin--s2member-paypal-sandbox-1">Yes, enable support for Sandbox testing.</label><br />' . "\n";
152
+ echo '<em>Only enable this if you\'ve provided Sandbox credentials above.<br />This puts the API, IPN, PDT and Form/Button Generators all into Sandbox mode.<br />See: <a href="http://www.s2member.com/paypal-developers" target="_blank" rel="external">PayPal® Developers</a></em>' . "\n";
153
  echo '</td>' . "\n";
154
  /**/
155
  echo '</tr>' . "\n";
221
  /**/
222
  echo '<h3>More Information ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-ipn-details\').toggle(); return false;" class="ws-dotted-link">click here</a> )</h3>' . "\n";
223
  echo '<div id="ws-plugin--s2member-paypal-ipn-details" style="display:none;">' . "\n";
224
+ echo '<p><em><strong>*Quick Tip*</strong> In addition to the <a href="http://www.s2member.com/paypal-ipn-setup" target="_blank" rel="external">default IPN settings inside your PayPal® account</a>, the IPN URL is also set on a per-transaction basis by the special PayPal® Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal® account, that\'s OK. s2Member dynamically sets the IPN URL for each transaction. The result is that the IPN URL configured from within your PayPal® account, becomes the default, which is then overwritten on a per-transaction basis. In fact, PayPal® recently updated their system to support IPN URL preservation. One PayPal® account can handle multiple sites, all using different IPN URLs.</em></p>' . "\n";
225
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_quick_tip", get_defined_vars ());
226
  echo '<p><em><strong>*IPN Communications*</strong> You\'ll be happy to know that s2Member handles cancellations, expirations, failed payments, terminations ( e.g. refunds &amp; chargebacks ) for you automatically. If you log into your PayPal® account and cancel a Member\'s Subscription, or, if the Member logs into their PayPal® account and cancels their own Subscription, s2Member will be notified of these important changes and react accordingly through the PayPal® IPN service that runs silently behind-the-scene. The PayPal® IPN service will notify s2Member whenever a Member\'s payments have been failing, and/or whenever a Member\'s Subscription has expired for any reason. Even refunds &amp; chargeback reversals are supported through the IPN service. If you issue a refund to an unhappy Customer through PayPal®, s2Member will be notified, and the account for that Customer will either be demoted to a Free Subscriber, or deleted automatically ( based on your configuration ). The communication from PayPal® -> s2Member is seamless.</em></p>' . "\n";
227
  echo '</div>' . "\n";
232
  echo '<div id="ws-plugin--s2member-paypal-ipn-proxy-details" style="display:none;">' . "\n";
233
  echo '<p>If you\'re using a 3rd-party application that needs to POST simulated IPN transactions to your s2Member installation, you can use this alternate IPN URL, which includes a Proxy Key. This encrypted Proxy Key verifies incoming data being received by s2Member\'s IPN processor. You can change <em>[proxy-gateway]</em> to whatever you like. The <em>[proxy-gateway]</em> value is required. It will be stored by s2Member as the Customer\'s Paid Subscr. Gateway. Your [proxy-gateway] value will also be reflected in s2Member\'s IPN log.</p>' . "\n";
234
  echo '<input type="text" value="' . format_to_edit (site_url ("/?s2member_paypal_notify=1&s2member_paypal_proxy=[proxy-gateway]&s2member_paypal_proxy_verification=" . urlencode (c_ws_plugin__s2member_paypal_utilities::paypal_proxy_key_gen ()))) . '" style="width:99%;" />' . "\n";
235
+ echo '<p><em>Any 3rd-party application that is sending IPN transactions to your s2Member installation, must ALWAYS include the <code>custom</code> POST variable, and that variable must always start with your installation domain ( i.e. custom=<code>' . esc_html ($_SERVER["HTTP_HOST"]) . '</code> ). In addition, the <code>item_number</code> variable, must always match a format that s2Member looks for. Generally speaking, the <code>item_number</code> should be <code>1, 2, 3, or 4</code>, indicating a specific s2Member Level #. However, s2Member also uses some advanced formats in this field. Just to be sure, we suggest creating a PayPal® Button with the s2Member Button Generator, and then taking a look at the Full Button Code to see how s2Member expects <code>item_number</code> to be formatted. Other than the aforementioned exceptions; all other POST variables should follow PayPal® standards. Please see: <a href="http://www.s2member.com/paypal-ipn-pdt-vars" target="_blank" rel="external">PayPal\'s IPN/PDT reference guide</a> for full documentation.</em></p>' . "\n";
236
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_ipn_after_proxy", get_defined_vars ());
237
  echo '</div>' . "\n";
238
  echo '</div>' . "\n";
282
  /**/
283
  echo '<h3>More Information ( <a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-pdt-details\').toggle(); return false;" class="ws-dotted-link">click here</a> )</h3>' . "\n";
284
  echo '<div id="ws-plugin--s2member-paypal-pdt-details" style="display:none;">' . "\n";
285
+ echo '<p><em><strong>*Quick Tip*</strong> In addition to the <a href="http://www.s2member.com/paypal-pdt-setup" target="_blank" rel="external">default Auto-Return/PDT configuration inside your PayPal® account</a>, the Auto-Return URL is also set on a per-transaction basis from within the special PayPal® Button Code that s2Member provides you with. In other words, if you have multiple sites operating on one PayPal® account, that\'s OK. s2Member dynamically sets the Auto-Return URL for each transaction. The result is that the Auto-Return URL configured from within your PayPal® account, becomes the default, which is then overwritten on a per-transaction basis.</em></p>' . "\n";
286
  do_action ("ws_plugin__s2member_during_paypal_ops_page_during_left_sections_during_paypal_pdt_after_quick_tip", get_defined_vars ());
287
  echo '</div>' . "\n";
288
  /**/
includes/menu-pages/res-ops.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
21
  {
@@ -53,7 +53,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
53
  /**/
54
  echo '<div class="ws-menu-page-section ws-plugin--s2member-post-level-access-section">' . "\n";
55
  echo '<h3>Post Level Access Restrictions ( optional )</h3>' . "\n";
56
- echo '<p>Here you can specify Posts that are restricted to certain Membership Access Levels. s2Member also supports Custom Post Types here, which were first introduced in WordPress® 3.0. If you have a theme or plugin installed, that has enabled Custom Post Types ( i.e. Music/Videos or something else ), you can put the IDs for those Posts here.</p>' . "\n";
57
  echo '<p><em><strong>*Note*</strong> Protecting individual Posts, ONLY protects the Permalinks for those Posts. It is still possible for excerpts of protected content to be seen in search results generated by WordPress®, feeds, and Archive views; such as your Home Page, inside a Category listing, or through other queries formulated by your theme. This is the intended functionality. Excerpts are a great way to "tease" public visitors. In other words, public visitors may have access to excerpts introduced by your theme, but any attempt to view the full Post ( i.e. the Permalink ) will result in an automatic redirect to your Membership Options Page; requiring registration.</em></p>' . "\n";
58
  echo '<p><em><strong>*Note*</strong> If you would like to protect many Posts at once ( including Archive views ), you can use Category Level Restrictions, Tag Level Restrictions, or have a look down below at s2Member\'s options for "Alternative View Protection", which deals with search results, as well as feeds.</em></p>' . "\n";
59
  echo ((!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) && !$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post IDs? Get <a href="http://www.primothemes.com/post/product/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
@@ -77,7 +77,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
77
  /**/
78
  echo '<td>' . "\n";
79
  echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_posts" id="ws-plugin--s2member-level' . $n . '-posts" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]) . '" /><br />' . "\n";
80
- echo 'Post IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.' . "\n";
 
 
81
  echo '</td>' . "\n";
82
  /**/
83
  echo '</tr>' . "\n";
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_res_ops"))
21
  {
53
  /**/
54
  echo '<div class="ws-menu-page-section ws-plugin--s2member-post-level-access-section">' . "\n";
55
  echo '<h3>Post Level Access Restrictions ( optional )</h3>' . "\n";
56
+ echo '<p>Here you can specify Posts that are restricted to certain Membership Access Levels. s2Member also supports Custom <a href="http://codex.wordpress.org/Post_Types" target="_blank" rel="external">Post Types</a> here. If you have a theme or plugin installed, which has enabled Custom Post Types <em>( i.e. Music/Videos or something else )</em>, you can put the IDs for those Posts here.</p>' . "\n";
57
  echo '<p><em><strong>*Note*</strong> Protecting individual Posts, ONLY protects the Permalinks for those Posts. It is still possible for excerpts of protected content to be seen in search results generated by WordPress®, feeds, and Archive views; such as your Home Page, inside a Category listing, or through other queries formulated by your theme. This is the intended functionality. Excerpts are a great way to "tease" public visitors. In other words, public visitors may have access to excerpts introduced by your theme, but any attempt to view the full Post ( i.e. the Permalink ) will result in an automatic redirect to your Membership Options Page; requiring registration.</em></p>' . "\n";
58
  echo '<p><em><strong>*Note*</strong> If you would like to protect many Posts at once ( including Archive views ), you can use Category Level Restrictions, Tag Level Restrictions, or have a look down below at s2Member\'s options for "Alternative View Protection", which deals with search results, as well as feeds.</em></p>' . "\n";
59
  echo ((!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) && !$GLOBALS["WS_PLUGIN__"]["wp_show_ids"]) ? '<p><em><strong>*Tip*</strong> Can\'t find your Post IDs? Get <a href="http://www.primothemes.com/post/product/wp-show-ids-plugin/" target="_blank" rel="external">WP Show IDs</a>.</em></p>' . "\n" : '';
77
  /**/
78
  echo '<td>' . "\n";
79
  echo '<input type="text" name="ws_plugin__s2member_level' . $n . '_posts" id="ws-plugin--s2member-level' . $n . '-posts" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_posts"]) . '" /><br />' . "\n";
80
+ echo 'Post IDs in comma-delimited format. Example: <code>1,2,3,34,8,21</code> — or you can type: <code>all</code>.<br />' . "\n";
81
+ echo 'You can also include all Post IDs of a specific <a href="http://codex.wordpress.org/Post_Types" target="_blank" rel="external">Post Type</a>. Ex: <code>1,2,3,34,all-newspapers</code>.<br />' . "\n";
82
+ echo '<em>( which protects several Post IDs, and <code>all</code> Posts of type: <code>newspaper</code> )</em>' . "\n";
83
  echo '</td>' . "\n";
84
  /**/
85
  echo '</tr>' . "\n";
includes/menu-pages/scripting.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
21
  {
@@ -1032,6 +1032,16 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
1032
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
1033
  /**/
1034
  echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/api-mop-vars.x-php")) . '</p>' . "\n";
 
 
 
 
 
 
 
 
 
 
1035
  echo '</div>' . "\n";
1036
  /**/
1037
  echo '</div>' . "\n";
@@ -1047,7 +1057,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
1047
  /**/
1048
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-hooks-section">' . "\n";
1049
  echo '<h3>WP® Hooks For Theme/Plugin Developers ( scripting required )</h3>' . "\n";
1050
- echo '<p>In addition to its API Constants, s2Member also makes several Hooks/Filters available throughout its framework. This makes it possible to build onto ( or even modify ) s2Member in lots of different ways. If you need to add custom processing routines, modify the behavior of existing processing routines, or tinker with things otherwise; you should use API Hooks/Filters. API Hooks &amp; Filters, give you the ability to "hook into", and/or "filter" processing routines, with files/functions of your own; instead of editing the s2Member plugin files directly. If you don\'t use a Hook/Filter, and instead, you edit the plugin files for s2Member, you\'ll have to merge all of your changes every time a new version of s2Member is released. If you create custom processing routines, you could place those routines into a PHP file here: <code>/wp-content/mu-plugins/s2-hacks.php</code>. If you don\'t have an <code>/mu-plugins/</code> directory, please create one. These are (mu) MUST USE plugins, which are loaded into WordPress® automatically; that\'s what you want!</p>' . "\n";
1051
  echo '<p><strong>Attn Developers:</strong> There are simply too many Hooks/Filters spread throughout s2Member\'s framework <em>( over 1000 total )</em>. Rather than documenting each Hook/Filter, it is easier to browse through the files inside: <code>/s2member/includes/classes/</code>. Inspecting Hooks/Filters in this way, also leads you to a better understanding of how they work. One way to save time, is to run a search for <code>do_action</code> and/or <code>apply_filters</code>. If you\'re new to the concept of Hooks/Filters for WordPress/s2Member, we suggest <a href="http://www.primothemes.com/forums/viewforum.php?f=40#src_doc_overview_description" target="_blank" rel="external">this article</a> as a primer. The <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a> also contains information about all Hooks/Filters that come with s2Member.</p>' . "\n";
1052
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_hooks", get_defined_vars ());
1053
  /**/
15
  * @since 3.0
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_page_scripting"))
21
  {
1032
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
1033
  /**/
1034
  echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/api-mop-vars.x-php")) . '</p>' . "\n";
1035
+ /**/
1036
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
1037
+ /**/
1038
+ echo '<p><strong>Code Samples:</strong> This may give you some ideas [ <a href="#" onclick="jQuery(\'p#ws-plugin--s2member-api-mop-vars-code-samples\').toggle(); return false;" class="ws-dotted-link">click here</a> ].</p>' . "\n";
1039
+ echo '<p id="ws-plugin--s2member-api-mop-vars-code-samples" style="display:none;">' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/api-mop-vars-e.x-php")) . '</p>' . "\n";
1040
+ /**/
1041
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
1042
+ /**/
1043
+ echo '<p><strong>Backward compatibility:</strong> The structure of s2Member\'s MOP Vars changed a bit in Nov, 2011. However, s2Member still provides the same MOP Vars that it used in previous versions, for backward compatibility. These <a href="#" onclick="jQuery(\'p#ws-plugin--s2member-old-api-mop-vars-details\').toggle(); return false;" class="ws-dotted-link">old MOP Variables</a> were more difficult to use; they are now deprecated <em>( i.e. they WILL eventually be removed )</em>. Going foward, please go by the new documentation above.</p>' . "\n";
1044
+ echo '<p id="ws-plugin--s2member-old-api-mop-vars-details" style="display:none;">' . c_ws_plugin__s2member_utils_strings::highlight_php (file_get_contents (dirname (__FILE__) . "/code-samples/api-mop-vars-o.x-php")) . '</p>' . "\n";
1045
  echo '</div>' . "\n";
1046
  /**/
1047
  echo '</div>' . "\n";
1057
  /**/
1058
  echo '<div class="ws-menu-page-section ws-plugin--s2member-api-hooks-section">' . "\n";
1059
  echo '<h3>WP® Hooks For Theme/Plugin Developers ( scripting required )</h3>' . "\n";
1060
+ echo '<p>In addition to its API Constants, s2Member also makes several Hooks/Filters available throughout its framework. This makes it possible to build onto <em>( or even modify )</em> s2Member in lots of different ways. If you need to add custom processing routines, modify the behavior of existing processing routines, or tinker with things otherwise; you should use API Hooks/Filters. API Hooks &amp; Filters, give you the ability to "hook into", and/or "filter" processing routines, with files/functions of your own; instead of editing the s2Member plugin files directly. If you don\'t use a Hook/Filter, and instead, you edit the plugin files for s2Member, you\'ll have to merge all of your changes every time a new version of s2Member is released. If you create custom processing routines, you could place those routines into a PHP file here: <code>/wp-content/mu-plugins/s2-hacks.php</code>. If you don\'t have an <code>/mu-plugins/</code> directory, please create one. These are <em>(mu)</em> <a href="http://codex.wordpress.org/Must_Use_Plugins" target="_blank" rel="external">MUST USE plugins</a>, which are loaded into WordPress® automatically; that\'s what you want!</p>' . "\n";
1061
  echo '<p><strong>Attn Developers:</strong> There are simply too many Hooks/Filters spread throughout s2Member\'s framework <em>( over 1000 total )</em>. Rather than documenting each Hook/Filter, it is easier to browse through the files inside: <code>/s2member/includes/classes/</code>. Inspecting Hooks/Filters in this way, also leads you to a better understanding of how they work. One way to save time, is to run a search for <code>do_action</code> and/or <code>apply_filters</code>. If you\'re new to the concept of Hooks/Filters for WordPress/s2Member, we suggest <a href="http://www.primothemes.com/forums/viewforum.php?f=40#src_doc_overview_description" target="_blank" rel="external">this article</a> as a primer. The <a href="http://www.primothemes.com/forums/viewforum.php?f=40" target="_blank" rel="external">s2Member Codex</a> also contains information about all Hooks/Filters that come with s2Member.</p>' . "\n";
1062
  do_action ("ws_plugin__s2member_during_scripting_page_during_left_sections_during_api_hooks", get_defined_vars ());
1063
  /**/
includes/menu-pages/trk-ops.inc.php CHANGED
@@ -107,6 +107,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
107
  echo '</tr>' . "\n";
108
  echo '</tbody>' . "\n";
109
  echo '</table>' . "\n";
 
 
 
110
  echo '</div>' . "\n";
111
  /**/
112
  echo '</div>' . "\n";
@@ -190,6 +193,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
190
  echo '</tr>' . "\n";
191
  echo '</tbody>' . "\n";
192
  echo '</table>' . "\n";
 
 
 
193
  echo '</div>' . "\n";
194
  /**/
195
  echo '</div>' . "\n";
@@ -266,6 +272,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
266
  echo '</tr>' . "\n";
267
  echo '</tbody>' . "\n";
268
  echo '</table>' . "\n";
 
 
 
269
  echo '</div>' . "\n";
270
  /**/
271
  echo '</div>' . "\n";
@@ -327,6 +336,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
327
  echo '</tr>' . "\n";
328
  echo '</tbody>' . "\n";
329
  echo '</table>' . "\n";
 
 
 
330
  echo '</div>' . "\n";
331
  /**/
332
  echo '</div>' . "\n";
@@ -353,9 +365,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
353
  /**/
354
  echo '<div class="ws-menu-page-section ws-plugin--s2member-idev-section">' . "\n";
355
  echo '<h3>Integrating iDevAffiliate® ( affiliate program management )</h3>' . "\n";
356
- echo '<a href="http://www.idevdirect.com/14200.html" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/idev-logo.gif" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
357
- echo '<p>Adding affiliate tracking software to your site is one of the most effective ways to achieve more sales, more traffic, and more search engine ranking. <a href="http://www.idevdirect.com/14200.html" target="_blank" rel="external">iDevAffiliate®</a> ( an affiliate management portal ), installs in just minutes, and can be integrated seamlessly with s2Member. We recommend <a href="http://www.idevdirect.com/14200.html" target="_blank" rel="external">iDevAffiliate® Standard</a> ( $99 ) because of its proven track record, and its ability to integrate with s2Member using a variety of techniques. The most popular being a Hidden Image Tag.</p>' . "\n";
358
- echo '<p>If you choose to <a href="http://www.idevdirect.com/14200.html" target="_blank" rel="external">install iDevAffiliate®</a>, you will need to configure your <code>iDevAffiliate® -> Shopping Cart Integration</code>. Please choose <code>Generic Tracking Pixel</code>. Then, grab your Hidden Image Tag, and pop the code provided by iDevAffiliate® into one of the fields for Tracking Codes <em>( at the top of this page )</em>. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided some examples below, one for each of s2Member\'s Tracking Code integrations.</p>' . "\n";
359
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_idev", get_defined_vars ());
360
  /**/
361
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
@@ -384,6 +396,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
384
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
385
  echo '<p>Your <code>profile</code> ID will be assigned by iDevAffiliate®. Be sure to replace <code>profile=123</code> with your own profile ID.</p>' . "\n";
386
  echo '<p><em><strong>*Tip*</strong> iDevAffiliate® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
 
 
 
387
  echo '</div>' . "\n";
388
  /**/
389
  echo '</div>' . "\n";
@@ -399,9 +414,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
399
  /**/
400
  echo '<div class="ws-menu-page-section ws-plugin--s2member-shareasale-section">' . "\n";
401
  echo '<h3>Integrating ShareASale® ( affiliate program management )</h3>' . "\n";
402
- echo '<a href="http://www.shareasale.com/merchantsignup.cfm" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/sas-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
403
- echo '<p>Established in 2000, <a href="http://www.shareasale.com/merchantsignup.cfm" target="_blank" rel="external">ShareASale®</a> provides award winning technology and service; which will enable you to connect with a network of established affiliates, as well as recruit new ones. Joining ShareASale®, maximizes your ability to reach the greatest number of affiliates, with the least amount of work. At ShareASale®, you\'ll have access to an existing affiliate-base. You place your site on the market, and let their existing affiliates promote your products/services.</p>' . "\n";
404
- echo '<p>If you <a href="http://www.shareasale.com/merchantsignup.cfm" target="_blank" rel="external">become a Merchant at ShareASale®</a>, you will need to configure your <code>ShareASale® -> Sale Tracking</code>. Grab your Hidden Image Tag, and pop the code provided by ShareASale® into one of the fields for Tracking Codes <em>( at the top of this page )</em>. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided some examples below, one for each of s2Member\'s Tracking Code integrations.</p>' . "\n";
405
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_shareasale", get_defined_vars ());
406
  /**/
407
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
@@ -430,6 +445,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
430
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
431
  echo '<p>Your <code>merchantID</code> will be assigned by ShareASale®. Be sure to replace <code>merchantID=123</code> with the one they assign you.</p>' . "\n";
432
  echo '<p><em><strong>*Tip*</strong> ShareASale® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
 
 
 
433
  echo '</div>' . "\n";
434
  /**/
435
  echo '</div>' . "\n";
@@ -447,6 +465,9 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_trk_ops"))
447
  echo '<h3>Other Tracking Methods Are Available ( there\'s always a way )</h3>' . "\n";
448
  echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `Modification`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page` Notifications that are available to you through the s2Member API. The s2Member API Notifications make it possible to integrate with 3rd party applications; like list servers, affiliate programs, and other back-office routines; in more advanced ways. Since s2Member API Notifications operate silently on the back-end, they tend to be more reliable and also more versatile. That being said, nothing replaces the simplicity of Tracking Codes. The more advanced API Notifications are NOT always the best tool for the job. For instance, API Notifications will NOT work with Google® Analytics, or 1 pixel &lt;img&gt; tags. They operate silently behind-the-scene, using HTTP connections, as opposed to being loaded in a browser.</p>' . "\n";
449
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_other_methods", get_defined_vars ());
 
 
 
450
  echo '</div>' . "\n";
451
  /**/
452
  echo '</div>' . "\n";
107
  echo '</tr>' . "\n";
108
  echo '</tbody>' . "\n";
109
  echo '</table>' . "\n";
110
+ /**/
111
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
112
+ echo '<p><em><strong>*Tip*</strong> With <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <code>s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes</code>. This is a VERY powerful feature.</em></p>' . "\n";
113
  echo '</div>' . "\n";
114
  /**/
115
  echo '</div>' . "\n";
193
  echo '</tr>' . "\n";
194
  echo '</tbody>' . "\n";
195
  echo '</table>' . "\n";
196
+ /**/
197
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
198
+ echo '<p><em><strong>*Tip*</strong> With <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <code>s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes</code>. This is a VERY powerful feature.</em></p>' . "\n";
199
  echo '</div>' . "\n";
200
  /**/
201
  echo '</div>' . "\n";
272
  echo '</tr>' . "\n";
273
  echo '</tbody>' . "\n";
274
  echo '</table>' . "\n";
275
+ /**/
276
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
277
+ echo '<p><em><strong>*Tip*</strong> With <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <code>s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes</code>. This is a VERY powerful feature.</em></p>' . "\n";
278
  echo '</div>' . "\n";
279
  /**/
280
  echo '</div>' . "\n";
336
  echo '</tr>' . "\n";
337
  echo '</tbody>' . "\n";
338
  echo '</table>' . "\n";
339
+ /**/
340
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
341
+ echo '<p><em><strong>*Tip*</strong> With <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a>, it\'s possible to integrate Affiliate Coupon Codes. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <code>s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes</code>. This is a VERY powerful feature.</em></p>' . "\n";
342
  echo '</div>' . "\n";
343
  /**/
344
  echo '</div>' . "\n";
365
  /**/
366
  echo '<div class="ws-menu-page-section ws-plugin--s2member-idev-section">' . "\n";
367
  echo '<h3>Integrating iDevAffiliate® ( affiliate program management )</h3>' . "\n";
368
+ echo '<a href="http://www.s2member.com/idev-affiliate" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/idev-logo.gif" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
369
+ echo '<p>Adding affiliate tracking software to your site is one of the most effective ways to achieve more sales, more traffic, and more search engine ranking. <a href="http://www.s2member.com/idev-affiliate" target="_blank" rel="external">iDevAffiliate®</a> ( an affiliate management portal ), installs in just minutes, and can be integrated seamlessly with s2Member. We recommend <a href="http://www.s2member.com/idev-affiliate" target="_blank" rel="external">iDevAffiliate® Standard</a> ( $99 ) because of its proven track record, and its ability to integrate with s2Member using a variety of techniques. The most popular being a Hidden Image Tag.</p>' . "\n";
370
+ echo '<p>If you choose to <a href="http://www.s2member.com/idev-affiliate" target="_blank" rel="external">install iDevAffiliate®</a>, you will need to configure your <code>iDevAffiliate® -> Shopping Cart Integration</code>. Please choose <code>Generic Tracking Pixel</code>. Then, grab your Hidden Image Tag, and pop the code provided by iDevAffiliate® into one of the fields for Tracking Codes <em>( at the top of this page )</em>. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided some examples below, one for each of s2Member\'s Tracking Code integrations.</p>' . "\n";
371
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_idev", get_defined_vars ());
372
  /**/
373
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
396
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
397
  echo '<p>Your <code>profile</code> ID will be assigned by iDevAffiliate®. Be sure to replace <code>profile=123</code> with your own profile ID.</p>' . "\n";
398
  echo '<p><em><strong>*Tip*</strong> iDevAffiliate® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
399
+ /**/
400
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
401
+ echo '<p><em><strong>*Tip*</strong> With <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a>, it\'s possible to integrate Affiliate Coupon Codes with iDevAffiliate®. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <code>s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes</code>. This is a VERY powerful feature.</em></p>' . "\n";
402
  echo '</div>' . "\n";
403
  /**/
404
  echo '</div>' . "\n";
414
  /**/
415
  echo '<div class="ws-menu-page-section ws-plugin--s2member-shareasale-section">' . "\n";
416
  echo '<h3>Integrating ShareASale® ( affiliate program management )</h3>' . "\n";
417
+ echo '<a href="http://www.s2member.com/shareasale" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/sas-logo.png" class="ws-menu-page-right" style="width:125px; height:125px; border:0;" alt="." /></a>' . "\n";
418
+ echo '<p>Established in 2000, <a href="http://www.s2member.com/shareasale" target="_blank" rel="external">ShareASale®</a> provides award winning technology and service; which will enable you to connect with a network of established affiliates, as well as recruit new ones. Joining ShareASale®, maximizes your ability to reach the greatest number of affiliates, with the least amount of work. At ShareASale®, you\'ll have access to an existing affiliate-base. You place your site on the market, and let their existing affiliates promote your products/services.</p>' . "\n";
419
+ echo '<p>If you <a href="http://www.s2member.com/shareasale" target="_blank" rel="external">become a Merchant at ShareASale®</a>, you will need to configure your <code>ShareASale® -> Sale Tracking</code>. Grab your Hidden Image Tag, and pop the code provided by ShareASale® into one of the fields for Tracking Codes <em>( at the top of this page )</em>. You MUST also add Replacement Codes to your Hidden Image Tag. To save you some trouble, we\'ve provided some examples below, one for each of s2Member\'s Tracking Code integrations.</p>' . "\n";
420
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_shareasale", get_defined_vars ());
421
  /**/
422
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
445
  echo '<div class="ws-menu-page-hr"></div>' . "\n";
446
  echo '<p>Your <code>merchantID</code> will be assigned by ShareASale®. Be sure to replace <code>merchantID=123</code> with the one they assign you.</p>' . "\n";
447
  echo '<p><em><strong>*Tip*</strong> ShareASale® also provides an alternative method, using a 3rd-party call. The alternative 3rd-party call, could be used with <code>s2Member -> API Notifications.</code> A 3rd-party call, is essentially an HTTP connection that runs silently behind-the-scene, as opposed to being loaded in a browser. It\'s a bit more powerful, but also more advanced.</em></p>' . "\n";
448
+ /**/
449
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
450
+ echo '<p><em><strong>*Tip*</strong> With <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a>, it\'s possible to integrate Affiliate Coupon Codes with ShareASale®. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <code>s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes</code>. This is a VERY powerful feature.</em></p>' . "\n";
451
  echo '</div>' . "\n";
452
  /**/
453
  echo '</div>' . "\n";
465
  echo '<h3>Other Tracking Methods Are Available ( there\'s always a way )</h3>' . "\n";
466
  echo '<p>Check the s2Member API Notifications panel. You\'ll find additional layers of automation available through the use of the `Signup`, `Registration`, `Payment`, `Modification`, `EOT/Deletion`, `Refund/Reversal`, and `Specific Post/Page` Notifications that are available to you through the s2Member API. The s2Member API Notifications make it possible to integrate with 3rd party applications; like list servers, affiliate programs, and other back-office routines; in more advanced ways. Since s2Member API Notifications operate silently on the back-end, they tend to be more reliable and also more versatile. That being said, nothing replaces the simplicity of Tracking Codes. The more advanced API Notifications are NOT always the best tool for the job. For instance, API Notifications will NOT work with Google® Analytics, or 1 pixel &lt;img&gt; tags. They operate silently behind-the-scene, using HTTP connections, as opposed to being loaded in a browser.</p>' . "\n";
467
  do_action ("ws_plugin__s2member_during_trk_ops_page_during_left_sections_during_other_methods", get_defined_vars ());
468
+ /**/
469
+ echo '<div class="ws-menu-page-hr"></div>' . "\n";
470
+ echo '<p><em><strong>*Tip*</strong> With <a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" rel="external">s2Member Pro Forms</a>, it\'s possible to integrate Affiliate Coupon Codes with iDevAffiliate®. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code that you\'ve configured with s2Member Pro. Please check your Dashboard here: <code>s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes</code>. This is a VERY powerful feature.</em></p>' . "\n";
471
  echo '</div>' . "\n";
472
  /**/
473
  echo '</div>' . "\n";
includes/menu-pages/ws-mlist.inc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @since 110524RC
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
- exit("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_pages_ws_mlist"))
21
  {
@@ -33,7 +33,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages_ws_mlist"))
33
  {
34
  echo '<form id="ws-mlist-form" action="http://websharks-inc.us1.list-manage1.com/subscribe/post?u=8f347da54d66b5298d13237d9&amp;id=19e9d213bc" method="post" target="_blank">' . "\n";
35
  /**/
36
- if (!is_ssl ()) /* Feed panel. */
37
  {
38
  echo '<div class="ws-menu-page-r-group-header">' . "\n";
39
  echo '<ins class="open">-</ins>Latest News<em>!</em>' . "\n";
@@ -74,7 +74,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages_ws_mlist"))
74
  echo '</ul>' . "\n";
75
  echo '</div>' . "\n";
76
  /**/
77
- if (!is_ssl ()) /* Only display this whenever we are NOT inside an SSL-enabled administrative panel. */
78
  {
79
  echo '<div id="ws-mlist-div-subs">' . "\n";
80
  echo '<script type="text/javascript" src="http://websharks-inc.us1.list-manage.com/subscriber-count?b=31&u=8c67d547-edf6-41c5-807d-2d2d0e6cffd1&id=19e9d213bc"></script>' . "\n";
15
  * @since 110524RC
16
  */
17
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18
+ exit ("Do not access this file directly.");
19
  /**/
20
  if (!class_exists ("c_ws_plugin__s2member_menu_pages_ws_mlist"))
21
  {
33
  {
34
  echo '<form id="ws-mlist-form" action="http://websharks-inc.us1.list-manage1.com/subscribe/post?u=8f347da54d66b5298d13237d9&amp;id=19e9d213bc" method="post" target="_blank">' . "\n";
35
  /**/
36
+ if (!is_ssl () && /* Don't require remote connections when running on `localhost`. */ !c_ws_plugin__s2member_utils_conds::is_localhost ())
37
  {
38
  echo '<div class="ws-menu-page-r-group-header">' . "\n";
39
  echo '<ins class="open">-</ins>Latest News<em>!</em>' . "\n";
74
  echo '</ul>' . "\n";
75
  echo '</div>' . "\n";
76
  /**/
77
+ if (!is_ssl () && /* Don't require remote connections when running on `localhost`. */ !c_ws_plugin__s2member_utils_conds::is_localhost ())
78
  {
79
  echo '<div id="ws-mlist-div-subs">' . "\n";
80
  echo '<script type="text/javascript" src="http://websharks-inc.us1.list-manage.com/subscriber-count?b=31&u=8c67d547-edf6-41c5-807d-2d2d0e6cffd1&id=19e9d213bc"></script>' . "\n";
includes/syscon.inc.php CHANGED
@@ -18,7 +18,7 @@
18
  * @since 3.0
19
  */
20
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
21
- exit("Do not access this file directly.");
22
  /*
23
  Determine the directory.
24
  */
@@ -340,7 +340,7 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
340
  foreach ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"] as $key => &$value)
341
  {
342
  if (!isset ($default_options[$key]) && !preg_match ("/^pro_/", $key))
343
- unset($GLOBALS["WS_PLUGIN__"]["s2member"]["o"][$key]);
344
  /**/
345
  else if ($key === "options_checksum" && (!is_string ($value) || !strlen ($value)))
346
  $value = $default_options[$key];
@@ -504,16 +504,16 @@ if (!function_exists ("ws_plugin__s2member_configure_options_and_their_defaults"
504
  else if (preg_match ("/^level[0-9]+_ruris$/", $key) && (!is_string ($value) || !strlen ($value)))
505
  $value = $default_options[$key];
506
  /**/
507
- else if (preg_match ("/^level[0-9]+_catgs$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
508
  $value = $default_options[$key];
509
  /**/
510
- else if (preg_match ("/^level[0-9]+_ptags$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/ +/", " ", trim (preg_replace ("/ *, */", ",", $value))), ",")))))
511
  $value = $default_options[$key];
512
  /**/
513
- else if (preg_match ("/^level[0-9]+_posts$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
514
  $value = $default_options[$key];
515
  /**/
516
- else if (preg_match ("/^level[0-9]+_pages$/", $key) && (!is_string ($value) || !($value = (($value === "all") ? $value : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
517
  $value = $default_options[$key];
518
  /**/
519
  else if ($key === "specific_ids" && (!is_string ($value) || !($value = trim (preg_replace ("/[^0-9,]/", "", $value), ","))))
18
  * @since 3.0
19
  */
20
  if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
21
+ exit ("Do not access this file directly.");
22
  /*
23
  Determine the directory.
24
  */
340
  foreach ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"] as $key => &$value)
341
  {
342
  if (!isset ($default_options[$key]) && !preg_match ("/^pro_/", $key))
343
+ unset ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"][$key]);
344
  /**/
345
  else if ($key === "options_checksum" && (!is_string ($value) || !strlen ($value)))
346
  $value = $default_options[$key];
504
  else if (preg_match ("/^level[0-9]+_ruris$/", $key) && (!is_string ($value) || !strlen ($value)))
505
  $value = $default_options[$key];
506
  /**/
507
+ else if (preg_match ("/^level[0-9]+_catgs$/", $key) && (!is_string ($value) || !($value = ((strcasecmp ($value, "all") === 0) ? strtolower ($value) : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
508
  $value = $default_options[$key];
509
  /**/
510
+ else if (preg_match ("/^level[0-9]+_ptags$/", $key) && (!is_string ($value) || !($value = ((strcasecmp ($value, "all") === 0) ? strtolower ($value) : trim (preg_replace ("/ +/", " ", trim (preg_replace ("/ *, */", ",", $value))), ",")))))
511
  $value = $default_options[$key];
512
  /**/
513
+ else if (preg_match ("/^level[0-9]+_posts$/", $key) && (!is_string ($value) || !($value = trim ( /* Supports `all` or `1,2,3,all-[type]s`. */preg_replace ("/[^a-z0-9_\-,]/", "", strtolower ($value)), ","))))
514
  $value = $default_options[$key];
515
  /**/
516
+ else if (preg_match ("/^level[0-9]+_pages$/", $key) && (!is_string ($value) || !($value = ((strcasecmp ($value, "all") === 0) ? strtolower ($value) : trim (preg_replace ("/[^0-9,]/", "", $value), ",")))))
517
  $value = $default_options[$key];
518
  /**/
519
  else if ($key === "specific_ids" && (!is_string ($value) || !($value = trim (preg_replace ("/[^0-9,]/", "", $value), ","))))
includes/translations/s2member.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the s2Member package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: s2Member 111029\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/.__s2member\n"
7
- "POT-Creation-Date: 2011-10-29 23:51:45+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -2443,64 +2443,64 @@ msgctxt "s2member-front"
2443
  msgid "<strong>Unknown error.</strong> Please contact Support for assistance."
2444
  msgstr ""
2445
 
2446
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:113
2447
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:224
2448
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:360
2449
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:484
2450
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:676
2451
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:117
2452
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:228
2453
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:362
2454
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:484
2455
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:675
2456
  msgctxt "s2member-front"
2457
  msgid "Security Code"
2458
  msgstr ""
2459
 
2460
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:191
2461
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:643
2462
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:195
2463
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:642
2464
  msgctxt "s2member-front"
2465
  msgid "Additional Info"
2466
  msgstr ""
2467
 
2468
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:327
2469
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:451
2470
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:607
2471
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:331
2472
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:453
2473
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:608
2474
  msgctxt "s2member-front"
2475
  msgid "Visa®"
2476
  msgstr ""
2477
 
2478
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:327
2479
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:451
2480
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:607
2481
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:331
2482
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:453
2483
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:608
2484
  msgctxt "s2member-front"
2485
  msgid "MasterCard®"
2486
  msgstr ""
2487
 
2488
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:327
2489
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:451
2490
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:607
2491
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:331
2492
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:453
2493
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:608
2494
  msgctxt "s2member-front"
2495
  msgid "Discover®"
2496
  msgstr ""
2497
 
2498
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:327
2499
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:451
2500
- #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:607
2501
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:331
2502
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:453
2503
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:608
2504
  msgctxt "s2member-front"
2505
  msgid "American Express®"
2506
  msgstr ""
@@ -3267,116 +3267,122 @@ msgid "Error #%1$s. %2$s."
3267
  msgstr ""
3268
 
3269
  #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:700
3270
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:841
3271
  #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:270
3272
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:411
3273
  msgctxt "s2member-front percentage-symbol"
3274
  msgid "%"
3275
  msgstr ""
3276
 
3277
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:840
3278
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:410
3279
  msgctxt "s2member-front"
3280
  msgid " + tax"
3281
  msgstr ""
3282
 
3283
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:867
3284
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:911
3285
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:922
3286
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:942
3287
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:994
3288
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1007
3289
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:437
3290
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:481
3291
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:492
3292
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:512
3293
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:564
3294
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:577
3295
  msgctxt "s2member-front"
3296
  msgid "COUPON %s off. ( Now: %s )"
3297
  msgstr ""
3298
 
3299
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:868
3300
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:912
3301
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:923
3302
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:943
3303
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:995
3304
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1008
3305
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:438
3306
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:482
3307
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:493
3308
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:513
3309
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:565
3310
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:578
3311
  msgctxt "s2member-front"
3312
  msgid "<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>"
3313
  msgstr ""
3314
 
3315
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:878
3316
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:889
3317
  #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:900
3318
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:955
3319
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:968
3320
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:981
3321
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:448
3322
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:459
3323
  #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:470
3324
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:525
3325
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:538
3326
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:551
 
 
3327
  msgctxt "s2member-front"
3328
  msgid "COUPON %s off. ( Now: %s, then %s )"
3329
  msgstr ""
3330
 
3331
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:879
3332
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:890
3333
  #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:901
3334
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:956
3335
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:969
3336
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:982
3337
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:449
3338
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:460
3339
  #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:471
3340
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:526
3341
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:539
3342
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:552
 
 
3343
  msgctxt "s2member-front"
3344
  msgid "<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>"
3345
  msgstr ""
3346
 
3347
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:927
3348
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1012
3349
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:497
3350
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:582
3351
  msgctxt "s2member-front"
3352
  msgid "<div>Sorry, your Coupon is not applicable.</div>"
3353
  msgstr ""
3354
 
3355
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1016
3356
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:586
3357
  msgctxt "s2member-front"
3358
  msgid "<div>Coupon: <strong>%s0.00 off</strong>.</div>"
3359
  msgstr ""
3360
 
3361
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1020
3362
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:590
 
 
 
 
 
 
3363
  msgctxt "s2member-front"
3364
  msgid "<div>Sorry, your Coupon <strong>expired</strong>: <em>%s</em>.</div>"
3365
  msgstr ""
3366
 
3367
- #. translators: `%1$s` is the new price/description, after coupon is applied.
3368
- #. `%2$s` was the original description.
3369
 
3370
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1028
3371
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:598
3372
  msgctxt "s2member-front"
3373
  msgid "%1$s ~ ORIGINALLY: %2$s"
3374
  msgstr ""
3375
 
3376
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1031
3377
- #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1035
3378
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:601
3379
- #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:605
3380
  msgctxt "s2member-front"
3381
  msgid "<div>Sorry, your Coupon is N/A, invalid or expired.</div>"
3382
  msgstr ""
@@ -3501,22 +3507,22 @@ msgctxt "s2member-front"
3501
  msgid "<strong>Sorry.</strong> Your account is pending other changes. Please try again in 15 minutes."
3502
  msgstr ""
3503
 
3504
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:331
3505
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:453
3506
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:608
3507
  msgctxt "s2member-front"
3508
  msgid "Maestro®"
3509
  msgstr ""
3510
 
3511
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:331
3512
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:453
3513
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:608
3514
  msgctxt "s2member-front"
3515
  msgid "Solo®"
3516
  msgstr ""
3517
 
3518
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:453
3519
- #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:608
3520
  msgctxt "s2member-front"
3521
  msgid "PayPal®"
3522
  msgstr ""
@@ -3642,32 +3648,32 @@ msgctxt "s2member-front"
3642
  msgid "Log Me In"
3643
  msgstr ""
3644
 
3645
- #: s2member-pro/includes/classes/login-widget.inc.php:192
3646
  msgctxt "s2member-front"
3647
  msgid "My Account"
3648
  msgstr ""
3649
 
3650
- #: s2member-pro/includes/classes/login-widget.inc.php:193
3651
  msgctxt "s2member-front"
3652
  msgid "Please disable popup blockers and try again!"
3653
  msgstr ""
3654
 
3655
- #: s2member-pro/includes/classes/login-widget.inc.php:193
3656
  msgctxt "s2member-front"
3657
  msgid "Edit My Profile"
3658
  msgstr ""
3659
 
3660
- #: s2member-pro/includes/classes/login-widget.inc.php:194
3661
  msgctxt "s2member-front"
3662
  msgid "Logout"
3663
  msgstr ""
3664
 
3665
- #: s2member-pro/includes/classes/login-widget.inc.php:313
3666
  msgctxt "s2member-front"
3667
  msgid "Membership Login"
3668
  msgstr ""
3669
 
3670
- #: s2member-pro/includes/classes/login-widget.inc.php:313
3671
  msgctxt "s2member-front"
3672
  msgid "My Profile Summary"
3673
  msgstr ""
2
  # This file is distributed under the same license as the s2Member package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: s2Member 111105\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/.__s2member\n"
7
+ "POT-Creation-Date: 2011-11-05 23:14:59+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2443
  msgid "<strong>Unknown error.</strong> Please contact Support for assistance."
2444
  msgstr ""
2445
 
2446
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:115
2447
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:226
2448
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:362
2449
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:486
2450
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:678
2451
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:119
2452
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:230
2453
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:364
2454
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:486
2455
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:677
2456
  msgctxt "s2member-front"
2457
  msgid "Security Code"
2458
  msgstr ""
2459
 
2460
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:193
2461
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:645
2462
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:197
2463
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:644
2464
  msgctxt "s2member-front"
2465
  msgid "Additional Info"
2466
  msgstr ""
2467
 
2468
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:329
2469
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:453
2470
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:609
2471
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:333
2472
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:455
2473
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:610
2474
  msgctxt "s2member-front"
2475
  msgid "Visa®"
2476
  msgstr ""
2477
 
2478
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:329
2479
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:453
2480
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:609
2481
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:333
2482
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:455
2483
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:610
2484
  msgctxt "s2member-front"
2485
  msgid "MasterCard®"
2486
  msgstr ""
2487
 
2488
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:329
2489
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:453
2490
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:609
2491
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:333
2492
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:455
2493
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:610
2494
  msgctxt "s2member-front"
2495
  msgid "Discover®"
2496
  msgstr ""
2497
 
2498
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:329
2499
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:453
2500
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-form-in.inc.php:609
2501
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:333
2502
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:455
2503
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:610
2504
  msgctxt "s2member-front"
2505
  msgid "American Express®"
2506
  msgstr ""
3267
  msgstr ""
3268
 
3269
  #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:700
3270
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:843
3271
  #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:270
3272
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:413
3273
  msgctxt "s2member-front percentage-symbol"
3274
  msgid "%"
3275
  msgstr ""
3276
 
3277
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:842
3278
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:412
3279
  msgctxt "s2member-front"
3280
  msgid " + tax"
3281
  msgstr ""
3282
 
3283
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:887
3284
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:939
3285
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:952
3286
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:974
3287
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1034
3288
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1049
3289
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:457
3290
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:509
3291
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:522
3292
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:544
3293
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:604
3294
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:619
3295
  msgctxt "s2member-front"
3296
  msgid "COUPON %s off. ( Now: %s )"
3297
  msgstr ""
3298
 
3299
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:888
3300
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:940
3301
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:953
3302
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:975
3303
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1035
3304
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1050
3305
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:458
3306
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:510
3307
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:523
3308
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:545
3309
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:605
3310
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:620
3311
  msgctxt "s2member-front"
3312
  msgid "<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>"
3313
  msgstr ""
3314
 
 
 
3315
  #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:900
3316
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:913
3317
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:926
3318
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:989
3319
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1004
3320
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1019
3321
  #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:470
3322
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:483
3323
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:496
3324
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:559
3325
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:574
3326
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:589
3327
  msgctxt "s2member-front"
3328
  msgid "COUPON %s off. ( Now: %s, then %s )"
3329
  msgstr ""
3330
 
 
 
3331
  #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:901
3332
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:914
3333
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:927
3334
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:990
3335
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1005
3336
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1020
3337
  #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:471
3338
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:484
3339
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:497
3340
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:560
3341
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:575
3342
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:590
3343
  msgctxt "s2member-front"
3344
  msgid "<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>"
3345
  msgstr ""
3346
 
3347
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:957
3348
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1054
3349
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:527
3350
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:624
3351
  msgctxt "s2member-front"
3352
  msgid "<div>Sorry, your Coupon is not applicable.</div>"
3353
  msgstr ""
3354
 
3355
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1058
3356
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:628
3357
  msgctxt "s2member-front"
3358
  msgid "<div>Coupon: <strong>%s0.00 off</strong>.</div>"
3359
  msgstr ""
3360
 
3361
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1062
3362
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:632
3363
+ msgctxt "s2member-front"
3364
+ msgid "<div>Sorry, your Coupon cannot be applied to this particular purchase.</div>"
3365
+ msgstr ""
3366
+
3367
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1066
3368
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:636
3369
  msgctxt "s2member-front"
3370
  msgid "<div>Sorry, your Coupon <strong>expired</strong>: <em>%s</em>.</div>"
3371
  msgstr ""
3372
 
3373
+ #. translators: `%1$s` is new price/description, after coupon applied. `%2$s`
3374
+ #. is original description.
3375
 
3376
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1072
3377
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:642
3378
  msgctxt "s2member-front"
3379
  msgid "%1$s ~ ORIGINALLY: %2$s"
3380
  msgstr ""
3381
 
3382
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1100
3383
+ #: s2member-pro/includes/classes/gateways/authnet/authnet-utilities.inc.php:1104
3384
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:670
3385
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-utilities.inc.php:674
3386
  msgctxt "s2member-front"
3387
  msgid "<div>Sorry, your Coupon is N/A, invalid or expired.</div>"
3388
  msgstr ""
3507
  msgid "<strong>Sorry.</strong> Your account is pending other changes. Please try again in 15 minutes."
3508
  msgstr ""
3509
 
3510
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:333
3511
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:455
3512
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:610
3513
  msgctxt "s2member-front"
3514
  msgid "Maestro®"
3515
  msgstr ""
3516
 
3517
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:333
3518
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:455
3519
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:610
3520
  msgctxt "s2member-front"
3521
  msgid "Solo®"
3522
  msgstr ""
3523
 
3524
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:455
3525
+ #: s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php:610
3526
  msgctxt "s2member-front"
3527
  msgid "PayPal®"
3528
  msgstr ""
3648
  msgid "Log Me In"
3649
  msgstr ""
3650
 
3651
+ #: s2member-pro/includes/classes/login-widget.inc.php:190
3652
  msgctxt "s2member-front"
3653
  msgid "My Account"
3654
  msgstr ""
3655
 
3656
+ #: s2member-pro/includes/classes/login-widget.inc.php:191
3657
  msgctxt "s2member-front"
3658
  msgid "Please disable popup blockers and try again!"
3659
  msgstr ""
3660
 
3661
+ #: s2member-pro/includes/classes/login-widget.inc.php:191
3662
  msgctxt "s2member-front"
3663
  msgid "Edit My Profile"
3664
  msgstr ""
3665
 
3666
+ #: s2member-pro/includes/classes/login-widget.inc.php:192
3667
  msgctxt "s2member-front"
3668
  msgid "Logout"
3669
  msgstr ""
3670
 
3671
+ #: s2member-pro/includes/classes/login-widget.inc.php:311
3672
  msgctxt "s2member-front"
3673
  msgid "Membership Login"
3674
  msgstr ""
3675
 
3676
+ #: s2member-pro/includes/classes/login-widget.inc.php:311
3677
  msgctxt "s2member-front"
3678
  msgid "My Profile Summary"
3679
  msgstr ""
readme.txt CHANGED
@@ -1,7 +1,7 @@
1
  === s2Member® ( Membership w/ PayPal® ) ===
2
 
3
- Version: 111029
4
- Stable tag: 111029
5
  Framework: WS-P-110523
6
 
7
  SSL Compatible: yes
@@ -179,6 +179,19 @@ Please visit s2Member.com for [video tutorials](http://www.s2member.com/videos/)
179
 
180
  == Changelog ==
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  = v111029 =
183
  * (s2Member Pro) **Compatibility**. s2Member Pro now supports automatic upgrades through filesystem methdologies, other than `direct`. For further details, please see [this thread](http://www.primothemes.com/forums/viewtopic.php?f=4&t=15283#p49034).
184
  * (s2Member) **Bug fix**. A bug in the s2Member framework was causing some IPNs with `txn_type = recurring_payment_suspended_due_to_max_failed_payment` to get bypassed inadvertently. Fixed in this release. For further details, please see [this thread](http://www.primothemes.com/forums/viewtopic.php?f=4&t=6204&p=48246#p48361).
1
  === s2Member® ( Membership w/ PayPal® ) ===
2
 
3
+ Version: 111105
4
+ Stable tag: 111105
5
  Framework: WS-P-110523
6
 
7
  SSL Compatible: yes
179
 
180
  == Changelog ==
181
 
182
+ = v111105 =
183
+ * (s2Member Pro) **New feature**. It is now possible to configure Coupon Codes that are ONLY valid on specific Pages/Posts which may hold one of your s2Member Pro Forms. For further details, please check the examples in your Dashboard, here: `s2Member -> Pro Coupon Codes`.
184
+ * (s2Member Pro) **New feature**. Affiliate Coupon Codes make it possible for your affiliates to receive credit for sales they refer, using one of your Coupon Codes. Here's how it works. You tell your affiliates about one or more of the Coupon Codes that you accept. Each of your affiliates can add their affiliate ID onto the end of any valid Coupon Code, like this: `COUPON-CODE-A:123`; where `COUPON-CODE` is the valid Coupon Code that you've configured, and `123` is the affiliate's ID. If a Customer comes to your site, and they use a Coupon Code with an affiliate ID on the end of it; your affiliate will be tracked automatically by s2Member. If this Customer actually completes the sale, the referring affiliate will be credited with whatever commission your affiliate program offers. For further details, please check the examples in your Dashboard, here: `s2Member -> Pro Coupon Codes -> Affiliate Coupon Codes`.
185
+ * (s2Member/s2Member Pro) **New feature**. It is now possible to protect `all` Posts, but only of a specific Post Type. For further details, please check your Dashboard, under: `s2Member -> Restriction Options -> Post Level Access Restrictions`.
186
+ * (s2Member Pro) **Improvement**. The s2Member Pro Login Widget now has improved handling of its `%%previous%%` Replacement Code for login redirections. For further details, please see [this thread](http://www.primothemes.com/forums/viewtopic.php?f=4&t=15522&p=48448#p48515).
187
+ * (s2Member/s2Member Pro) **MOP Vars improved**. s2Member MOP Vars ( Membership Options Page Variables ), have been improved in this release. For further details, please check your Dashboard, under: `s2Member -> API / Scripting -> Membership Options Page (Variables)`.
188
+ * (s2Member/s2Member Pro) **bbPress®**. Dropped legacy support for bbPress® stand-alone version. s2Member still supports the WordPress® plugin version of bbPress® v2.0+. However, from this version forward, we will no longer support the legacy s2Member Bridge to the stand-alone version of bbPress®. If you've already installed the s2Member Bridge for the stand-alone version of bbPress®, using a previous release of s2Member, your s2Member Bridge plugin should continue to work. However, the s2Member bbPress® Bridge is no longer included with s2Member, and we will not support the stand-alone version of bbPress® from this point forward.
189
+ * (s2Member) **Bug fix**. s2Member function `c_ws_plugin__s2member_utils_gets::get_all_post_ids()` was not properly excluding Post Type `nav_menu_item`. Fixed in this release.
190
+ * (s2Member) **Bug fix**. s2Member function `c_ws_plugin__s2member_utils_gets::get_all_child_category_ids()` was not including empty terms. Fixed in this release.
191
+ * (s2Member) **Bug fix**. s2Member function `c_ws_plugin__s2member_utils_gets::get_all_tag_ids()` was not including empty terms. Fixed in this release.
192
+ * (s2Member/s2Member Pro) **Routine maintenance**. Some code optimization, some cleanup, and some organizational improvements in preparation for new features in a coming release.
193
+ * (s2Member/s2Member Pro) **WordPress® 3.3-beta2**. Compatibility updates for the coming release of WordPress® 3.3.
194
+
195
  = v111029 =
196
  * (s2Member Pro) **Compatibility**. s2Member Pro now supports automatic upgrades through filesystem methdologies, other than `direct`. For further details, please see [this thread](http://www.primothemes.com/forums/viewtopic.php?f=4&t=15283#p49034).
197
  * (s2Member) **Bug fix**. A bug in the s2Member framework was causing some IPNs with `txn_type = recurring_payment_suspended_due_to_max_failed_payment` to get bypassed inadvertently. Fixed in this release. For further details, please see [this thread](http://www.primothemes.com/forums/viewtopic.php?f=4&t=6204&p=48246#p48361).
s2member.php CHANGED
@@ -19,8 +19,8 @@
19
  */
20
  /* -- This section for WordPress® parsing. ------------------------------------------------------------------------------
21
 
22
- Version: 111029
23
- Stable tag: 111029
24
  Framework: WS-P-110523
25
 
26
  SSL Compatible: yes
@@ -76,7 +76,7 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
76
  * @var str
77
  */
78
  if (!defined ("WS_PLUGIN__S2MEMBER_VERSION"))
79
- define ("WS_PLUGIN__S2MEMBER_VERSION", "111029");
80
  /**
81
  * Minimum PHP version required to run s2Member.
82
  *
@@ -106,7 +106,7 @@ if (!defined ("WS_PLUGIN__S2MEMBER_MIN_WP_VERSION"))
106
  * @var str
107
  */
108
  if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION"))
109
- define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "111029");
110
  /*
111
  Several compatibility checks.
112
  If all pass, load the s2Member plugin.
19
  */
20
  /* -- This section for WordPress® parsing. ------------------------------------------------------------------------------
21
 
22
+ Version: 111105
23
+ Stable tag: 111105
24
  Framework: WS-P-110523
25
 
26
  SSL Compatible: yes
76
  * @var str
77
  */
78
  if (!defined ("WS_PLUGIN__S2MEMBER_VERSION"))
79
+ define ("WS_PLUGIN__S2MEMBER_VERSION", "111105");
80
  /**
81
  * Minimum PHP version required to run s2Member.
82
  *
106
  * @var str
107
  */
108
  if (!defined ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION"))
109
+ define ("WS_PLUGIN__S2MEMBER_MIN_PRO_VERSION", "111105");
110
  /*
111
  Several compatibility checks.
112
  If all pass, load the s2Member plugin.