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

Version Description

= v131109 = (Maintenance Release) Upgrade immediately.

Download this release

Release Info

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

Code changes from version 131026 to 131109

Files changed (46) hide show
  1. checksum.txt +1 -1
  2. images/brand-favicon.png +0 -0
  3. images/s2___.png +0 -0
  4. images/s2___bar.png +0 -0
  5. images/s2___end.png +0 -0
  6. includes/classes/admin-notices.inc.php +1 -1
  7. includes/classes/cache.inc.php +3 -3
  8. includes/classes/constants.inc.php +1 -1
  9. includes/classes/css-js-themes.inc.php +43 -5
  10. includes/classes/menu-pages-rs.inc.php +9 -16
  11. includes/classes/menu-pages-tb.inc.php +83 -0
  12. includes/classes/menu-pages.inc.php +2 -1
  13. includes/classes/no-cache.inc.php +3 -1
  14. includes/classes/s-badge-status-in.inc.php +2 -1
  15. includes/classes/sc-files-in.inc.php +4 -4
  16. includes/classes/utils-html.inc.php +2 -6
  17. includes/classes/utils-strings.inc.php +3 -3
  18. includes/externals/markdown/nc-markdown.inc.php +108 -109
  19. includes/menu-pages/api-ops.inc.php +6 -3
  20. includes/menu-pages/code-samples/jwplayer-v5-standard-mp4.x-php +0 -30
  21. includes/menu-pages/code-samples/jwplayer-v5-streaming-mp4-sca.x-php +0 -42
  22. includes/menu-pages/code-samples/jwplayer-v5-streaming-mp4-webm.x-php +0 -45
  23. includes/menu-pages/code-samples/jwplayer-v5-streaming-mp4.x-php +0 -38
  24. includes/menu-pages/down-ops.inc.php +13 -47
  25. includes/menu-pages/els-ops.inc.php +9 -6
  26. includes/menu-pages/gen-ops.inc.php +9 -6
  27. includes/menu-pages/info.inc.php +5 -2
  28. includes/menu-pages/integrations.inc.php +5 -2
  29. includes/menu-pages/js-c-warning.inc.php +0 -40
  30. includes/menu-pages/logs.inc.php +20 -14
  31. includes/menu-pages/menu-pages-min.js +1 -1
  32. includes/menu-pages/menu-pages.css +753 -429
  33. includes/menu-pages/menu-pages.js +33 -33
  34. includes/menu-pages/mms-ops.inc.php +6 -3
  35. includes/menu-pages/paypal-buttons.inc.php +23 -20
  36. includes/menu-pages/paypal-ops.inc.php +10 -7
  37. includes/menu-pages/res-ops.inc.php +10 -7
  38. includes/menu-pages/scripting.inc.php +9 -6
  39. includes/menu-pages/start.inc.php +6 -3
  40. includes/menu-pages/trk-ops.inc.php +16 -17
  41. includes/menu-pages/updates.inc.php +7 -5
  42. includes/s2member-min.js +1 -1
  43. includes/s2member.js +44 -25
  44. includes/translations/s2member.pot +257 -257
  45. readme.txt +28 -6
  46. s2member.php +5 -5
checksum.txt CHANGED
@@ -1 +1 @@
1
- e9ddca7051c3309be91630e7f6eb17a1
1
+ 4f4a8d6b4f39d49be334333ddb1b073e
images/brand-favicon.png CHANGED
Binary file
images/s2___.png ADDED
Binary file
images/s2___bar.png ADDED
Binary file
images/s2___end.png ADDED
Binary file
includes/classes/admin-notices.inc.php CHANGED
@@ -131,7 +131,7 @@ if (!class_exists ("c_ws_plugin__s2member_admin_notices"))
131
$page = preg_replace ("/^([^\:]*)\:/i", "", $page);
132
133
if (empty ($adms) || in_array ("*", $adms) || in_array ($a, $adms))
134
- if (!$page || "*" === $page || $pagenow === $page || $_GET["page"] === $page)
135
{
136
if /* Time to show it? */ (strtotime ("now") >= (int)$notice["time"])
137
{
131
$page = preg_replace ("/^([^\:]*)\:/i", "", $page);
132
133
if (empty ($adms) || in_array ("*", $adms) || in_array ($a, $adms))
134
+ if (!$page || "*" === $page || $pagenow === $page || @$_GET["page"] === $page)
135
{
136
if /* Time to show it? */ (strtotime ("now") >= (int)$notice["time"])
137
{
includes/classes/cache.inc.php CHANGED
@@ -62,7 +62,7 @@ if (!class_exists ("c_ws_plugin__s2member_cache"))
62
{
63
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["page"] = $lwp;
64
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["time"] = time ();
65
- $links["login_welcome_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["link"] = get_page_link ($lwp);
66
67
$cache_needs_updating = /* Flag for cache update. */ true;
68
}
@@ -74,7 +74,7 @@ if (!class_exists ("c_ws_plugin__s2member_cache"))
74
{
75
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["page"] = $mop;
76
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["time"] = time ();
77
- $links["membership_options_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["link"] = get_page_link ($mop);
78
79
$cache_needs_updating = /* Flag for cache update. */ true;
80
}
@@ -86,7 +86,7 @@ if (!class_exists ("c_ws_plugin__s2member_cache"))
86
{
87
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["page"] = $fdlep;
88
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["time"] = time ();
89
- $links["file_download_limit_exceeded_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["link"] = get_page_link ($fdlep);
90
91
$cache_needs_updating = /* Flag for cache update. */ true;
92
}
62
{
63
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["page"] = $lwp;
64
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["time"] = time ();
65
+ $links["login_welcome_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["login_welcome_page"]["link"] = ($lwp) ? get_page_link ($lwp) : home_url("/");
66
67
$cache_needs_updating = /* Flag for cache update. */ true;
68
}
74
{
75
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["page"] = $mop;
76
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["time"] = time ();
77
+ $links["membership_options_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["membership_options_page"]["link"] = ($mop) ? get_page_link ($mop) : home_url("/");
78
79
$cache_needs_updating = /* Flag for cache update. */ true;
80
}
86
{
87
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["page"] = $fdlep;
88
$GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["time"] = time ();
89
+ $links["file_download_limit_exceeded_page"] = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["cache"]["file_download_limit_exceeded_page"]["link"] = ($fdlep) ? get_page_link ($fdlep) : home_url("/");
90
91
$cache_needs_updating = /* Flag for cache update. */ true;
92
}
includes/classes/constants.inc.php CHANGED
@@ -282,7 +282,7 @@ if (!class_exists ("c_ws_plugin__s2member_constants"))
282
* @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
283
*/
284
if (!defined ("S2MEMBER_CURRENT_USER_ACCESS_LABEL"))
285
- define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]));
286
/**
287
* The current User's Paid Subscription ID (when applicable).
288
*
282
* @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
283
*/
284
if (!defined ("S2MEMBER_CURRENT_USER_ACCESS_LABEL"))
285
+ define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", ($c[] = (string)@$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]));
286
/**
287
* The current User's Paid Subscription ID (when applicable).
288
*
includes/classes/css-js-themes.inc.php CHANGED
@@ -27,7 +27,44 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_themes"))
27
*/
28
class c_ws_plugin__s2member_css_js_themes
29
{
30
- /**
31
* Enqueues CSS file for theme integration.
32
*
33
* @package s2Member\CSS_JS
@@ -41,7 +78,7 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_themes"))
41
{
42
do_action ("ws_plugin__s2member_before_add_css", get_defined_vars ());
43
44
- if /* Not in the admin. */ (!is_admin ())
45
{
46
$s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
47
@@ -71,7 +108,8 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_themes"))
71
72
do_action ("ws_plugin__s2member_before_add_js_w_globals", get_defined_vars ());
73
74
- if (!is_admin () || (is_user_admin () && $pagenow === "profile.php" && !current_user_can ("edit_users")))
75
{
76
$s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
77
@@ -80,11 +118,11 @@ if (!class_exists ("c_ws_plugin__s2member_css_js_themes"))
80
$md5 = /* An MD5 hash based on global key => values. */ WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5;
81
// The MD5 hash allows the script to be cached in the browser until the globals happen to change.
82
// For instance, the global variables may change when a User who is logged-in changes their Profile.
83
- wp_enqueue_script ("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode ($md5) . "&qcABC=1", array ("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
84
}
85
else // Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5.
86
{ // This essentially creates 2 versions of the script. One while logged in & another when not.
87
- wp_enqueue_script ("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=1&qcABC=1", array ("jquery", "password-strength-meter"), c_ws_plugin__s2member_utilities::ver_checksum ());
88
}
89
do_action ("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars ());
90
}
27
*/
28
class c_ws_plugin__s2member_css_js_themes
29
{
30
+ /**
31
+ * Lazy load CSS/JS files?
32
+ *
33
+ * @package s2Member\CSS_JS
34
+ * @since 131028
35
+ *
36
+ * @return boolean TRUE if we should load; else FALSE.
37
+ */
38
+ public static function lazy_load_css_js ()
39
+ {
40
+ static $load; // Static cache var.
41
+
42
+ if(isset($load)) return $load;
43
+
44
+ if(c_ws_plugin__s2member_systematics::is_s2_systematic_use_page())
45
+ $load = TRUE;
46
+
47
+ else if(c_ws_plugin__s2member_utils_conds::bp_is_installed()
48
+ && (bp_is_register_page() || bp_is_activation_page() || bp_is_user_profile()))
49
+ $load = TRUE;
50
+
51
+ else if(is_singular() && ($post = get_post())
52
+ && (stripos($post->post_content, "s2member") !== FALSE
53
+ || stripos($post->post_content, "[s2") !== FALSE))
54
+ $load = TRUE;
55
+
56
+ else if(preg_match("/\/wp\-signup\.php".
57
+ "|\/wp\-login\.php".
58
+ "|\/wp\-admin\/(?:user\/)?profile\.php".
59
+ "|[?&]s2member/", $_SERVER["REQUEST_URI"]))
60
+ $load = TRUE;
61
+
62
+ if(!isset($load)) $load = FALSE; // Make sure it's set; always.
63
+
64
+ return ($load = apply_filters("ws_plugin__s2member_lazy_load_css_js", $load));
65
+ }
66
+
67
+ /**
68
* Enqueues CSS file for theme integration.
69
*
70
* @package s2Member\CSS_JS
78
{
79
do_action ("ws_plugin__s2member_before_add_css", get_defined_vars ());
80
81
+ if(!is_admin () && c_ws_plugin__s2member_css_js_themes::lazy_load_css_js())
82
{
83
$s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
84
108
109
do_action ("ws_plugin__s2member_before_add_js_w_globals", get_defined_vars ());
110
111
+ if ((!is_admin() && c_ws_plugin__s2member_css_js_themes::lazy_load_css_js())
112
+ || (is_user_admin () && $pagenow === "profile.php" && !current_user_can ("edit_users")))
113
{
114
$s2o = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["s2o_url"];
115
118
$md5 = /* An MD5 hash based on global key => values. */ WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5;
119
// The MD5 hash allows the script to be cached in the browser until the globals happen to change.
120
// For instance, the global variables may change when a User who is logged-in changes their Profile.
121
+ wp_enqueue_script ("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode ($md5) . "&qcABC=1", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum (), TRUE);
122
}
123
else // Else if they are not logged in, we distinguish the JavaScript file by NOT including $md5.
124
{ // This essentially creates 2 versions of the script. One while logged in & another when not.
125
+ wp_enqueue_script ("ws-plugin--s2member", $s2o . "?ws_plugin__s2member_js_w_globals=1&qcABC=1", array ("jquery"), c_ws_plugin__s2member_utilities::ver_checksum (), TRUE);
126
}
127
do_action ("ws_plugin__s2member_during_add_js_w_globals", get_defined_vars ());
128
}
includes/classes/menu-pages-rs.inc.php CHANGED
@@ -39,13 +39,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages_rs"))
39
{
40
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
41
42
- echo '<div id="ws-menu-page-js-c-w" class="ws-menu-page-js-c-w">' . "\n";
43
- include_once dirname (dirname (__FILE__)) . "/menu-pages/js-c-warning.inc.php";
44
- echo '</div>' . "\n";
45
-
46
- echo '<script type="text/javascript">' . "\n";
47
- echo "jQuery('div#ws-menu-page-js-c-w').hide();" . "\n";
48
- echo '</script>' . "\n";
49
50
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["updates"])
51
{
@@ -53,59 +47,58 @@ if (!class_exists ("c_ws_plugin__s2member_menu_pages_rs"))
53
include_once dirname (dirname (__FILE__)) . "/menu-pages/updates.inc.php";
54
echo '</div>' . "\n";
55
}
56
-
57
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"])
58
{
59
echo '<div class="ws-menu-page-others">' . "\n";
60
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-upsell-pro.png" alt="." /></a>' . "\n";
61
echo '</div>' . "\n";
62
}
63
-
64
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"])
65
{
66
echo '<div class="ws-menu-page-installation">' . "\n";
67
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Professional Installation URI")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-installation.png" alt="." /></a>' . "\n";
68
echo '</div>' . "\n";
69
}
70
-
71
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"])
72
{
73
echo '<div class="ws-menu-page-tools">' . "\n";
74
echo '<img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-tools.png" alt="." />' . "\n";
75
echo '</div>' . "\n";
76
}
77
-
78
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["kb"])
79
{
80
echo '<div class="ws-menu-page-kb">' . "\n";
81
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Knowledge Base")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-kb.png" alt="." /></a>' . "\n";
82
echo '</div>' . "\n";
83
}
84
-
85
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["videos"])
86
{
87
echo '<div class="ws-menu-page-videos">' . "\n";
88
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Video Tutorials")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-videos.png" alt="." /></a>' . "\n";
89
echo '</div>' . "\n";
90
}
91
-
92
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"])
93
{
94
echo '<div class="ws-menu-page-support">' . "\n";
95
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Forum URI")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-support.png" alt="." /></a>' . "\n";
96
echo '</div>' . "\n";
97
}
98
-
99
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["donations"])
100
{
101
echo '<div class="ws-menu-page-donations">' . "\n";
102
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Donate link")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-donations.png" alt="." /></a>' . "\n";
103
echo '</div>' . "\n";
104
}
105
-
106
do_action ("ws_plugin__s2member_during_menu_pages_after_right_sections", get_defined_vars ());
107
108
- return /* Return for uniformity. */;
109
}
110
}
111
}
39
{
40
do_action ("ws_plugin__s2member_during_menu_pages_before_right_sections", get_defined_vars ());
41
42
+ ob_start(); // output buffer these so we can display a toggler conditionally.
43
44
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["updates"])
45
{
47
include_once dirname (dirname (__FILE__)) . "/menu-pages/updates.inc.php";
48
echo '</div>' . "\n";
49
}
50
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"])
51
{
52
echo '<div class="ws-menu-page-others">' . "\n";
53
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-upsell-pro.png" alt="." /></a>' . "\n";
54
echo '</div>' . "\n";
55
}
56
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"])
57
{
58
echo '<div class="ws-menu-page-installation">' . "\n";
59
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Professional Installation URI")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-installation.png" alt="." /></a>' . "\n";
60
echo '</div>' . "\n";
61
}
62
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["tools"])
63
{
64
echo '<div class="ws-menu-page-tools">' . "\n";
65
echo '<img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-tools.png" alt="." />' . "\n";
66
echo '</div>' . "\n";
67
}
68
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["kb"])
69
{
70
echo '<div class="ws-menu-page-kb">' . "\n";
71
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Knowledge Base")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-kb.png" alt="." /></a>' . "\n";
72
echo '</div>' . "\n";
73
}
74
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["videos"])
75
{
76
echo '<div class="ws-menu-page-videos">' . "\n";
77
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Video Tutorials")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-videos.png" alt="." /></a>' . "\n";
78
echo '</div>' . "\n";
79
}
80
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"])
81
{
82
echo '<div class="ws-menu-page-support">' . "\n";
83
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Forum URI")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-support.png" alt="." /></a>' . "\n";
84
echo '</div>' . "\n";
85
}
86
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["donations"])
87
{
88
echo '<div class="ws-menu-page-donations">' . "\n";
89
echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Donate link")) . '" target="_blank"><img src="' . esc_attr ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-donations.png" alt="." /></a>' . "\n";
90
echo '</div>' . "\n";
91
}
92
+ if (($rs = ob_get_clean()))
93
+ {
94
+ $rs = '<div class="wrapper">'.$rs.'</div>';
95
+ $rs = '<div class="toggler" title="toggle sidebar"'.
96
+ ((!empty($_GET['page']) && preg_match('/\-(?:start|info)#x2F;', $_GET['page'])) ? ' default-state="open"' : '').'></div>' . "\n".$rs;
97
+ echo $rs; // output content now; w/ possible toggler.
98
+ }
99
do_action ("ws_plugin__s2member_during_menu_pages_after_right_sections", get_defined_vars ());
100
101
+ return /* return for uniformity. */;
102
}
103
}
104
}
includes/classes/menu-pages-tb.inc.php ADDED
@@ -0,0 +1,83 @@
1
+ <?php
2
+ /**
3
+ * Toolbox for Menu Pages.
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\Menu_Pages
15
+ * @since 131108
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_tb"))
21
+ {
22
+ /**
23
+ * Toolbox for Menu Pages.
24
+ *
25
+ * @package s2Member\Menu_Pages
26
+ * @since 131108
27
+ */
28
+ class c_ws_plugin__s2member_menu_pages_tb
29
+ {
30
+ /**
31
+ * Toolbox for Menu Pages.
32
+ *
33
+ * @package s2Member\Menu_Pages
34
+ * @since 131108
35
+ *
36
+ * @return null
37
+ */
38
+ public static function display ()
39
+ {
40
+ do_action ("ws_plugin__s2member_during_menu_pages_before_toolbox_sections", get_defined_vars ());
41
+
42
+ ob_start(); // output buffer these so we can display a toggler conditionally.
43
+
44
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["updates"])
45
+ {
46
+ echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Newsletter")) . '" target="_blank"><i class="fa fa-envelope"></i> s2 Updates (via Email)</a>';
47
+ }
48
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["upsell-pro"])
49
+ {
50
+ echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Pro Module / Prices")) . '" target="_blank" style="font-size:120%; font-weight:bold;"><i class="fa fa-money"></i> s2Member® Pro (Upgrade)</a>' . "\n";
51
+ }
52
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["installation"])
53
+ {
54
+ echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Professional Installation URI")) . '" target="_blank"><i class="fa fa-wrench"></i> Professional Installation Service</a>' . "\n";
55
+ }
56
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["kb"])
57
+ {
58
+ echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Knowledge Base")) . '" target="_blank"><i class="fa fa-lightbulb-o"></i> Knowledge Base</a>' . "\n";
59
+ }
60
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["videos"])
61
+ {
62
+ echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Video Tutorials")) . '" target="_blank"><i class="fa fa-film"></i> Video Tutorials</a>' . "\n";
63
+ }
64
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["support"])
65
+ {
66
+ echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Forum URI")) . '" target="_blank"><i class="fa fa-comments-o"></i> Community</a>' . "\n";
67
+ }
68
+ if ($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["menu_pages"]["donations"])
69
+ {
70
+ echo '<a href="' . esc_attr (c_ws_plugin__s2member_readmes::parse_readme_value ("Donate link")) . '" target="_blank"><i class="fa fa-heart-o"></i> Contribute</a>' . "\n";
71
+ }
72
+ if (($links = ob_get_clean()))
73
+ {
74
+ $links = '<div class="links">'.$links.'</div>';
75
+ echo $links; // output content now; w/ possible toggler.
76
+ }
77
+ do_action ("ws_plugin__s2member_during_menu_pages_after_toolbox_sections", get_defined_vars ());
78
+
79
+ return /* return for uniformity. */;
80
+ }
81
+ }
82
+ }
83
+ ?>
includes/classes/menu-pages.inc.php CHANGED
@@ -148,7 +148,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_pages"))
148
$menu = apply_filters("ws_plugin__s2member_during_add_admin_options_menu_slug", "ws-plugin--s2member-start", get_defined_vars());
149
150
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_menu_page", true, get_defined_vars()))
151
- add_menu_page("s2Member", "s2Member", "create_users", $menu, "c_ws_plugin__s2member_menu_pages::start_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images/brand-favicon.png");
152
153
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars()))
154
add_submenu_page($menu, "s2Member Quick-Start Guide", "Quick-Start Guide", "create_users", "ws-plugin--s2member-start", "c_ws_plugin__s2member_menu_pages::start_page");
148
$menu = apply_filters("ws_plugin__s2member_during_add_admin_options_menu_slug", "ws-plugin--s2member-start", get_defined_vars());
149
150
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_menu_page", true, get_defined_vars()))
151
+ add_menu_page(((c_ws_plugin__s2member_utils_conds::pro_is_installed()) ? "s2Member (Pro)" : "s2Member"), ((c_ws_plugin__s2member_utils_conds::pro_is_installed()) ? "s2Member (Pro)" : "s2Member"),
152
+ "create_users", $menu, "c_ws_plugin__s2member_menu_pages::start_page", $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]."/images/brand-favicon.png");
153
154
if(apply_filters("ws_plugin__s2member_during_add_admin_options_add_start_page", true, get_defined_vars()))
155
add_submenu_page($menu, "s2Member Quick-Start Guide", "Quick-Start Guide", "create_users", "ws-plugin--s2member-start", "c_ws_plugin__s2member_menu_pages::start_page");
includes/classes/no-cache.inc.php CHANGED
@@ -88,7 +88,9 @@ if (!class_exists ("c_ws_plugin__s2member_no_cache"))
88
do_action ("ws_plugin__s2member_before_no_cache_constants", get_defined_vars ());
89
unset /* Unset defined __refs, __v. */ ($__refs, $__v);
90
91
- if (!$once && empty ($_GET["qcAC"]) && ($no_cache || is_user_logged_in () || c_ws_plugin__s2member_systematics::is_s2_systematic_use_page ()))
92
{
93
/**
94
* No-cache DB queries for plugins.
88
do_action ("ws_plugin__s2member_before_no_cache_constants", get_defined_vars ());
89
unset /* Unset defined __refs, __v. */ ($__refs, $__v);
90
91
+ if (!$once && empty ($_GET["qcAC"]) && ($no_cache
92
+ || (is_user_logged_in () && (!defined("QUICK_CACHE_WHEN_LOGGED_IN") || !QUICK_CACHE_WHEN_LOGGED_IN))
93
+ || c_ws_plugin__s2member_systematics::is_s2_systematic_use_page ()))
94
{
95
/**
96
* No-cache DB queries for plugins.
includes/classes/s-badge-status-in.inc.php CHANGED
@@ -71,7 +71,8 @@ if (!class_exists ("c_ws_plugin__s2member_s_badge_status_in"))
71
{
72
if (defined ("DB_USER") && DB_USER && defined ("DB_PASSWORD") && DB_PASSWORD && DB_USER !== DB_PASSWORD)
73
{
74
- if (!apply_filters ("ws_plugin__s2member_disable_all_ip_restrictions", false, get_defined_vars ()) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"])
75
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"])
76
{
77
if ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"] && !glob($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"].'/*'))
71
{
72
if (defined ("DB_USER") && DB_USER && defined ("DB_PASSWORD") && DB_PASSWORD && DB_USER !== DB_PASSWORD)
73
{
74
+ if ((!apply_filters ("ws_plugin__s2member_disable_all_ip_restrictions", false, get_defined_vars ()) && $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_ip_restriction"])
75
+ || ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_simultaneous_logins"]) /* Either of these are acceptable. */)
76
if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["max_failed_login_attempts"])
77
{
78
if ((!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"] && !glob($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"].'/*'))
includes/classes/sc-files-in.inc.php CHANGED
@@ -102,7 +102,7 @@ if(!class_exists("c_ws_plugin__s2member_sc_files_in"))
102
103
$attr = /* Force array; trim quote entities. */ c_ws_plugin__s2member_utils_strings::trim_qts_deep((array)$attr);
104
105
- $attr = shortcode_atts(array("download" => "", "download_key" => "", "stream" => "yes", "inline" => "yes", "storage" => "", "remote" => "", "ssl" => "", "rewrite" => "yes", "rewrite_base" => "", "skip_confirmation" => "", "url_to_storage_source" => "yes", "count_against_user" => "yes", "check_user" => "yes", /* Shortcode-specifics »» */ "file_download" => "", /* Configuration » */ "player" => "jwplayer-v6-rtmp", "player_id" => "s2-stream-".md5(uniqid("", TRUE)), "player_path" => "/jwplayer/jwplayer.js", "player_key" => "", "player_title" => "", "player_image" => "", "player_mediaid" => "", "player_description" => "", "player_captions" => "", /* Layout » */ "player_controls" => "yes", "player_skin" => "", "player_stretching" => "uniform", "player_width" => "480", "player_height" => "270", "player_aspectratio" => "", /* Playback » */ "player_autostart" => "no", "player_fallback" => "yes", "player_mute" => "no", "player_primary" => "flash", "player_repeat" => "no", "player_startparam" => "", /* Advanced option blocks » */ "player_option_blocks" => ""), $attr);
106
$attr["download"] = (!empty($attr["file_download"])) ? $attr["file_download"] : $attr["download"];
107
108
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;
@@ -116,7 +116,7 @@ if(!class_exists("c_ws_plugin__s2member_sc_files_in"))
116
$config[$key] = $value;
117
118
unset /* Ditch these now. We don't want these bleeding into Hooks/Filters anyway. */($key, $value);
119
-
120
if /* Looking for a File Download URL? */(!empty($config) && isset($config["file_download"]))
121
{
122
$_get = c_ws_plugin__s2member_files::create_file_download_url($config, TRUE);
@@ -129,7 +129,7 @@ if(!class_exists("c_ws_plugin__s2member_sc_files_in"))
129
if(strpos($attr["player"], "jwplayer-v6") === 0)
130
{
131
$get = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($template)));
132
-
133
$get = preg_replace("/%%streamer%%/", $_get["streamer"], $get);
134
$get = preg_replace("/%%prefix%%/", $_get["prefix"], $get);
135
$get = preg_replace("/%%file%%/", $_get["file"], $get);
@@ -155,7 +155,7 @@ if(!class_exists("c_ws_plugin__s2member_sc_files_in"))
155
$get = preg_replace("/%%player_aspectratio%%/", $attr["player_aspectratio"], $get);
156
$get = preg_replace("/%%player_skin%%/", $attr["player_skin"], $get);
157
$get = preg_replace("/%%player_stretching%%/", $attr["player_stretching"], $get);
158
-
159
$get = preg_replace("/%%player_autostart%%/", ((filter_var($attr["player_autostart"], FILTER_VALIDATE_BOOLEAN)) ? "true" : "false"), $get);
160
$get = preg_replace("/%%player_fallback%%/", ((filter_var($attr["player_fallback"], FILTER_VALIDATE_BOOLEAN)) ? "true" : "false"), $get);
161
$get = preg_replace("/%%player_mute%%/", ((filter_var($attr["player_mute"], FILTER_VALIDATE_BOOLEAN)) ? "true" : "false"), $get);
102
103
$attr = /* Force array; trim quote entities. */ c_ws_plugin__s2member_utils_strings::trim_qts_deep((array)$attr);
104
105
+ $attr = shortcode_atts(array("download" => "", "download_key" => "", "stream" => "yes", "inline" => "yes", "storage" => "", "remote" => "", "ssl" => "", "rewrite" => "yes", "rewrite_base" => "", "skip_confirmation" => "", "url_to_storage_source" => "yes", "count_against_user" => "yes", "check_user" => "yes", /* Shortcode-specifics »» */ "file_download" => "", /* Configuration » */ "player" => "jwplayer-v6-rtmp", "player_id" => "s2-stream-".md5(uniqid("", TRUE)), "player_path" => "/jwplayer/jwplayer.js", "player_key" => "", "player_title" => "", "player_image" => "", "player_mediaid" => "", "player_description" => "", "player_captions" => "", /* Layout » */ "player_controls" => "yes", "player_skin" => "", "player_stretching" => "uniform", "player_width" => "480", "player_height" => "270", "player_aspectratio" => "", /* Playback » */ "player_autostart" => "no", "player_fallback" => "yes", "player_mute" => "no", "player_primary" => (($attr["player"] === "jw-player-v6") ? "html5" : "flash"), "player_repeat" => "no", "player_startparam" => "", /* Advanced option blocks » */ "player_option_blocks" => ""), $attr);
106
$attr["download"] = (!empty($attr["file_download"])) ? $attr["file_download"] : $attr["download"];
107
108
foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$__v;
116
$config[$key] = $value;
117
118
unset /* Ditch these now. We don't want these bleeding into Hooks/Filters anyway. */($key, $value);
119
+
120
if /* Looking for a File Download URL? */(!empty($config) && isset($config["file_download"]))
121
{
122
$_get = c_ws_plugin__s2member_files::create_file_download_url($config, TRUE);
129
if(strpos($attr["player"], "jwplayer-v6") === 0)
130
{
131
$get = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($template)));
132
+
133
$get = preg_replace("/%%streamer%%/", $_get["streamer"], $get);
134
$get = preg_replace("/%%prefix%%/", $_get["prefix"], $get);
135
$get = preg_replace("/%%file%%/", $_get["file"], $get);
155
$get = preg_replace("/%%player_aspectratio%%/", $attr["player_aspectratio"], $get);
156
$get = preg_replace("/%%player_skin%%/", $attr["player_skin"], $get);
157
$get = preg_replace("/%%player_stretching%%/", $attr["player_stretching"], $get);
158
+
159
$get = preg_replace("/%%player_autostart%%/", ((filter_var($attr["player_autostart"], FILTER_VALIDATE_BOOLEAN)) ? "true" : "false"), $get);
160
$get = preg_replace("/%%player_fallback%%/", ((filter_var($attr["player_fallback"], FILTER_VALIDATE_BOOLEAN)) ? "true" : "false"), $get);
161
$get = preg_replace("/%%player_mute%%/", ((filter_var($attr["player_mute"], FILTER_VALIDATE_BOOLEAN)) ? "true" : "false"), $get);
includes/classes/utils-html.inc.php CHANGED
@@ -54,15 +54,11 @@ if (!class_exists ("c_ws_plugin__s2member_utils_html"))
54
55
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' . "\n";
56
57
- echo '<script type="text/javascript" src="' . esc_attr (site_url ("/wp-includes/js/jquery/jquery.js?ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
58
-
59
- echo '<script type="text/javascript">' . "var pwsL10n = {empty: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Strength indicator", "s2member-front", "s2member")) . "', short: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Very weak", "s2member-front", "s2member")) . "', bad: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Weak", "s2member-front", "s2member")) . "', good: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Medium", "s2member-front", "s2member")) . "', strong: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Strong", "s2member-front", "s2member")) . "', mismatch: '" . c_ws_plugin__s2member_utils_strings::esc_js_sq (_x ("Mismatch", "s2member-front", "s2member")) . "'};</script>" . "\n";
60
- echo '<script type="text/javascript" src="' . esc_attr (site_url ("/wp-admin/js/password-strength-meter.js?ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
61
62
echo '<script type="text/javascript" src="' . esc_attr ($s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode (WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5) . "&amp;qcABC=1&amp;ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ())) . '"></script>' . "\n";
63
64
- echo '<link href="' . esc_attr ($s2o . "?ws_plugin__s2member_css=1&amp;qcABC=1&amp;ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ())) . '" type="text/css" rel="stylesheet" media="all" />' . "\n";
65
-
66
if ($doctype_html_head_title) // Add <title></title> tag?
67
echo '<title>' . $doctype_html_head_title . '</title>' . "\n";
68
54
55
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' . "\n";
56
57
+ echo '<link href="' . esc_attr ($s2o . "?ws_plugin__s2member_css=1&amp;qcABC=1&amp;ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ())) . '" type="text/css" rel="stylesheet" media="all" />' . "\n";
58
59
+ echo '<script type="text/javascript" src="' . esc_attr (site_url ("/wp-includes/js/jquery/jquery.js?ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ()))) . '"></script>' . "\n";
60
echo '<script type="text/javascript" src="' . esc_attr ($s2o . "?ws_plugin__s2member_js_w_globals=" . urlencode (WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5) . "&amp;qcABC=1&amp;ver=" . urlencode (c_ws_plugin__s2member_utilities::ver_checksum ())) . '"></script>' . "\n";
61
62
if ($doctype_html_head_title) // Add <title></title> tag?
63
echo '<title>' . $doctype_html_head_title . '</title>' . "\n";
64
includes/classes/utils-strings.inc.php CHANGED
@@ -332,9 +332,9 @@ if(!class_exists("c_ws_plugin__s2member_utils_strings"))
332
*/
333
public static function highlight_php($string = FALSE)
334
{
335
- $string = highlight_string((string)$string, true); // Start with PHP syntax, then Shortcodes.
336
-
337
- return preg_replace("/\[\/?_*s2[a-z0-9_\-]+.*?\]/i", '<span style="color:#164A61;">$0</span>', $string);
338
}
339
/**
340
* Parses email addresses from a string or array.
332
*/
333
public static function highlight_php($string = FALSE)
334
{
335
+ $string = highlight_string(trim((string)$string), true); // Start with PHP syntax, then Shortcodes.
336
+ $string = preg_replace("/\[\/?_*s2[a-z0-9_\-]+.*?\]/i", '<span style="color:#164A61;">$0</span>', $string);
337
+ return str_replace('<code>', '<code class="highlight-php">', $string);
338
}
339
/**
340
* Parses email addresses from a string or array.
includes/externals/markdown/nc-markdown.inc.php CHANGED
@@ -27,8 +27,7 @@ function NC_Markdown($text) {
27
28
static $parser;
29
if (!isset($parser)) {
30
- $parser_class = NC_Markdown_Parser;
31
- $parser = new $parser_class;
32
}
33
34
return $parser->transform($text);
@@ -44,7 +43,7 @@ class NC_Markdown_Parser {
44
# Needed to insert a maximum bracked depth while converting to PHP.
45
var $nested_brackets_depth = 6;
46
var $nested_brackets_re;
47
-
48
var $nested_url_parenthesis_depth = 4;
49
var $nested_url_parenthesis_re;
50
@@ -55,11 +54,11 @@ class NC_Markdown_Parser {
55
# Change to ">" for HTML output.
56
var $empty_element_suffix = " />";
57
var $tab_width = 4;
58
-
59
# Change to `true` to disallow markup or entities.
60
var $no_markup = false;
61
var $no_entities = false;
62
-
63
# Predefined urls and titles for reference links and images.
64
var $predef_urls = array();
65
var $predef_titles = array();
@@ -71,17 +70,17 @@ class NC_Markdown_Parser {
71
#
72
$this->_initDetab();
73
$this->prepareItalicsAndBold();
74
-
75
- $this->nested_brackets_re =
76
str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth).
77
str_repeat('\])*', $this->nested_brackets_depth);
78
-
79
- $this->nested_url_parenthesis_re =
80
str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth).
81
str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth);
82
-
83
$this->escape_chars_re = '['.preg_quote($this->escape_chars).']';
84
-
85
# Sort document, block, and span gamut in ascendent priority order.
86
asort($this->document_gamut);
87
asort($this->block_gamut);
@@ -93,27 +92,27 @@ class NC_Markdown_Parser {
93
var $urls = array();
94
var $titles = array();
95
var $html_hashes = array();
96
-
97
# Status flag to avoid invalid nesting.
98
var $in_anchor = false;
99
-
100
-
101
function setup() {
102
#
103
- # Called before the transformation process starts to setup parser
104
# states.
105
#
106
# Clear global hashes.
107
$this->urls = $this->predef_urls;
108
$this->titles = $this->predef_titles;
109
$this->html_hashes = array();
110
-
111
$in_anchor = false;
112
}
113
-
114
function teardown() {
115
#
116
- # Called after the transformation process to clear any variable
117
# which may be taking up memory unnecessarly.
118
#
119
$this->urls = array();
@@ -128,7 +127,7 @@ class NC_Markdown_Parser {
128
# and pass it through the document gamut.
129
#
130
$this->setup();
131
-
132
# Remove UTF-8 BOM and marker character in input, if present.
133
$text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text);
134
@@ -155,16 +154,16 @@ class NC_Markdown_Parser {
155
foreach ($this->document_gamut as $method => $priority) {
156
$text = $this->$method($text);
157
}
158
-
159
$this->teardown();
160
161
return $text . "\n";
162
}
163
-
164
var $document_gamut = array(
165
# Strip link definitions, store in hashes.
166
"stripLinkDefinitions" => 20,
167
-
168
"runBasicBlockGamut" => 30,
169
);
170
@@ -220,8 +219,8 @@ class NC_Markdown_Parser {
220
# hard-coded:
221
#
222
# * List "a" is made of tags which can be both inline or block-level.
223
- # These will be treated block-level when the start tag is alone on
224
- # its line, otherwise they're not matched here and will be taken as
225
# inline later.
226
# * List "b" is made of tags which are always block-level;
227
#
@@ -243,7 +242,7 @@ class NC_Markdown_Parser {
243
|
244
\'[^\']*\' # text inside single quotes (tolerate ">")
245
)*
246
- )?
247
';
248
$content =
249
str_repeat('
@@ -260,7 +259,7 @@ class NC_Markdown_Parser {
260
str_repeat('
261
</\2\s*> # closing nested tag
262
)
263
- |
264
<(?!/\2\s*> # other tags with a different name
265
)
266
)*',
@@ -286,9 +285,9 @@ class NC_Markdown_Parser {
286
)
287
( # save in $1
288
289
- # Match from `\n<tag>` to `</tag>\n`, handling nested tags
290
# in between.
291
-
292
[ ]{0,'.$less_than_tab.'}
293
<('.$block_tags_b_re.')# start tag = $2
294
'.$attr.'> # attributes followed by > and \n
@@ -306,28 +305,28 @@ class NC_Markdown_Parser {
306
</\3> # the matching end tag
307
[ ]* # trailing spaces/tabs
308
(?=\n+|\Z) # followed by a newline or end of document
309
-
310
- | # Special case just for <hr />. It was easier to make a special
311
# case than to make the other regex more complicated.
312
-
313
[ ]{0,'.$less_than_tab.'}
314
<(hr) # start tag = $2
315
'.$attr.' # attributes
316
/?> # the matching end tag
317
[ ]*
318
(?=\n{2,}|\Z) # followed by a blank line or end of document
319
-
320
| # Special case for standalone HTML comments:
321
-
322
[ ]{0,'.$less_than_tab.'}
323
(?s:
324
<!-- .*? -->
325
)
326
[ ]*
327
(?=\n{2,}|\Z) # followed by a blank line or end of document
328
-
329
| # PHP and ASP-style processor instructions (<? and <%)
330
-
331
[ ]{0,'.$less_than_tab.'}
332
(?s:
333
<([?%]) # $2
@@ -336,7 +335,7 @@ class NC_Markdown_Parser {
336
)
337
[ ]*
338
(?=\n{2,}|\Z) # followed by a blank line or end of document
339
-
340
)
341
)}Sxmi',
342
array(&$this, '_hashHTMLBlocks_callback'),
@@ -349,11 +348,11 @@ class NC_Markdown_Parser {
349
$key = $this->hashBlock($text);
350
return "\n\n$key\n\n";
351
}
352
-
353
-
354
function hashPart($text, $boundary = 'X') {
355
#
356
- # Called whenever a tag must be hashed when a function insert an atomic
357
# element in the text stream. Passing $text to through this function gives
358
# a unique text-token which will be reverted back when calling unhash.
359
#
@@ -365,7 +364,7 @@ class NC_Markdown_Parser {
365
# Swap back any tag hash found in $text so we do not have to `unhash`
366
# multiple times at the end.
367
$text = $this->unhash($text);
368
-
369
# Then hash the block.
370
static $i = 0;
371
$key = "$boundary\x1A" . ++$i . $boundary;
@@ -389,7 +388,7 @@ class NC_Markdown_Parser {
389
#
390
"doHeaders" => 10,
391
"doHorizontalRules" => 20,
392
-
393
"doLists" => 40,
394
"doCodeBlocks" => 50,
395
"doBlockQuotes" => 60,
@@ -399,33 +398,33 @@ class NC_Markdown_Parser {
399
#
400
# Run block gamut tranformations.
401
#
402
- # We need to escape raw HTML in Markdown source before doing anything
403
- # else. This need to be done for each block, and not only at the
404
# begining in the Markdown function since hashed blocks can be part of
405
- # list items and could have been indented. Indented blocks would have
406
# been seen as a code block in a previous pass of hashHTMLBlocks.
407
$text = $this->hashHTMLBlocks($text);
408
-
409
return $this->runBasicBlockGamut($text);
410
}
411
-
412
function runBasicBlockGamut($text) {
413
#
414
- # Run block gamut tranformations, without hashing HTML blocks. This is
415
# useful when HTML blocks are known to be already hashed, like in the first
416
# whole-document pass.
417
#
418
foreach ($this->block_gamut as $method => $priority) {
419
$text = $this->$method($text);
420
}
421
-
422
# Finally form paragraph and restore hashed blocks.
423
$text = $this->formParagraphs($text);
424
425
return $text;
426
}
427
-
428
-
429
function doHorizontalRules($text) {
430
# Do Horizontal Rules:
431
return preg_replace(
@@ -439,7 +438,7 @@ class NC_Markdown_Parser {
439
[ ]* # Tailing spaces
440
$ # End of line.
441
}mx',
442
- "\n".$this->hashBlock("<hr$this->empty_element_suffix")."\n",
443
$text);
444
}
445
@@ -457,7 +456,7 @@ class NC_Markdown_Parser {
457
# because ![foo][f] looks like an anchor.
458
"doImages" => 10,
459
"doAnchors" => 20,
460
-
461
# Make links out of things like `<http://example.com/>`
462
# Must come after doAnchors, because you can use < and >
463
# delimiters in inline links like [this](<url>).
@@ -478,11 +477,11 @@ class NC_Markdown_Parser {
478
479
return $text;
480
}
481
-
482
-
483
function doHardBreaks($text) {
484
# Do hard breaks:
485
- return preg_replace_callback('/ {2,}\n/',
486
array(&$this, '_doHardBreaks_callback'), $text);
487
}
488
function _doHardBreaks_callback($matches) {
@@ -496,7 +495,7 @@ class NC_Markdown_Parser {
496
#
497
if ($this->in_anchor) return $text;
498
$this->in_anchor = true;
499
-
500
#
501
# First, handle reference-style links: [link text] [id]
502
#
@@ -569,7 +568,7 @@ class NC_Markdown_Parser {
569
# for shortcut links like [this][] or [this].
570
$link_id = $link_text;
571
}
572
-
573
# lower-case and turn embedded newlines into spaces
574
$link_id = strtolower($link_id);
575
$link_id = preg_replace('{[ ]?\n}', ' ', $link_id);
@@ -577,14 +576,14 @@ class NC_Markdown_Parser {
577
if (isset($this->urls[$link_id])) {
578
$url = $this->urls[$link_id];
579
$url = $this->encodeAttribute($url);
580
-
581
$result = "<a href=\"$url\"";
582
if ( isset( $this->titles[$link_id] ) ) {
583
$title = $this->titles[$link_id];
584
$title = $this->encodeAttribute($title);
585
$result .= " title=\"$title\"";
586
}
587
-
588
$link_text = $this->runSpanGamut($link_text);
589
$result .= ">$link_text</a>";
590
$result = $this->hashPart($result);
@@ -607,7 +606,7 @@ class NC_Markdown_Parser {
607
$title = $this->encodeAttribute($title);
608
$result .= " title=\"$title\"";
609
}
610
-
611
$link_text = $this->runSpanGamut($link_text);
612
$result .= ">$link_text</a>";
613
@@ -636,7 +635,7 @@ class NC_Markdown_Parser {
636
\]
637
638
)
639
- }xs',
640
array(&$this, '_doImages_reference_callback'), $text);
641
642
#
@@ -721,7 +720,7 @@ class NC_Markdown_Parser {
721
# Setext-style headers:
722
# Header 1
723
# ========
724
- #
725
# Header 2
726
# --------
727
#
@@ -751,7 +750,7 @@ class NC_Markdown_Parser {
751
# Terrible hack to check we haven't found an empty list item.
752
if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
753
return $matches[0];
754
-
755
$level = $matches[2]{0} == '=' ? 1 : 2;
756
$block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>";
757
return "\n" . $this->hashBlock($block) . "\n\n";
@@ -798,10 +797,10 @@ class NC_Markdown_Parser {
798
)
799
)
800
'; // mx
801
-
802
# We use a different prefix before nested lists than top-level lists.
803
# See extended comment in _ProcessListItems().
804
-
805
if ($this->list_level) {
806
$text = preg_replace_callback('{
807
^
@@ -825,15 +824,15 @@ class NC_Markdown_Parser {
825
$marker_ul_re = '[*+-]';
826
$marker_ol_re = '\d+[.]';
827
$marker_any_re = "(?:$marker_ul_re|$marker_ol_re)";
828
-
829
$list = $matches[1];
830
$list_type = preg_match("/$marker_ul_re/", $matches[3]) ? "ul" : "ol";
831
-
832
$marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re );
833
-
834
$list .= "\n";
835
$result = $this->processListItems($list, $marker_any_re);
836
-
837
$result = $this->hashBlock("<$list_type>\n" . $result . "</$list_type>");
838
return "\n". $result ."\n\n";
839
}
@@ -865,7 +864,7 @@ class NC_Markdown_Parser {
865
# without resorting to mind-reading. Perhaps the solution is to
866
# change the syntax rules such that sub-lists must start with a
867
# starting cardinal number; e.g. "1." or "a.".
868
-
869
$this->list_level++;
870
871
# trim trailing blank lines:
@@ -893,7 +892,7 @@ class NC_Markdown_Parser {
893
$marker_space = $matches[3];
894
$tailing_blank_line =& $matches[5];
895
896
- if ($leading_line || $tailing_blank_line ||
897
preg_match('/\n{2,}/', $item))
898
{
899
# Replace marker with the appropriate whitespace indentation
@@ -968,7 +967,7 @@ class NC_Markdown_Parser {
968
'___' => '(?<=\S)(?<!_)___(?!_)',
969
);
970
var $em_strong_prepared_relist;
971
-
972
function prepareItalicsAndBold() {
973
#
974
# Prepare regular expressions for seraching emphasis tokens in any
@@ -983,37 +982,37 @@ class NC_Markdown_Parser {
983
}
984
$token_relist[] = $em_re;
985
$token_relist[] = $strong_re;
986
-
987
# Construct master expression from list.
988
$token_re = '{('. implode('|', $token_relist) .')}';
989
$this->em_strong_prepared_relist["$em$strong"] = $token_re;
990
}
991
}
992
}
993
-
994
function doItalicsAndBold($text) {
995
$token_stack = array('');
996
$text_stack = array('');
997
$em = '';
998
$strong = '';
999
$tree_char_em = false;
1000
-
1001
while (1) {
1002
#
1003
# Get prepared regular expression for seraching emphasis tokens
1004
# in current context.
1005
#
1006
$token_re = $this->em_strong_prepared_relist["$em$strong"];
1007
-
1008
#
1009
- # Each loop iteration seach for the next emphasis token.
1010
# Each token is then passed to handleSpanToken.
1011
#
1012
$parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
1013
$text_stack[0] .= $parts[0];
1014
$token =& $parts[1];
1015
$text =& $parts[2];
1016
-
1017
if (empty($token)) {
1018
# Reached end of text span: empty stack without emitting.
1019
# any more emphasis.
@@ -1023,7 +1022,7 @@ class NC_Markdown_Parser {
1023
}
1024
break;
1025
}
1026
-
1027
$token_len = strlen($token);
1028
if ($tree_char_em) {
1029
# Reached closing marker while inside a three-char emphasis.
@@ -1062,7 +1061,7 @@ class NC_Markdown_Parser {
1062
$tag = ''; # $tag stands for $em or $strong
1063
}
1064
} else {
1065
- # Reached opening three-char emphasis marker. Push on token
1066
# stack; will be handled by the special condition above.
1067
$em = $token{0};
1068
$strong = "$em$em";
@@ -1136,9 +1135,9 @@ class NC_Markdown_Parser {
1136
$bq = $this->runBlockGamut($bq); # recurse
1137
1138
$bq = preg_replace('/^/m', " ", $bq);
1139
- # These leading spaces cause problem with <pre> content,
1140
# so we need to fix that:
1141
- $bq = preg_replace_callback('{(\s*<pre>.+?</pre>)}sx',
1142
array(&$this, '_DoBlockQuotes_callback2'), $bq);
1143
1144
return "\n". $this->hashBlock("<blockquote>\n$bq\n</blockquote>")."\n\n";
@@ -1201,7 +1200,7 @@ class NC_Markdown_Parser {
1201
// # We can't call Markdown(), because that resets the hash;
1202
// # that initialization code should be pulled into its own sub, though.
1203
// $div_content = $this->hashHTMLBlocks($div_content);
1204
- //
1205
// # Run document gamut methods on the content.
1206
// foreach ($this->document_gamut as $method => $priority) {
1207
// $div_content = $this->$method($div_content);
@@ -1229,11 +1228,11 @@ class NC_Markdown_Parser {
1229
$text = str_replace('"', '&quot;', $text);
1230
return $text;
1231
}
1232
-
1233
-
1234
function encodeAmpsAndAngles($text) {
1235
#
1236
- # Smart processing for ampersands and angle brackets that need to
1237
# be encoded. Valid character entities are left alone unless the
1238
# no-entities mode is set.
1239
#
@@ -1242,7 +1241,7 @@ class NC_Markdown_Parser {
1242
} else {
1243
# Ampersand-encoding based entirely on Nat Irons's Amputator
1244
# MT plugin: <http://bumppo.net/projects/amputator/>
1245
- $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
1246
'&amp;', $text);;
1247
}
1248
# Encode remaining <'s
@@ -1253,7 +1252,7 @@ class NC_Markdown_Parser {
1253
1254
1255
function doAutoLinks($text) {
1256
- $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
1257
array(&$this, '_doAutoLinks_url_callback'), $text);
1258
1259
# Email addresses: <address@domain.foo>
@@ -1302,7 +1301,7 @@ class NC_Markdown_Parser {
1302
$addr = "mailto:" . $addr;
1303
$chars = preg_split('/(?<!^)(?!$)/', $addr);
1304
$seed = (int)abs(crc32($addr) / strlen($addr)); # Deterministic seed.
1305
-
1306
foreach ($chars as $key => $char) {
1307
$ord = ord($char);
1308
# Ignore non-ascii chars.
@@ -1315,7 +1314,7 @@ class NC_Markdown_Parser {
1315
else $chars[$key] = '&#'.$ord.';';
1316
}
1317
}
1318
-
1319
$addr = implode('', $chars);
1320
$text = implode('', array_slice($chars, 7)); # text without `mailto:`
1321
$addr = "<a href=\"$addr\">$text</a>";
@@ -1330,7 +1329,7 @@ class NC_Markdown_Parser {
1330
# escaped characters and handling code spans.
1331
#
1332
$output = '';
1333
-
1334
$span_re = '{
1335
(
1336
\\\\'.$this->escape_chars_re.'
@@ -1355,17 +1354,17 @@ class NC_Markdown_Parser {
1355
1356
while (1) {
1357
#
1358
- # Each loop iteration seach for either the next tag, the next
1359
- # openning code span marker, or the next escaped character.
1360
# Each token is then passed to handleSpanToken.
1361
#
1362
$parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE);
1363
-
1364
# Create token from text preceding tag.
1365
if ($parts[0] != "") {
1366
$output .= $parts[0];
1367
}
1368
-
1369
# Check if we reach the end.
1370
if (isset($parts[1])) {
1371
$output .= $this->handleSpanToken($parts[1], $parts[2]);
@@ -1375,14 +1374,14 @@ class NC_Markdown_Parser {
1375
break;
1376
}
1377
}
1378
-
1379
return $output;
1380
}
1381
-
1382
-
1383
function handleSpanToken($token, &$str) {
1384
#
1385
- # Handle $token provided by parseSpan by determining its nature and
1386
# returning the corresponding value that should replace it.
1387
#
1388
switch ($token{0}) {
@@ -1390,7 +1389,7 @@ class NC_Markdown_Parser {
1390
return $this->hashPart("&#". ord($token{1}). ";");
1391
case "`":
1392
# Search for end marker in remaining text.
1393
- if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)#x2F;sm',
1394
$str, $matches))
1395
{
1396
$str = $matches[2];
@@ -1412,18 +1411,18 @@ class NC_Markdown_Parser {
1412
}
1413
1414
1415
- # String length function for detab. `_initDetab` will create a function to
1416
# hanlde UTF-8 if the default function does not exist.
1417
var $utf8_strlen = 'mb_strlen';
1418
-
1419
function detab($text) {
1420
#
1421
# Replace tabs with the appropriate amount of space.
1422
#
1423
# For each line we separate the line in blocks delemited by
1424
- # tab characters. Then we reconstruct every line by adding the
1425
# appropriate number of space between each blocks.
1426
-
1427
$text = preg_replace_callback('/^.*\t.*#x2F;m',
1428
array(&$this, '_detab_callback'), $text);
1429
@@ -1432,7 +1431,7 @@ class NC_Markdown_Parser {
1432
function _detab_callback($matches) {
1433
$line = $matches[0];
1434
$strlen = $this->utf8_strlen; # strlen function for UTF-8.
1435
-
1436
# Split in blocks.
1437
$blocks = explode("\t", $line);
1438
# Add each blocks to the line.
@@ -1440,7 +1439,7 @@ class NC_Markdown_Parser {
1440
unset($blocks[0]); # Do not add first block twice.
1441
foreach ($blocks as $block) {
1442
# Calculate amount of space, insert spaces, insert block.
1443
- $amount = $this->tab_width -
1444
$strlen($line, 'UTF-8') % $this->tab_width;
1445
$line .= str_repeat(" ", $amount) . $block;
1446
}
@@ -1449,13 +1448,13 @@ class NC_Markdown_Parser {
1449
function _initDetab() {
1450
#
1451
# Check for the availability of the function in the `utf8_strlen` property
1452
- # (initially `mb_strlen`). If the function is not available, create a
1453
# function that will loosely count the number of UTF-8 characters with a
1454
# regular expression.
1455
#
1456
if (function_exists($this->utf8_strlen)) return;
1457
$this->utf8_strlen = create_function('$text', 'return preg_match_all(
1458
- "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
1459
$text, $m);');
1460
}
1461
@@ -1464,7 +1463,7 @@ class NC_Markdown_Parser {
1464
#
1465
# Swap back in all the tags hashed by _HashHTMLBlocks.
1466
#
1467
- return preg_replace_callback('/(.)\x1A[0-9]+\1/',
1468
array(&$this, '_unhash_callback'), $text);
1469
}
1470
function _unhash_callback($matches) {
27
28
static $parser;
29
if (!isset($parser)) {
30
+ $parser = new NC_Markdown_Parser;
31
}
32
33
return $parser->transform($text);
43
# Needed to insert a maximum bracked depth while converting to PHP.
44
var $nested_brackets_depth = 6;
45
var $nested_brackets_re;
46
+
47
var $nested_url_parenthesis_depth = 4;
48
var $nested_url_parenthesis_re;
49
54
# Change to ">" for HTML output.
55
var $empty_element_suffix = " />";
56
var $tab_width = 4;
57
+
58
# Change to `true` to disallow markup or entities.
59
var $no_markup = false;
60
var $no_entities = false;
61
+
62
# Predefined urls and titles for reference links and images.
63
var $predef_urls = array();
64
var $predef_titles = array();
70
#
71
$this->_initDetab();
72
$this->prepareItalicsAndBold();
73
+
74
+ $this->nested_brackets_re =
75
str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth).
76
str_repeat('\])*', $this->nested_brackets_depth);
77
+
78
+ $this->nested_url_parenthesis_re =
79
str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth).
80
str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth);
81
+
82
$this->escape_chars_re = '['.preg_quote($this->escape_chars).']';
83
+
84
# Sort document, block, and span gamut in ascendent priority order.
85
asort($this->document_gamut);
86
asort($this->block_gamut);
92
var $urls = array();
93
var $titles = array();
94
var $html_hashes = array();
95
+
96
# Status flag to avoid invalid nesting.
97
var $in_anchor = false;
98
+
99
+
100
function setup() {
101
#
102
+ # Called before the transformation process starts to setup parser
103
# states.
104
#
105
# Clear global hashes.
106
$this->urls = $this->predef_urls;
107
$this->titles = $this->predef_titles;
108
$this->html_hashes = array();
109
+
110
$in_anchor = false;
111
}
112
+
113
function teardown() {
114
#
115
+ # Called after the transformation process to clear any variable
116
# which may be taking up memory unnecessarly.
117
#
118
$this->urls = array();
127
# and pass it through the document gamut.
128
#
129
$this->setup();
130
+
131
# Remove UTF-8 BOM and marker character in input, if present.
132
$text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text);
133
154
foreach ($this->document_gamut as $method => $priority) {
155
$text = $this->$method($text);
156
}
157
+
158
$this->teardown();
159
160
return $text . "\n";
161
}
162
+
163
var $document_gamut = array(
164
# Strip link definitions, store in hashes.
165
"stripLinkDefinitions" => 20,
166
+
167
"runBasicBlockGamut" => 30,
168
);
169
219
# hard-coded:
220
#
221
# * List "a" is made of tags which can be both inline or block-level.
222
+ # These will be treated block-level when the start tag is alone on
223
+ # its line, otherwise they're not matched here and will be taken as
224
# inline later.
225
# * List "b" is made of tags which are always block-level;
226
#
242
|
243
\'[^\']*\' # text inside single quotes (tolerate ">")
244
)*
245
+ )?
246
';
247
$content =
248
str_repeat('
259
str_repeat('
260
</\2\s*> # closing nested tag
261
)
262
+ |
263
<(?!/\2\s*> # other tags with a different name
264
)
265
)*',
285
)
286
( # save in $1
287
288
+ # Match from `\n<tag>` to `</tag>\n`, handling nested tags
289
# in between.
290
+
291
[ ]{0,'.$less_than_tab.'}
292
<('.$block_tags_b_re.')# start tag = $2
293
'.$attr.'> # attributes followed by > and \n
305
</\3> # the matching end tag
306
[ ]* # trailing spaces/tabs
307
(?=\n+|\Z) # followed by a newline or end of document
308
+
309
+ | # Special case just for <hr />. It was easier to make a special
310
# case than to make the other regex more complicated.
311
+
312
[ ]{0,'.$less_than_tab.'}
313
<(hr) # start tag = $2
314
'.$attr.' # attributes
315
/?> # the matching end tag
316
[ ]*
317
(?=\n{2,}|\Z) # followed by a blank line or end of document
318
+
319
| # Special case for standalone HTML comments:
320
+
321
[ ]{0,'.$less_than_tab.'}
322
(?s:
323
<!-- .*? -->
324
)
325
[ ]*
326
(?=\n{2,}|\Z) # followed by a blank line or end of document
327
+
328
| # PHP and ASP-style processor instructions (<? and <%)
329
+
330
[ ]{0,'.$less_than_tab.'}
331
(?s:
332
<([?%]) # $2
335
)
336
[ ]*
337
(?=\n{2,}|\Z) # followed by a blank line or end of document
338
+
339
)
340
)}Sxmi',
341
array(&$this, '_hashHTMLBlocks_callback'),
348
$key = $this->hashBlock($text);
349
return "\n\n$key\n\n";
350
}
351
+
352
+
353
function hashPart($text, $boundary = 'X') {
354
#
355
+ # Called whenever a tag must be hashed when a function insert an atomic
356
# element in the text stream. Passing $text to through this function gives
357
# a unique text-token which will be reverted back when calling unhash.
358
#
364
# Swap back any tag hash found in $text so we do not have to `unhash`
365
# multiple times at the end.
366
$text = $this->unhash($text);
367
+
368
# Then hash the block.
369
static $i = 0;
370
$key = "$boundary\x1A" . ++$i . $boundary;
388
#
389
"doHeaders" => 10,
390
"doHorizontalRules" => 20,
391
+
392
"doLists" => 40,
393
"doCodeBlocks" => 50,
394
"doBlockQuotes" => 60,
398
#
399
# Run block gamut tranformations.
400
#
401
+ # We need to escape raw HTML in Markdown source before doing anything
402
+ # else. This need to be done for each block, and not only at the
403
# begining in the Markdown function since hashed blocks can be part of
404
+ # list items and could have been indented. Indented blocks would have
405
# been seen as a code block in a previous pass of hashHTMLBlocks.
406
$text = $this->hashHTMLBlocks($text);
407
+
408
return $this->runBasicBlockGamut($text);
409
}
410
+
411
function runBasicBlockGamut($text) {
412
#
413
+ # Run block gamut tranformations, without hashing HTML blocks. This is
414
# useful when HTML blocks are known to be already hashed, like in the first
415
# whole-document pass.
416
#
417
foreach ($this->block_gamut as $method => $priority) {
418
$text = $this->$method($text);
419
}
420
+
421
# Finally form paragraph and restore hashed blocks.
422
$text = $this->formParagraphs($text);
423
424
return $text;
425
}
426
+
427
+
428
function doHorizontalRules($text) {
429
# Do Horizontal Rules:
430
return preg_replace(
438
[ ]* # Tailing spaces
439
$ # End of line.
440
}mx',
441
+ "\n".$this->hashBlock("<hr$this->empty_element_suffix")."\n",
442
$text);
443
}
444
456
# because ![foo][f] looks like an anchor.
457
"doImages" => 10,
458
"doAnchors" => 20,
459
+
460
# Make links out of things like `<http://example.com/>`
461
# Must come after doAnchors, because you can use < and >
462
# delimiters in inline links like [this](<url>).
477
478
return $text;
479
}
480
+
481
+
482
function doHardBreaks($text) {
483
# Do hard breaks:
484
+ return preg_replace_callback('/ {2,}\n/',
485
array(&$this, '_doHardBreaks_callback'), $text);
486
}
487
function _doHardBreaks_callback($matches) {
495
#
496
if ($this->in_anchor) return $text;
497
$this->in_anchor = true;
498
+
499
#
500
# First, handle reference-style links: [link text] [id]
501
#
568
# for shortcut links like [this][] or [this].
569
$link_id = $link_text;
570
}
571
+
572
# lower-case and turn embedded newlines into spaces
573
$link_id = strtolower($link_id);
574
$link_id = preg_replace('{[ ]?\n}', ' ', $link_id);
576
if (isset($this->urls[$link_id])) {
577
$url = $this->urls[$link_id];
578
$url = $this->encodeAttribute($url);
579
+
580
$result = "<a href=\"$url\"";
581
if ( isset( $this->titles[$link_id] ) ) {
582
$title = $this->titles[$link_id];
583
$title = $this->encodeAttribute($title);
584
$result .= " title=\"$title\"";
585
}
586
+
587
$link_text = $this->runSpanGamut($link_text);
588
$result .= ">$link_text</a>";
589
$result = $this->hashPart($result);
606
$title = $this->encodeAttribute($title);
607
$result .= " title=\"$title\"";
608
}
609
+
610
$link_text = $this->runSpanGamut($link_text);
611
$result .= ">$link_text</a>";
612
635
\]
636
637
)
638
+ }xs',
639
array(&$this, '_doImages_reference_callback'), $text);
640
641
#
720
# Setext-style headers:
721
# Header 1
722
# ========
723
+ #
724
# Header 2
725
# --------
726
#
750
# Terrible hack to check we haven't found an empty list item.
751
if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
752
return $matches[0];
753
+
754
$level = $matches[2]{0} == '=' ? 1 : 2;
755
$block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>";
756
return "\n" . $this->hashBlock($block) . "\n\n";
797
)
798
)
799
'; // mx
800
+
801
# We use a different prefix before nested lists than top-level lists.
802
# See extended comment in _ProcessListItems().
803
+
804
if ($this->list_level) {
805
$text = preg_replace_callback('{
806
^
824
$marker_ul_re = '[*+-]';
825
$marker_ol_re = '\d+[.]';
826
$marker_any_re = "(?:$marker_ul_re|$marker_ol_re)";
827
+
828
$list = $matches[1];
829
$list_type = preg_match("/$marker_ul_re/", $matches[3]) ? "ul" : "ol";
830
+
831
$marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re );
832
+
833
$list .= "\n";
834
$result = $this->processListItems($list, $marker_any_re);
835
+
836
$result = $this->hashBlock("<$list_type>\n" . $result . "</$list_type>");
837
return "\n". $result ."\n\n";
838
}
864
# without resorting to mind-reading. Perhaps the solution is to
865
# change the syntax rules such that sub-lists must start with a
866
# starting cardinal number; e.g. "1." or "a.".
867
+
868
$this->list_level++;
869
870
# trim trailing blank lines:
892
$marker_space = $matches[3];
893
$tailing_blank_line =& $matches[5];
894
895
+ if ($leading_line || $tailing_blank_line ||
896
preg_match('/\n{2,}/', $item))
897
{
898
# Replace marker with the appropriate whitespace indentation
967
'___' => '(?<=\S)(?<!_)___(?!_)',
968
);
969
var $em_strong_prepared_relist;
970
+
971
function prepareItalicsAndBold() {
972
#
973
# Prepare regular expressions for seraching emphasis tokens in any
982
}
983
$token_relist[] = $em_re;
984
$token_relist[] = $strong_re;
985
+
986
# Construct master expression from list.
987
$token_re = '{('. implode('|', $token_relist) .')}';
988
$this->em_strong_prepared_relist["$em$strong"] = $token_re;
989
}
990
}
991
}
992
+
993
function doItalicsAndBold($text) {
994
$token_stack = array('');
995
$text_stack = array('');
996
$em = '';
997
$strong = '';
998
$tree_char_em = false;
999
+
1000
while (1) {
1001
#
1002
# Get prepared regular expression for seraching emphasis tokens
1003
# in current context.
1004
#
1005
$token_re = $this->em_strong_prepared_relist["$em$strong"];
1006
+
1007
#
1008
+ # Each loop iteration seach for the next emphasis token.
1009
# Each token is then passed to handleSpanToken.
1010
#
1011
$parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
1012
$text_stack[0] .= $parts[0];
1013
$token =& $parts[1];
1014
$text =& $parts[2];
1015
+
1016
if (empty($token)) {
1017
# Reached end of text span: empty stack without emitting.
1018
# any more emphasis.
1022
}
1023
break;
1024
}
1025
+
1026
$token_len = strlen($token);
1027
if ($tree_char_em) {
1028
# Reached closing marker while inside a three-char emphasis.
1061
$tag = ''; # $tag stands for $em or $strong
1062
}
1063
} else {
1064
+ # Reached opening three-char emphasis marker. Push on token
1065
# stack; will be handled by the special condition above.
1066
$em = $token{0};
1067
$strong = "$em$em";
1135
$bq = $this->runBlockGamut($bq); # recurse
1136
1137
$bq = preg_replace('/^/m', " ", $bq);
1138
+ # These leading spaces cause problem with <pre> content,
1139
# so we need to fix that:
1140
+ $bq = preg_replace_callback('{(\s*<pre>.+?</pre>)}sx',
1141
array(&$this, '_DoBlockQuotes_callback2'), $bq);
1142
1143
return "\n". $this->hashBlock("<blockquote>\n$bq\n</blockquote>")."\n\n";
1200
// # We can't call Markdown(), because that resets the hash;
1201
// # that initialization code should be pulled into its own sub, though.
1202
// $div_content = $this->hashHTMLBlocks($div_content);
1203
+ //
1204
// # Run document gamut methods on the content.
1205
// foreach ($this->document_gamut as $method => $priority) {
1206
// $div_content = $this->$method($div_content);
1228
$text = str_replace('"', '&quot;', $text);
1229
return $text;
1230
}
1231
+
1232
+
1233
function encodeAmpsAndAngles($text) {
1234
#
1235
+ # Smart processing for ampersands and angle brackets that need to
1236
# be encoded. Valid character entities are left alone unless the
1237
# no-entities mode is set.
1238
#
1241
} else {
1242
# Ampersand-encoding based entirely on Nat Irons's Amputator
1243
# MT plugin: <http://bumppo.net/projects/amputator/>
1244
+ $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
1245
'&amp;', $text);;
1246
}
1247
# Encode remaining <'s
1252
1253
1254
function doAutoLinks($text) {
1255
+ $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
1256
array(&$this, '_doAutoLinks_url_callback'), $text);
1257
1258
# Email addresses: <address@domain.foo>
1301
$addr = "mailto:" . $addr;
1302
$chars = preg_split('/(?<!^)(?!$)/', $addr);
1303
$seed = (int)abs(crc32($addr) / strlen($addr)); # Deterministic seed.
1304
+
1305
foreach ($chars as $key => $char) {
1306
$ord = ord($char);
1307
# Ignore non-ascii chars.
1314
else $chars[$key] = '&#'.$ord.';';
1315
}
1316
}
1317
+
1318
$addr = implode('', $chars);
1319
$text = implode('', array_slice($chars, 7)); # text without `mailto:`
1320
$addr = "<a href=\"$addr\">$text</a>";
1329
# escaped characters and handling code spans.
1330
#
1331
$output = '';
1332
+
1333
$span_re = '{
1334
(
1335
\\\\'.$this->escape_chars_re.'
1354
1355
while (1) {
1356
#
1357
+ # Each loop iteration seach for either the next tag, the next
1358
+ # openning code span marker, or the next escaped character.
1359
# Each token is then passed to handleSpanToken.
1360
#
1361
$parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE);
1362
+
1363
# Create token from text preceding tag.
1364
if ($parts[0] != "") {
1365
$output .= $parts[0];
1366
}
1367
+
1368
# Check if we reach the end.
1369
if (isset($parts[1])) {
1370
$output .= $this->handleSpanToken($parts[1], $parts[2]);
1374
break;
1375
}
1376
}
1377
+
1378
return $output;
1379
}
1380
+
1381
+
1382
function handleSpanToken($token, &$str) {
1383
#
1384
+ # Handle $token provided by parseSpan by determining its nature and
1385
# returning the corresponding value that should replace it.
1386
#
1387
switch ($token{0}) {
1389
return $this->hashPart("&#". ord($token{1}). ";");
1390
case "`":
1391
# Search for end marker in remaining text.
1392
+ if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)#x2F;sm',
1393
$str, $matches))
1394
{
1395
$str = $matches[2];
1411
}
1412
1413
1414
+ # String length function for detab. `_initDetab` will create a function to
1415
# hanlde UTF-8 if the default function does not exist.
1416
var $utf8_strlen = 'mb_strlen';
1417
+
1418
function detab($text) {
1419
#
1420
# Replace tabs with the appropriate amount of space.
1421
#
1422
# For each line we separate the line in blocks delemited by
1423
+ # tab characters. Then we reconstruct every line by adding the
1424
# appropriate number of space between each blocks.
1425
+
1426
$text = preg_replace_callback('/^.*\t.*#x2F;m',
1427
array(&$this, '_detab_callback'), $text);
1428
1431
function _detab_callback($matches) {
1432
$line = $matches[0];
1433
$strlen = $this->utf8_strlen; # strlen function for UTF-8.
1434
+
1435
# Split in blocks.
1436
$blocks = explode("\t", $line);
1437
# Add each blocks to the line.
1439
unset($blocks[0]); # Do not add first block twice.
1440
foreach ($blocks as $block) {
1441
# Calculate amount of space, insert spaces, insert block.
1442
+ $amount = $this->tab_width -
1443
$strlen($line, 'UTF-8') % $this->tab_width;
1444
$line .= str_repeat(" ", $amount) . $block;
1445
}
1448
function _initDetab() {
1449
#
1450
# Check for the availability of the function in the `utf8_strlen` property
1451
+ # (initially `mb_strlen`). If the function is not available, create a
1452
# function that will loosely count the number of UTF-8 characters with a
1453
# regular expression.
1454
#
1455
if (function_exists($this->utf8_strlen)) return;
1456
$this->utf8_strlen = create_function('$text', 'return preg_match_all(
1457
+ "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
1458
$text, $m);');
1459
}
1460
1463
#
1464
# Swap back in all the tags hashed by _HashHTMLBlocks.
1465
#
1466
+ return preg_replace_callback('/(.)\x1A[0-9]+\1/',
1467
array(&$this, '_unhash_callback'), $text);
1468
}
1469
function _unhash_callback($matches) {
includes/menu-pages/api-ops.inc.php CHANGED
@@ -31,8 +31,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_api_ops"))
31
{
32
echo '<div class="wrap ws-menu-page">' . "\n";
33
34
- echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
35
- echo '<h2>s2Member API / Notifications</h2>' . "\n";
36
37
echo '<table class="ws-menu-page-table">' . "\n";
38
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
@@ -983,7 +986,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_api_ops"))
983
984
echo '<div class="ws-menu-page-hr"></div>' . "\n";
985
986
- echo '<p class="submit"><input type="submit" class="button-primary" value="Save All Changes" /></p>' . "\n";
987
988
echo '</form>' . "\n";
989
31
{
32
echo '<div class="wrap ws-menu-page">' . "\n";
33
34
+ echo '<div class="ws-menu-page-toolbox">'."\n";
35
+ c_ws_plugin__s2member_menu_pages_tb::display ();
36
+ echo '</div>'."\n";
37
+
38
+ echo '<h2>API / Notifications</h2>' . "\n";
39
40
echo '<table class="ws-menu-page-table">' . "\n";
41
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
986
987
echo '<div class="ws-menu-page-hr"></div>' . "\n";
988
989
+ echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
990
991
echo '</form>' . "\n";
992
includes/menu-pages/code-samples/jwplayer-v5-standard-mp4.x-php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- // Configuration.
3
- $s2_jw_config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
4
- $s2_jw_config["mp4_video_file_name"] = "video.mp4"; // Name of your MP4 test file.
5
- // Don't edit anything else below unless you know what you're doing.
6
- ?>
7
-
8
- <div id="jw-container">JW Player® appears here.</div>
9
- <script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>
10
- <script type="text/javascript">
11
- jwplayer("jw-container").setup({modes: // JW Player®.
12
- [
13
- // First try psuedo-streaming with Flash® player.
14
- {type: "flash", provider: "http", src: "<?php echo $s2_jw_config["jwplayer"]; ?>player.swf",
15
- config: {file: "/wp-content/plugins/s2member-files/s2member-file-inline/<?php echo $s2_jw_config["mp4_video_file_name"]; ?>"}},
16
- // Shortcode equivalent: [s2File rewrite="yes" inline="yes" download="<?php echo $s2_jw_config["mp4_video_file_name"]; ?>" /]
17
-
18
- // Else, try an HTML5 video tag.
19
- {type: "html5", provider: "video",
20
- config: {file: "/wp-content/plugins/s2member-files/s2member-file-inline/<?php echo $s2_jw_config["mp4_video_file_name"]; ?>"}},
21
- // Shortcode equivalent: [s2File rewrite="yes" inline="yes" download="<?php echo $s2_jw_config["mp4_video_file_name"]; ?>" /]
22
-
23
- // Else, this is a safe fallback.
24
- {type: "download", // Download the file.
25
- config: {file: "/wp-content/plugins/s2member-files/s2member-file-inline/<?php echo $s2_jw_config["mp4_video_file_name"]; ?>"}}
26
- // Shortcode equivalent: [s2File rewrite="yes" inline="yes" download="<?php echo $s2_jw_config["mp4_video_file_name"]; ?>" /]
27
- ],
28
- /* Set video dimensions. */ width: 480, height: 270
29
- });
30
- </script>
includes/menu-pages/code-samples/jwplayer-v5-streaming-mp4-sca.x-php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
- // Configuration.
3
- $s2_jw_config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
4
- $s2_jw_config["mp4_video_file_name"] = "video.mp4"; // Name of your MP4 test file.
5
- // Don't edit anything else below unless you know what you're doing.
6
- ?>
7
-
8
- <div id="jw-container">JW Player® appears here.</div>
9
- <script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>
10
-
11
- <script type="text/javascript">
12
- // The Shortcode here will return a JSON object for JavaScript notation.
13
- // A direct URL to the RTMP source; counting the file against the current User in real-time.
14
- // API Shortcode `s2File` returns a null object if access is denied to the current User/Member.
15
- var mp4 = [s2File download="<?php echo $s2_jw_config["mp4_video_file_name"]; ?>" url_to_storage_source="true" count_against_user="true" get_streamer_json="true" /];
16
- </script>
17
-
18
- <script type="text/javascript">
19
- if(typeof mp4 === 'object') // `s2File` returns a null object if access is denied to the current User.
20
- {
21
- jwplayer("jw-container").setup({modes: // JW Player®.
22
- [
23
- // First try real-time streaming with Flash® player.
24
- {type: "flash", provider: "rtmp", src: "<?php echo $s2_jw_config["jwplayer"]; ?>player.swf",
25
- config: {streamer: mp4['streamer'], file: mp4['file']}},
26
-
27
- // Else, try an HTML5 video tag.
28
- {type: "html5", provider: "video",
29
- config: {file: mp4['url']}},
30
-
31
- // Else, this is a safe fallback.
32
- {type: "download", // Download the file.
33
- config: {file: mp4['url']}}
34
- ],
35
- /* Set video dimensions. */ width: 480, height: 270
36
- });
37
- }
38
- else // Else, `s2File` returned a null object value.
39
- {
40
- document.write('Sorry, you do NOT have access to this file.');
41
- }
42
- </script>
includes/menu-pages/code-samples/jwplayer-v5-streaming-mp4-webm.x-php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- // Configuration.
3
- $s2_jw_config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
4
- $s2_jw_config["mp4_video_file_name"] = "video.mp4"; // Name of your MP4 test file.
5
- $s2_jw_config["webm_video_file_name"] = "video.webm"; // Name of your WEBM test file.
6
- // Don't edit anything else below unless you know what you're doing.
7
- ?>
8
-
9
- <div id="jw-container">JW Player® appears here.</div>
10
- <script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>
11
-
12
- <?php // A direct URL to the RTMP source; counting the file against the current User in real-time.
13
- $mp4_cfg = array ("file_download" => $s2_jw_config["mp4_video_file_name"], "url_to_storage_source" => true, "count_against_user" => true);
14
- $webm_cfg = array ("file_download" => $s2_jw_config["webm_video_file_name"], "url_to_storage_source" => true /* Don't count variations. */); ?>
15
-
16
- <?php // API Function `s2member_file_download_url()` returns false if access is denied to the current User.
17
- if (($mp4 = s2member_file_download_url ($mp4_cfg, "get-streamer-array"))
18
- && ($webm["url"] = s2member_file_download_url ($webm_cfg))) { ?>
19
-
20
- <script type="text/javascript">
21
- jwplayer("jw-container").setup({modes: // JW Player®.
22
- [
23
- // First try real-time streaming with Flash® player.
24
- {type: "flash", provider: "rtmp", src: "<?php echo $s2_jw_config["jwplayer"]; ?>player.swf",
25
- config: {streamer: "<?php echo $mp4["streamer"]; ?>", file: "<?php echo $mp4["file"]; ?>"}},
26
-
27
- // Else, try an HTML5 video tag with the `mp4` file.
28
- {type: "html5", provider: "video",
29
- config: {file: "<?php echo $mp4["url"]; ?>"}},
30
-
31
- // Else, try an HTML5 video tag with a `webm` file.
32
- {type: "html5", provider: "video",
33
- config: {file: "<?php echo $webm["url"]; ?>"}},
34
-
35
- // Else, this is a safe fallback.
36
- {type: "download", // Download the file.
37
- config: {file: "<?php echo $mp4["url"]; ?>"}}
38
- ],
39
- /* Set video dimensions. */ width: 480, height: 270
40
- });
41
- </script>
42
-
43
- <?php } else /* Access is denied to the current User. */ { ?>
44
- Sorry, you do NOT have access to this file.
45
- <?php } ?>
includes/menu-pages/code-samples/jwplayer-v5-streaming-mp4.x-php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- // Configuration.
3
- $s2_jw_config["jwplayer"] = "/jwplayer/"; // Relative URL path to JW Player files directory.
4
- $s2_jw_config["mp4_video_file_name"] = "video.mp4"; // Name of your MP4 test file.
5
- // Don't edit anything else below unless you know what you're doing.
6
- ?>
7
-
8
- <div id="jw-container">JW Player® appears here.</div>
9
- <script type="text/javascript" src="<?php echo $s2_jw_config["jwplayer"]; ?>jwplayer.js"></script>
10
-
11
- <?php // A direct URL to the RTMP source; counting the file against the current User in real-time.
12
- $cfg = array ("file_download" => $s2_jw_config["mp4_video_file_name"], "url_to_storage_source" => true, "count_against_user" => true); ?>
13
-
14
- <?php // API Function `s2member_file_download_url()` returns false if access is denied to the current User.
15
- if (($mp4 = s2member_file_download_url ($cfg, "get-streamer-array"))) { ?>
16
-
17
- <script type="text/javascript">
18
- jwplayer("jw-container").setup({modes: // JW Player®.
19
- [
20
- // First try real-time streaming with Flash® player.
21
- {type: "flash", provider: "rtmp", src: "<?php echo $s2_jw_config["jwplayer"]; ?>player.swf",
22
- config: {streamer: "<?php echo $mp4["streamer"]; ?>", file: "<?php echo $mp4["file"]; ?>"}},
23
-
24
- // Else, try an HTML5 video tag.
25
- {type: "html5", provider: "video",
26
- config: {file: "<?php echo $mp4["url"]; ?>"}},
27
-
28
- // Else, this is a safe fallback.
29
- {type: "download", // Download the file.
30
- config: {file: "<?php echo $mp4["url"]; ?>"}}
31
- ],
32
- /* Set video dimensions. */ width: 480, height: 270
33
- });
34
- </script>
35
-
36
- <?php } else /* Access is denied to the current User. */ { ?>
37
- Sorry, you do NOT have access to this file.
38
- <?php } ?>
includes/menu-pages/down-ops.inc.php CHANGED
@@ -31,8 +31,11 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
- echo '<div id="icon-plugins" class="icon32"><br /></div>'."\n";
35
- echo '<h2>s2Member File Download Options</h2>'."\n";
36
37
echo '<table class="ws-menu-page-table">'."\n";
38
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
@@ -248,7 +251,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
248
{
249
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_s3", get_defined_vars());
250
251
- echo '<div class="ws-menu-page-group" title="Amazon S3/CDN Storage Option"'.((c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' default-state="open"' : '').'>'."\n";
252
253
echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-s3-section">'."\n";
254
echo '<h3>Amazon S3/CDN Storage &amp; Delivery (optional)</h3>'."\n";
@@ -335,7 +338,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
335
{
336
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_cf", get_defined_vars());
337
338
- echo '<div class="ws-menu-page-group" title="Amazon S3/CloudFront CDN Storage Option"'.((c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' default-state="open"' : '').'>'."\n";
339
340
echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-cf-section">'."\n";
341
echo '<h3>Amazon S3/CloudFront CDN Storage &amp; Delivery (optional)</h3>'."\n";
@@ -395,7 +398,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
395
396
echo '<td>'."\n";
397
echo '<input type="hidden" name="ws_plugin__s2member_amazon_cf_files_private_key" id="ws-plugin--s2member-amazon-cf-files-private-key" value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]).'" data-s-prev-config-value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]).'" />'."\n";
398
- echo '<textarea name="ws_plugin__s2member_amazon_cf_files_private_key_entry" id="ws-plugin--s2member-amazon-cf-files-private-key-entry" rows="3" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]).'</textarea><br />'."\n";
399
echo 'See: <code>Amazon Web Services Account -› Security Credentials -› Key Pairs</code>.<br />'."\n";
400
echo '<em>* Note, s2Member needs your <strong>Private Key file</strong>, NOT your Public Key file.</em>'."\n";
401
echo '</td>'."\n";
@@ -413,7 +416,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
413
echo '<tr>'."\n";
414
415
echo '<td>'."\n";
416
- echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros" value="'.esc_attr(wp_create_nonce("ws-plugin--s2member-amazon-cf-files-auto-configure-distros")).'"'.((c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) ? ' checked="checked"' : '').' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros"><strong>Yes</strong>, automatically configure my Amazon CloudFront Distributions &amp; Amazon S3 ACLs for me.</label><br />'."\n";
417
echo '<em>s2Member will auto-configure and/or delete &amp; re-configure your Amazon CloudFront Distributions for you.</em>'."\n";
418
echo '</td>'."\n";
419
@@ -421,7 +424,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
421
echo '<tr>'."\n";
422
423
echo '<td>'."\n";
424
- echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros_w_cnames" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames" value="'.esc_attr(wp_create_nonce("ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames")).'"'.((c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"] && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"] || $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"])) ? ' checked="checked"' : '').' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames"><strong>Yes</strong>, I want s2Member to auto-configure using custom CNAMES that I\'ll setup.</label><br />'."\n";
425
echo '<em>* Optional, do NOT check this box unless you know what you\'re doing. This requires DNS changes.</em>'."\n";
426
echo '</td>'."\n";
427
@@ -486,7 +489,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
486
487
echo '<div class="ws-menu-page-section ws-plugin--s2member-rtmp-streaming-section">'."\n";
488
echo '<h3>JW Player v6 &amp; RTMP Protocol Examples</h3>'."\n";
489
- echo '<a href="http://www.longtailvideo.com/players/" target="_blank"><img src="'.esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]).'/images/jwplayer-logo.png" class="ws-menu-page-right" style="width:179px; height:58px; border:0;" alt="." /></a>'."\n";
490
echo '<p>While it is possible to serve audio/video files protected by s2Member, without needing to integrate Amazon S3 or CloudFront; we DO highly recommend that you integrate both Amazon S3 and Amazon CloudFront in order to maximize speed and compatibility across various viewing platforms. That being said, there are code samples below that will serve audio/video files both with and without Amazon S3/CloudFront. You can also check the <a href="'.esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Forum URI")).'" target="_blank" rel="external">s2Member Support Forums</a> for tips/tricks if you like.</p>'."\n";
491
echo '<p><strong>One of the great things about Amazon CloudFront</strong>, is its ability to <strong>stream/seek media files</strong> in the truest sense of the word. For sites delivering protected <em>FLV/MP4/OGG/WEBM</em> and other streaming audio/video file types over the <em>RTMP</em> protocol, Amazon CloudFront is our recommendation. Once you\'ve successfully configured s2Member to use both Amazon S3 and Amazon CloudFront together, please review the code samples below. s2Member can automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon CloudFront Streaming Distribution.</p>'."\n";
492
echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/jwplayer-s2stream-shortcodes/" target="_blank" rel="external">JW Player w/ <code>[s2Stream /]</code> Shortcodes</a>.</p>'."\n";
@@ -543,43 +546,6 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
543
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_rtmp_streaming", get_defined_vars());
544
}
545
546
- if(apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_rtmp_streaming", true, get_defined_vars()))
547
- {
548
- do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_rtmp_streaming", get_defined_vars());
549
-
550
- echo '<div class="ws-menu-page-group" title="JW Player v5 &amp; RTMP Protocol Examples (Deprecated)">'."\n";
551
-
552
- echo '<div class="ws-menu-page-section ws-plugin--s2member-rtmp-streaming-section">'."\n";
553
- echo '<h3>JW Player v5 &amp; RTMP Protocol Examples (Deprecated)</h3>'."\n";
554
- echo '<a href="http://www.longtailvideo.com/players/" target="_blank"><img src="'.esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]).'/images/jwplayer-logo.png" class="ws-menu-page-right" style="width:179px; height:58px; border:0;" alt="." /></a>'."\n";
555
- echo '<p>While it is possible to serve audio/video files protected by s2Member, without needing to integrate Amazon S3 or CloudFront; we DO highly recommend that you integrate both Amazon S3 and Amazon CloudFront in order to maximize speed and compatibility across various viewing platforms. That being said, there are code samples below that will serve audio/video files both with and without Amazon S3/CloudFront. You can also check the <a href="'.esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Forum URI")).'" target="_blank" rel="external">s2Member Support Forums</a> for tips/tricks if you like.</p>'."\n";
556
- echo '<p><strong>One of the great things about Amazon CloudFront</strong>, is its ability to <strong>stream/seek media files</strong> in the truest sense of the word. For sites delivering protected <em>FLV/MP4/OGG/WEBM</em> and other streaming audio/video file types over the <em>RTMP</em> protocol, Amazon CloudFront is our recommendation. Once you\'ve successfully configured s2Member to use both Amazon S3 and Amazon CloudFront together, please review the code samples below. s2Member can automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon CloudFront Streaming Distribution.</p>'."\n";
557
- do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_during_rtmp_streaming", get_defined_vars());
558
-
559
- echo '<div class="ws-menu-page-hr"></div>'."\n";
560
-
561
- echo '<h3>PHP Code Examples (for more advanced integrations)</h3>'."\n";
562
- echo '<p>These examples exist from past versions of s2Member. JW Player v5 is now outdated by JW Player v6 (recommended).</p>'."\n";
563
-
564
- echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-standard-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player (MP4 file, via Rewrite URLs. Amazon S3/CloudFront NOT required)</a></p>'."\n";
565
- echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-standard-mp4" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This does NOT require s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <code>s2Member -› Download Options -› Advanced Mod Rewrite Linkage</code>.<br /><br />'.c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-standard-mp4.x-php")).'</p>'."\n";
566
-
567
- echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-streaming-mp4\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4, via s2Member\'s Amazon S3/CloudFront integration)</a></p>'."\n";
568
- echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-streaming-mp4" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.<br /><br />'.c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-streaming-mp4.x-php")).'</p>'."\n";
569
-
570
- echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-streaming-mp4-sca\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4, via s2Member\'s JSON/Shortcode alternative)</a></p>'."\n";
571
- echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-streaming-mp4-sca" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.<br /><br />'.c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-streaming-mp4-sca.x-php")).'</p>'."\n";
572
-
573
- echo '<p style="font-size:110%;"><a href="#" onclick="jQuery(\'p#ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-streaming-mp4-webm\').toggle(); return false;" class="ws-dotted-link">JW Player (RTMP streaming MP4, advanced w/ multiple fallbacks)</a></p>'."\n";
574
- echo '<p id="ws-plugin--s2member-rtmp-streaming-details-jwplayer-v5-streaming-mp4-webm" style="display:none;">Download <a href="http://www.longtailvideo.com/players/" target="_blank" rel="external">JW Player here</a>, and upload <code>/jwplayer/</code> to your website\'s root directory.<br />This requires s2Member to be integrated with Amazon S3/CloudFront.<br />Also see: <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.<br /><br />'.c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__)."/code-samples/jwplayer-v5-streaming-mp4-webm.x-php")).'</p>'."\n";
575
-
576
- echo '</div>'."\n";
577
-
578
- echo '</div>'."\n";
579
-
580
- do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_rtmp_streaming", get_defined_vars());
581
- }
582
-
583
if(apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_rewrite_linkage", true, get_defined_vars()))
584
{
585
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_rewrite_linkage", get_defined_vars());
@@ -714,7 +680,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
714
echo '<div class="ws-menu-page-hr"></div>'."\n";
715
echo '<p style="margin:0; font-weight:bold;">s2Member automatically adds this to your <code>.htaccess</code> file upon activation of the plugin.</p>'."\n";
716
echo '<p style="margin:0;">The following <code>mod_rewrite</code> rule goes inside this file: <code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path(ABSPATH.".htaccess")).'</code></p>'."\n";
717
- echo '<pre><code>'.esc_html(trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_no_gzip_htaccess"])))).'</code></pre>';
718
echo '<p><strong>* Tip:</strong> this covers all types of integration with s2Member File Downloads, even if you\'re using s2Member\'s Advanced Mod Rewrite Linkage.</p>'."\n";
719
echo '</div>'."\n";
720
@@ -763,7 +729,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_down_ops"))
763
764
echo '<div class="ws-menu-page-hr"></div>'."\n";
765
766
- echo '<p class="submit"><input type="submit" class="button-primary" value="Save All Changes" /></p>'."\n";
767
768
echo '</form>'."\n";
769
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
+ echo '<div class="ws-menu-page-toolbox">'."\n";
35
+ c_ws_plugin__s2member_menu_pages_tb::display ();
36
+ echo '</div>'."\n";
37
+
38
+ echo '<h2>Download Options</h2>'."\n";
39
40
echo '<table class="ws-menu-page-table">'."\n";
41
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
251
{
252
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_s3", get_defined_vars());
253
254
+ echo '<div class="ws-menu-page-group" title="Amazon S3/CDN Storage Option"'.((!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"])) ? ' default-state="open"' : '').'>'."\n";
255
256
echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-s3-section">'."\n";
257
echo '<h3>Amazon S3/CDN Storage &amp; Delivery (optional)</h3>'."\n";
338
{
339
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_amazon_cf", get_defined_vars());
340
341
+ echo '<div class="ws-menu-page-group" title="Amazon S3/CloudFront CDN Storage Option"'.((!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"])) ? ' default-state="open"' : '').'>'."\n";
342
343
echo '<div class="ws-menu-page-section ws-plugin--s2member-amazon-cf-section">'."\n";
344
echo '<h3>Amazon S3/CloudFront CDN Storage &amp; Delivery (optional)</h3>'."\n";
398
399
echo '<td>'."\n";
400
echo '<input type="hidden" name="ws_plugin__s2member_amazon_cf_files_private_key" id="ws-plugin--s2member-amazon-cf-files-private-key" value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]).'" data-s-prev-config-value="'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]).'" />'."\n";
401
+ echo '<textarea name="ws_plugin__s2member_amazon_cf_files_private_key_entry" id="ws-plugin--s2member-amazon-cf-files-private-key-entry" rows="3" wrap="off" spellcheck="false" class="monospace">'.format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_private_key"]).'</textarea><br />'."\n";
402
echo 'See: <code>Amazon Web Services Account -› Security Credentials -› Key Pairs</code>.<br />'."\n";
403
echo '<em>* Note, s2Member needs your <strong>Private Key file</strong>, NOT your Public Key file.</em>'."\n";
404
echo '</td>'."\n";
416
echo '<tr>'."\n";
417
418
echo '<td>'."\n";
419
+ echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros" value="'.esc_attr(wp_create_nonce("ws-plugin--s2member-amazon-cf-files-auto-configure-distros")).'"'.((!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"])) ? ' checked="checked"' : '').' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros"><strong>Yes</strong>, automatically configure my Amazon CloudFront Distributions &amp; Amazon S3 ACLs for me.</label><br />'."\n";
420
echo '<em>s2Member will auto-configure and/or delete &amp; re-configure your Amazon CloudFront Distributions for you.</em>'."\n";
421
echo '</td>'."\n";
422
424
echo '<tr>'."\n";
425
426
echo '<td>'."\n";
427
+ echo '<input type="checkbox" name="ws_plugin__s2member_amazon_cf_files_auto_configure_distros_w_cnames" id="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames" value="'.esc_attr(wp_create_nonce("ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames")).'"'.((!empty(c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"] || $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"])) ? ' checked="checked"' : '').' /> <label for="ws-plugin--s2member-amazon-cf-files-auto-configure-distros-w-cnames"><strong>Yes</strong>, I want s2Member to auto-configure using custom CNAMES that I\'ll setup.</label><br />'."\n";
428
echo '<em>* Optional, do NOT check this box unless you know what you\'re doing. This requires DNS changes.</em>'."\n";
429
echo '</td>'."\n";
430
489
490
echo '<div class="ws-menu-page-section ws-plugin--s2member-rtmp-streaming-section">'."\n";
491
echo '<h3>JW Player v6 &amp; RTMP Protocol Examples</h3>'."\n";
492
+ echo '<a href="http://www.longtailvideo.com/players/" target="_blank"><img src="'.esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]).'/images/jwplayer-logo.png" class="ws-menu-page-right" style="width:179px; height:58px; border:0; border-radius:3px; background:#FFFFFF; padding:15px;" alt="." /></a>'."\n";
493
echo '<p>While it is possible to serve audio/video files protected by s2Member, without needing to integrate Amazon S3 or CloudFront; we DO highly recommend that you integrate both Amazon S3 and Amazon CloudFront in order to maximize speed and compatibility across various viewing platforms. That being said, there are code samples below that will serve audio/video files both with and without Amazon S3/CloudFront. You can also check the <a href="'.esc_attr(c_ws_plugin__s2member_readmes::parse_readme_value("Forum URI")).'" target="_blank" rel="external">s2Member Support Forums</a> for tips/tricks if you like.</p>'."\n";
494
echo '<p><strong>One of the great things about Amazon CloudFront</strong>, is its ability to <strong>stream/seek media files</strong> in the truest sense of the word. For sites delivering protected <em>FLV/MP4/OGG/WEBM</em> and other streaming audio/video file types over the <em>RTMP</em> protocol, Amazon CloudFront is our recommendation. Once you\'ve successfully configured s2Member to use both Amazon S3 and Amazon CloudFront together, please review the code samples below. s2Member can automatically serve your protected files over the <em>RTMP</em> protocol using an Amazon CloudFront Streaming Distribution.</p>'."\n";
495
echo '<p><strong>See also:</strong> This KB article: <a href="http://www.s2member.com/kb/jwplayer-s2stream-shortcodes/" target="_blank" rel="external">JW Player w/ <code>[s2Stream /]</code> Shortcodes</a>.</p>'."\n";
546
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_after_rtmp_streaming", get_defined_vars());
547
}
548
549
if(apply_filters("ws_plugin__s2member_during_down_ops_page_during_left_sections_display_rewrite_linkage", true, get_defined_vars()))
550
{
551
do_action("ws_plugin__s2member_during_down_ops_page_during_left_sections_before_rewrite_linkage", get_defined_vars());
680
echo '<div class="ws-menu-page-hr"></div>'."\n";
681
echo '<p style="margin:0; font-weight:bold;">s2Member automatically adds this to your <code>.htaccess</code> file upon activation of the plugin.</p>'."\n";
682
echo '<p style="margin:0;">The following <code>mod_rewrite</code> rule goes inside this file: <code>'.esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path(ABSPATH.".htaccess")).'</code></p>'."\n";
683
+ echo '<pre class="code"><code>'.esc_html(trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_no_gzip_htaccess"])))).'</code></pre>';
684
echo '<p><strong>* Tip:</strong> this covers all types of integration with s2Member File Downloads, even if you\'re using s2Member\'s Advanced Mod Rewrite Linkage.</p>'."\n";
685
echo '</div>'."\n";
686
729
730
echo '<div class="ws-menu-page-hr"></div>'."\n";
731
732
+ echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>'."\n";
733
734
echo '</form>'."\n";
735
includes/menu-pages/els-ops.inc.php CHANGED
@@ -31,8 +31,11 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_els_ops"))
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
- echo '<div id="icon-plugins" class="icon32"><br /></div>'."\n";
35
- echo '<h2>s2Member API / List Servers</h2>'."\n";
36
37
echo '<table class="ws-menu-page-table">'."\n";
38
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
@@ -105,7 +108,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_els_ops"))
105
106
echo '<div class="ws-menu-page-hr"></div>'."\n";
107
108
- echo '<div class="ws-menu-page-hilite" style="border-radius:3px; padding:5px;">'."\n";
109
echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during MailChimp processing. See: <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")).'">Log Files (Debug)</a>.</span></p>'."\n";
110
echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>'."\n";
111
echo '</div>'."\n";
@@ -124,7 +127,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_els_ops"))
124
echo '<div class="ws-menu-page-group" title="AWeber Integration">'."\n";
125
126
echo '<div class="ws-menu-page-section ws-plugin--s2member-aweber-section">'."\n";
127
- 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";
128
echo '<h3>AWeber List Server Integration (optional)</h3>'."\n";
129
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";
130
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.s2member.com/kb/aweber-email-parser-for-s2member/" target="_blank" rel="external">Custom Email Parser</a> inside your AWeber account.</p>'."\n";
@@ -162,7 +165,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_els_ops"))
162
163
echo '<div class="ws-menu-page-hr"></div>'."\n";
164
165
- echo '<div class="ws-menu-page-hilite" style="border-radius:3px; padding:5px;">'."\n";
166
echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during AWeber processing. See: <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")).'">Log Files (Debug)</a>.</span></p>'."\n";
167
echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>'."\n";
168
echo '</div>'."\n";
@@ -321,7 +324,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_els_ops"))
321
322
echo '<div class="ws-menu-page-hr"></div>'."\n";
323
324
- echo '<p class="submit"><input type="submit" class="button-primary" value="Save All Changes" /></p>'."\n";
325
326
echo '</form>'."\n";
327
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
+ echo '<div class="ws-menu-page-toolbox">'."\n";
35
+ c_ws_plugin__s2member_menu_pages_tb::display ();
36
+ echo '</div>'."\n";
37
+
38
+ echo '<h2>API / List Servers</h2>'."\n";
39
40
echo '<table class="ws-menu-page-table">'."\n";
41
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
108
109
echo '<div class="ws-menu-page-hr"></div>'."\n";
110
111
+ echo '<div class="info" style="margin-bottom:0;">'."\n";
112
echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during MailChimp processing. See: <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")).'">Log Files (Debug)</a>.</span></p>'."\n";
113
echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>'."\n";
114
echo '</div>'."\n";
127
echo '<div class="ws-menu-page-group" title="AWeber Integration">'."\n";
128
129
echo '<div class="ws-menu-page-section ws-plugin--s2member-aweber-section">'."\n";
130
+ 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 screenshot" style="width:125px; height:125px; border:0;" alt="." /></a>'."\n";
131
echo '<h3>AWeber List Server Integration (optional)</h3>'."\n";
132
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";
133
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.s2member.com/kb/aweber-email-parser-for-s2member/" target="_blank" rel="external">Custom Email Parser</a> inside your AWeber account.</p>'."\n";
165
166
echo '<div class="ws-menu-page-hr"></div>'."\n";
167
168
+ echo '<div class="info" style="margin-bottom:0;">'."\n";
169
echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems during AWeber processing. See: <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--s2member-logs")).'">Log Files (Debug)</a>.</span></p>'."\n";
170
echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>'."\n";
171
echo '</div>'."\n";
324
325
echo '<div class="ws-menu-page-hr"></div>'."\n";
326
327
+ echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>'."\n";
328
329
echo '</form>'."\n";
330
includes/menu-pages/gen-ops.inc.php CHANGED
@@ -31,8 +31,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
31
{
32
echo '<div class="wrap ws-menu-page">' . "\n";
33
34
- echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
35
- echo '<h2>s2Member General Options</h2>' . "\n";
36
37
echo '<table class="ws-menu-page-table">' . "\n";
38
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
@@ -197,7 +200,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
197
echo '<tr>' . "\n";
198
199
echo '<td>' . "\n";
200
- echo '<textarea name="ws_plugin__s2member_wp_footer_code" id="ws-plugin--s2member-wp-footer-code" rows="8" wrap="off" spellcheck="false" style="font-family:Consolas, monospace;">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["wp_footer_code"]) . '</textarea><br />' . "\n";
201
echo 'Any valid XHTML / JavaScript' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? '' : ' (or even PHP)') . ' code will work just fine here.' . "\n";
202
echo '</td>' . "\n";
203
@@ -1348,10 +1351,10 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
1348
echo '<div class="ws-menu-page-hr"></div>' . "\n";
1349
1350
echo '<p><strong>Shortcode (copy/paste)</strong>, for an Inline Profile Modification Form:<br />' . "\n";
1351
- echo '<p><input type="text" autocomplete="off" value="' . format_to_edit ('[s2Member-Profile /]') . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
1352
1353
echo '<p style="margin-top:20px;"><strong>Stand-Alone (copy/paste)</strong>, for popup window:</p>' . "\n";
1354
- echo '<p><input type="text" autocomplete="off" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.x-php"))) . '" style="font-size:90%; font-family:Consolas, monospace; width:99%;" onclick="this.select ();" /></p>' . "\n";
1355
echo '</div>' . "\n";
1356
1357
echo '</div>' . "\n";
@@ -1421,7 +1424,7 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_gen_ops"))
1421
1422
echo '<div class="ws-menu-page-hr"></div>' . "\n";
1423
1424
- echo '<p class="submit"><input type="submit" class="button-primary" value="Save All Changes" /></p>' . "\n";
1425
1426
echo '</form>' . "\n";
1427
31
{
32
echo '<div class="wrap ws-menu-page">' . "\n";
33
34
+ echo '<div class="ws-menu-page-toolbox">'."\n";
35
+ c_ws_plugin__s2member_menu_pages_tb::display ();
36
+ echo '</div>'."\n";
37
+
38
+ echo '<h2>General Options</h2>' . "\n";
39
40
echo '<table class="ws-menu-page-table">' . "\n";
41
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
200
echo '<tr>' . "\n";
201
202
echo '<td>' . "\n";
203
+ echo '<textarea name="ws_plugin__s2member_wp_footer_code" id="ws-plugin--s2member-wp-footer-code" rows="8" wrap="off" spellcheck="false" class="monospace">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["wp_footer_code"]) . '</textarea><br />' . "\n";
204
echo 'Any valid XHTML / JavaScript' . ((is_multisite () && c_ws_plugin__s2member_utils_conds::is_multisite_farm () && !is_main_site ()) ? '' : ' (or even PHP)') . ' code will work just fine here.' . "\n";
205
echo '</td>' . "\n";
206
1351
echo '<div class="ws-menu-page-hr"></div>' . "\n";
1352
1353
echo '<p><strong>Shortcode (copy/paste)</strong>, for an Inline Profile Modification Form:<br />' . "\n";
1354
+ echo '<p><input type="text" autocomplete="off" value="' . format_to_edit ('[s2Member-Profile /]') . '" class="monospace" onclick="this.select ();" /></p>' . "\n";
1355
1356
echo '<p style="margin-top:20px;"><strong>Stand-Alone (copy/paste)</strong>, for popup window:</p>' . "\n";
1357
+ echo '<p><input type="text" autocomplete="off" value="' . format_to_edit (preg_replace ("/\<\?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; \?\>/", c_ws_plugin__s2member_utils_strings::esc_ds (site_url ("/?s2member_profile=1")), file_get_contents (dirname (__FILE__) . "/code-samples/current-user-profile-modification-page-url-2-ops.x-php"))) . '" class="monospace" onclick="this.select ();" /></p>' . "\n";
1358
echo '</div>' . "\n";
1359
1360
echo '</div>' . "\n";
1424
1425
echo '<div class="ws-menu-page-hr"></div>' . "\n";
1426
1427
+ echo '<p class="submit"><input type="submit" value="Save All Changes" /></p>' . "\n";
1428
1429
echo '</form>' . "\n";
1430
includes/menu-pages/info.inc.php CHANGED
@@ -31,8 +31,11 @@ if (!class_exists ("c_ws_plugin__s2member_menu_page_info"))
31
{
32
echo '<div class="wrap ws-menu-page">' . "\n";
33
34
- echo '<div id="icon-plugins" class="icon32"><br /></div>' . "\n";
35
- echo '<h2>s2Member Information</h2>' . "\n";
36
37
echo '<table class="ws-menu-page-table">' . "\n";
38
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
31
{
32
echo '<div class="wrap ws-menu-page">' . "\n";
33
34
+ echo '<div class="ws-menu-page-toolbox">'."\n";
35
+ c_ws_plugin__s2member_menu_pages_tb::display ();
36
+ echo '</div>'."\n";
37
+
38
+ echo '<h2>Specs / Info</h2>' . "\n";
39
40
echo '<table class="ws-menu-page-table">' . "\n";
41
echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
includes/menu-pages/integrations.inc.php CHANGED
@@ -31,8 +31,11 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_integrations"))
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
- echo '<div id="icon-plugins" class="icon32"><br /></div>'."\n";
35
- echo '<h2>Other s2Member Integrations</h2>'."\n";
36
37
echo '<table class="ws-menu-page-table">'."\n";
38
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
+ echo '<div class="ws-menu-page-toolbox">'."\n";
35
+ c_ws_plugin__s2member_menu_pages_tb::display ();
36
+ echo '</div>'."\n";
37
+
38
+ echo '<h2>Other Integrations</h2>'."\n";
39
40
echo '<table class="ws-menu-page-table">'."\n";
41
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
includes/menu-pages/js-c-warning.inc.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * JS conflict warning for Menu Pages.
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\Menu_Pages
15
- * @since 110912
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_js_c_warning"))
21
- {
22
- /**
23
- * Newsletter/Feed Boxes for Menu Pages.
24
- *
25
- * @package s2Member\Menu_Pages
26
- * @since 110531
27
- */
28
- class c_ws_plugin__s2member_menu_pages_js_c_warning
29
- {
30
- public function __construct ()
31
- {
32
- echo '<p style="margin-top:0;"><strong>Dashboard JavaScript Conflict</strong></p>' . "\n";
33
- echo '<p>Something is conflicting with the jQuery JavaScript framework, which s2Member uses; causing this warning to be visible to you.</p>' . "\n";
34
- echo '<p style="margin-bottom:0;">Please deactivate one other plugin at a time until you find the culprit. Or, in Firefox, see <code>Tools -› Error Console</code>.</p>';
35
- }
36
- }
37
- }
38
-
39
- new c_ws_plugin__s2member_menu_pages_js_c_warning ();
40
- ?>
includes/menu-pages/logs.inc.php CHANGED
@@ -31,8 +31,11 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
- echo '<div id="icon-plugins" class="icon32"><br /></div>'."\n";
35
- echo '<h2>s2Member Logs</h2>'."\n";
36
37
echo '<table class="ws-menu-page-table">'."\n";
38
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
@@ -66,7 +69,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
66
67
echo '<h3>Search s2Member KB Articles, Forums, Codex and more<em>!</em></h3>'."\n";
68
echo '<form method="get" action="http://www.s2member.com/quick-s.php" target="_blank" onsubmit="if(this.q.value === \'enter search terms...\') this.q.value = \'\';">'."\n";
69
- echo '<p><input type="text" name="q" value="enter search terms..." style="width:60%;" onfocus="if(this.value === \'enter search terms...\') this.value = \'\';" onblur="if(this.value === \'\') this.value = \'enter search terms...\';" /><input type="submit" value="Search" /></p>'."\n";
70
echo '</form>'."\n";
71
72
do_action ("ws_plugin__s2member_during_logs_page_during_left_sections_during_help", get_defined_vars ());
@@ -85,9 +88,12 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
85
86
echo '<h3>Logging Configuration</h3>'."\n";
87
88
- echo '<div class="ws-menu-page-hilite" style="border-radius:3px; padding:5px;">'."\n";
89
echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems that occur during processing. Enable logging here, and then view your log files below; in the s2Member Log Viewer.</span></p>'."\n";
90
echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>'."\n";
91
echo '<p style="font-size:110%; margin-bottom:0;"><span>Regarding s2Member Security Badges. If debug logging is enabled, your site will NOT qualify for an s2Member Security Badge until you disable logging (and you must ALSO download, and then delete any existing log files). For further details, please see KB Article: <a href="http://www.s2member.com/kb/security-badges/" target="_blank" rel="external">s2Member Security Badges</a>.</span></p>'."\n";
92
echo '</div>'."\n";
93
@@ -139,7 +145,7 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
139
echo '</table>' . "\n";
140
141
echo '<p class="submit" style="margin-top:20px;">'."\n";
142
- echo '<input type="submit" class="button-primary" value="Update Logging Configuration" />'."\n";
143
echo '</p>' . "\n";
144
145
echo '</form>'."\n";
@@ -165,17 +171,17 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
165
166
echo '<form method="post" onsubmit="if(!confirm(\'Archive all existing log files?\n\nAll of your current log files will be archived (e.g. they will simply be renamed with an ARCHIVED tag &amp; date in their file name); and new log files will be created automatically the next time s2Member logs something on your installation.\n\nPlease click OK to confirm this action.\')) return false;">'."\n";
167
echo '<input type="hidden" name="ws_plugin__s2member_logs_archive_start_fresh" value="'.esc_attr(wp_create_nonce ("ws-plugin--s2member-logs-archive-start-fresh")).'" />'."\n";
168
- echo '<input type="submit" value="Archive All Current Log Files" class="ws-menu-page-right ws-plugin--s2member-archive-logs-start-fresh-button" style="clear:right; min-width:200px;" />'."\n";
169
echo '</form>'."\n";
170
171
echo '<form method="post" onsubmit="if(!confirm(\'Delete all existing log files?\n\nThis will permanently delete ALL of your existing log files (including any archived log files).\n\nPlease click OK to confirm this action.\')) return false;">'."\n";
172
echo '<input type="hidden" name="ws_plugin__s2member_logs_delete_start_fresh" value="'.esc_attr(wp_create_nonce ("ws-plugin--s2member-logs-delete-start-fresh")).'" />'."\n";
173
- echo '<input type="submit" value="Permanently Delete All Log Files" class="ws-menu-page-right ws-plugin--s2member-delete-logs-start-fresh-button" style="clear:right; min-width:200px;" />'."\n";
174
echo '</form>'."\n";
175
176
echo '<form method="post">'."\n";
177
echo '<input type="hidden" name="ws_plugin__s2member_logs_download_zip" value="'.esc_attr(wp_create_nonce ("ws-plugin--s2member-logs-download-zip")).'" />'."\n";
178
- echo '<input type="submit" value="Download All Log Files (Zip File)" class="ws-menu-page-right ws-plugin--s2member-logs-download-zip-button" style="clear:right; min-width:200px;" />'."\n";
179
echo '</form>'."\n";
180
181
echo '<p><strong>Debugging Tips:</strong> &nbsp;&nbsp; It is normal to see a few errors in your log files. This is because s2Member logs ALL of its communication with Payment Gateways. Everything — not just successes. With that in mind, there will be some failures that s2Member expects (to a certain extent); and s2Member deals with these gracefully. What you\'re looking for here, are things that jump right out at you as being a major issue (e.g. when s2Member makes a point of providing details to you in a log entry about problems that should be corrected on your installation). Please read carefully.</p>'."\n";
@@ -261,8 +267,8 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
261
echo '</select>' . "\n";
262
echo '</td>' . "\n";
263
264
- echo '<td style="width:20%;">' . "\n";
265
- echo '<input type="submit" value="View" class="button-primary" />'."\n";
266
echo '</td>' . "\n";
267
268
echo '</tr>' . "\n";
@@ -295,20 +301,20 @@ if(!class_exists("c_ws_plugin__s2member_menu_page_logs"))
295
echo '<p style="float:right; text-align:right;">[ <a href="'.esc_attr(add_query_arg(array("ws_plugin__s2member_download_log_file" => $view_log_file, "ws_plugin__s2member_download_log_file_v" => wp_create_nonce ("ws-plugin--s2member-download-log-file-v")))).'"><strong>download file</strong></a> ]</p>'."\n";
296
echo '<p style="margin-right:10px; float:right; text-align:right;"><a href="#" class="ws-plugin--s2member-log-file-viewport-toggle" style="text-decoration:none;">&#8659; expand viewport &#8659;</a></p>'."\n";
297
298
- echo '<textarea id="ws-plugin--s2member-log-file-viewer" rows="20" wrap="on" spellcheck="false" style="box-shadow:inset 0 0 8px #000000; background:#EEEEEE; color:#000000; overflow-y:scroll; font-family:\'Consolas\', \'Monaco\', monospace;">'.htmlspecialchars(file_get_contents($logs_dir."/".$view_log_file)).'</textarea>' . "\n";
299
300
echo '<p style="float:left; text-align:left;"><strong>Viewing:</strong> <a href="'.esc_attr(add_query_arg(array("ws_plugin__s2member_download_log_file" => $view_log_file, "ws_plugin__s2member_download_log_file_v" => wp_create_nonce ("ws-plugin--s2member-download-log-file-v")))).'">'.esc_html($view_log_file).'</a> (log entries oldest to newest)</p>'."\n";
301
echo '<p style="float:right; text-align:right;">[ <a href="'.esc_attr(add_query_arg(array("ws_plugin__s2member_download_log_file" => $view_log_file, "ws_plugin__s2member_download_log_file_v" => wp_create_nonce ("ws-plugin--s2member-download-log-file-v")))).'"><strong>download file</strong></a> ]</p>'."\n";
302
echo '<p style="margin-right:10px; float:right; text-align:right;"><a href="#" class="ws-plugin--s2member-log-file-viewport-toggle" style="text-decoration:none;">&#8659; expand viewport &#8659;</a></p>'."\n";
303
}
304
else if($view_log_file && file_exists($logs_dir."/".$view_log_file))
305
- echo '<textarea id="ws-plugin--s2member-log-file-viewer" rows="20" wrap="on" spellcheck="false" style="box-shadow:inset 0 0 8px #000000; background:#EEEEEE; color:#000000; overflow-y:scroll; font-family:\'Consolas\', \'Monaco\', monospace; font-style:italic;">— Empty at this time —</textarea>' . "\n";
306
307
else if($view_log_file && !file_exists($logs_dir."/".$view_log_file))
308
- echo '<textarea id="ws-plugin--s2member-log-file-viewer" rows="20" wrap="on" spellcheck="false" style="box-shadow:inset 0 0 8px #000000; background:#EEEEEE; color:#000000; overflow-y:scroll; font-family:\'Consolas\', \'Monaco\', monospace; font-style:italic;">— File no longer exists —</textarea>' . "\n";
309
310
else // Display an empty textarea in this default scenario.
311
- echo '<textarea id="ws-plugin--s2member-log-file-viewer" rows="20" wrap="on" spellcheck="false" style="box-shadow:inset 0 0 8px #000000; background:#EEEEEE; color:#000000; overflow-y:scroll; font-family:\'Consolas\', \'Monaco\', monospace; font-style:italic;"></textarea>' . "\n";
312
313
echo '</td>' . "\n";
314
31
{
32
echo '<div class="wrap ws-menu-page">'."\n";
33
34
+ echo '<div class="ws-menu-page-toolbox">'."\n";
35
+ c_ws_plugin__s2member_menu_pages_tb::display ();
36
+ echo '</div>'."\n";
37
+
38
+ echo '<h2>Log Files</h2>'."\n";
39
40
echo '<table class="ws-menu-page-table">'."\n";
41
echo '<tbody class="ws-menu-page-table-tbody">'."\n";
69
70
echo '<h3>Search s2Member KB Articles, Forums, Codex and more<em>!</em></h3>'."\n";
71
echo '<form method="get" action="http://www.s2member.com/quick-s.php" target="_blank" onsubmit="if(this.q.value === \'enter search terms...\') this.q.value = \'\';">'."\n";
72
+ echo '<p><input type="text" name="q" value="enter search terms..." style="width:60%;" onfocus="if(this.value === \'enter search terms...\') this.value = \'\';" onblur="if(this.value === \'\') this.value = \'enter search terms...\';" /> <input type="submit" value="Search" style="font-size:120%; font-weight:normal;" /></p>'."\n";
73
echo '</form>'."\n";
74
75
do_action ("ws_plugin__s2member_during_logs_page_during_left_sections_during_help", get_defined_vars ());
88
89
echo '<h3>Logging Configuration</h3>'."\n";
90
91
+ echo '<div class="info">'."\n";
92
echo '<p style="font-size:110%; margin-top:0;"><span>We HIGHLY recommend that you enable logging during your initial testing phase. Logs produce lots of useful details that can help in debugging. Logs can help you find issues in your configuration and/or problems that occur during processing. Enable logging here, and then view your log files below; in the s2Member Log Viewer.</span></p>'."\n";
93
echo '<p style="font-size:110%; margin-bottom:0;"><span class="ws-menu-page-error">However, it is VERY IMPORTANT to disable logging once you go live. Log files may contain personally identifiable information, credit card numbers, secret API credentials, passwords and/or other sensitive information. We STRONGLY suggest that logging be disabled on a live site (for security reasons).</span></p>'."\n";
94
+ echo '</div>'."\n";
95
+
96
+ echo '<div class="notice" style="margin-bottom:0;">'."\n";
97
echo '<p style="font-size:110%; margin-bottom:0;"><span>Regarding s2Member Security Badges. If debug logging is enabled, your site will NOT qualify for an s2Member Security Badge until you disable logging (and you must ALSO download, and then delete any existing log files). For further details, please see KB Article: <a href="http://www.s2member.com/kb/security-badges/" target="_blank" rel="external">s2Member Security Badges</a>.</span></p>'."\n";
98
echo '</div>'."\n";
99
145
echo '</table>' . "\n";
146
147
echo '<p class="submit" style="margin-top:20px;">'."\n";
148
+ echo '<input type="submit" value="Update Logging Configuration" />'."\n";
149
echo '</p>' . "\n";
150
151
echo '</form>'."\n";
171
172
echo '<form method="post" onsubmit="if(!confirm(\'Archive all existing log files?\n\nAll of your current log files will be archived (e.g. they will simply be renamed with an ARCHIVED tag &amp; date in their file name); and new log files will be created automatically the next time s2Member logs something on your installation.\n\nPlease click OK to confirm this action.\')) return false;">'."\n";
173
echo '<input type="hidden" name="ws_plugin__s2member_logs_archive_start_fresh" value="'.esc_attr(wp_create_nonce ("ws-plugin--s2member-logs-archive-start-fresh")).'" />'."\n";
174