PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 111017
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v111017
260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 120213 All 189 releases
s2member / includes / menu-pages / integrations.inc.php

integrations.inc.php in s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions 111017, at includes/menu-pages/integrations.inc.php

178 lines 13.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Menu page for the s2Member plugin ( Integrations page ).
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 3.0
16 */
17 if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
18 exit("Do not access this file directly.");
19 /**/
20 if (!class_exists ("c_ws_plugin__s2member_menu_page_integrations"))
21 {
22 /**
23 * Menu page for the s2Member plugin ( Integrations page ).
24 *
25 * @package s2Member\Menu_Pages
26 * @since 110531
27 */
28 class c_ws_plugin__s2member_menu_page_integrations
29 {
30 public function __construct ()
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";
39 echo '<tr class="ws-menu-page-table-tr">' . "\n";
40 echo '<td class="ws-menu-page-table-l">' . "\n";
41 /**/
42 do_action ("ws_plugin__s2member_during_integrations_page_before_left_sections", get_defined_vars ());
43 /**/
44 if (apply_filters ("ws_plugin__s2member_during_integrations_page_during_left_sections_display_bbpress", true, get_defined_vars ()))
45 {
46 do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_before_bbpress", get_defined_vars ());
47 /**/
48 echo '<div class="ws-menu-page-group" title="bbPress® Plugin Integration ( 2.0+ plugin version )">' . "\n";
49 /**/
50 echo '<div class="ws-menu-page-section ws-plugin--s2member-bbpress-section">' . "\n";
51 echo '<h3>bbPress® Plugin Integration ( easy peasy )</h3>' . "\n";
52 echo '<input type="button" value="Update Roles/Capabilities" class="ws-menu-page-right ws-plugin--s2member-update-roles-button" style="min-width:175px;" />' . "\n";
53 echo '<p>The plugin version of <a href="http://bbpress.org/" target="_blank" rel="external">bbPress® 2.0+</a> integrates seamlessly with WordPress®. If bbPress® was already installed when you activated s2Member, your s2Member Roles/Capabilities are already configured to work in harmony with bbPress®. If you didn\'t, you can simply click the "Update Roles/Capabilities" button here. That\'s all it takes. Once your Roles/Capbilities are updated, s2Member and bbPress® are fully integrated with each other.</p>' . "\n";
54 echo '<h3>bbPress® Forums and s2Member Roles/Capabilities</h3>' . "\n";
55 echo '<p>s2Member configures your Membership Roles ( by default, these include: <em>s2Member Level 1</em>, <em>s2Member Level 2</em>, <em>s2Member Level 3</em>, <em>s2Member Level 4</em> ), with a default set of permissions that allow all Members to access and particpate in your forums, just as if they were a WordPress® Subscriber Role. This is how bbPress® expects s2Member to behave. bbPress® also adds a new Role to your WordPress® installation: <em>Forum Moderator</em>. s2Member allows Forum Moderators full access to all content protected by s2Member, just like <em>Administrators</em>, <em>Editors</em>, <em>Authors</em>, and <em>Contributors</em>.</p>' . "\n";
56 echo '<p><strong>Membership Levels provide incremental access:</strong></p>' . "\n";
57 echo '<p>* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 &amp; 3.<br />* A Member with Level 3 access, will also be able to access Levels 0, 1 &amp; 2.<br />* A Member with Level 2 access, will also be able to access Levels 0 &amp; 1.<br />* A Member with Level 1 access, will also be able to access Level 0.<br />* A Subscriber with Level 0 access, will ONLY be able to access Level 0.<br />* A public Visitor will have NO access to protected content.</p>' . "\n";
58 echo '<p><em>* WordPress® Subscribers are at Membership Level 0. If you\'re allowing Open Registration, Subscribers will be at Level 0 ( a Free Subscriber ). WordPress® Administrators, Editors, Authors, Contributors, <strong class="ws-menu-page-hilite">and bbPress® Forum Moderators</strong> have Level 4 access, with respect to s2Member. All of their other Roles/Capabilities are left untouched.</em></p>' . "\n";
59 echo '<p>You can protect individual Forum Topics/Posts/Replies at different Levels with s2Member, or even with Custom Capabilities. Forum Topics/Posts/Replies are integrated by bbPress® internally as "Custom Post Types", which can be protected by s2Member either through Post Level Access Restrictions, or through URI Level Access Restrictions. s2Member will provide you with drop-down menus whenever you add or edit Forum Topics/Posts/Replies.</p>' . "\n";
60 echo '<p>You can also take a look at: <code>s2Member -> Restriction Options</code>. * Note, it is currently NOT possible to protect a Forum, and have all Topics inside that Forum protected automatically. In order to accomplish that, you\'ll need to use s2Member\'s URI Access Restrictions. We\'re working to improve this functionality in the mean time. Also, s2Member is currently NOT capable of protecting Topic Tags; but you can use URI Restrictions for these in the mean time.</p>' . "\n";
61 do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_during_api_easy_way", get_defined_vars ());
62 echo '</div>' . "\n";
63 /**/
64 echo '</div>' . "\n";
65 /**/
66 do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_after_bbpress", get_defined_vars ());
67 }
68 /* This remains for backward compatibility with bbPress® v1.0.3 and prior. */
69 if (apply_filters ("ws_plugin__s2member_during_integrations_page_during_left_sections_display_bbpress", true, get_defined_vars ()))
70 {
71 do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_before_bbpress", get_defined_vars ());
72 /**/
73 echo '<div class="ws-menu-page-group" title="bbPress® Bridge Integration ( 1.0.3- legacy )">' . "\n";
74 /**/
75 echo '<div class="ws-menu-page-section ws-plugin--s2member-bbpress-section">' . "\n";
76 echo '<h3>bbPress® Bridge Integration ( install/uninstall )</h3>' . "\n";
77 echo '<p>If you\'re running <a href="http://bbpress.org/" target="_blank" rel="external">bbPress® forums</a> v1.0.3 or prior, you can protect them with the s2Member plugin. BUT, you will need to install this Bridge/plugin first. This bbPress® Bridge/plugin will block all non-Member access to your forums. Only the bbPress® login-page will be available. Forum registration will be redirected to your Membership Options Page for s2Member <em>( on your main WordPress® installation )</em>. This way, a visitor can signup on your site, and gain Membership Access to your forums.</p>' . "\n";
78 echo '<p><em>* This Bridge/plugin will NOT work, until you\'ve successfully integrated WordPress® into bbPress®. For more information, log into your bbPress® Dashboard, and go to: <code>bbPress® -> Settings -> WordPress® Integration</code>. Once you have WordPress® integrated ( <a href="http://wordpress.org/extend/plugins/bbpress-integration/" target="_blank" rel="external">install this plugin</a> ) and follow the instructions regarding your <code>/wp-config.php</code> file. Then, come back here, and install the s2Member Bridge/plugin. * This Bridge Integration could also be installed manually. You\'ll find the bbPress® Bridge/plugin inside <code>/s2member/includes/dropins/bridges/_s2member-bbpress-bridge.php</code>. Pop that file into the `my-plugins/` directory for bbPress®, or just click the Install button below; s2Member will do this part for you automatically.</em></p>' . "\n";
79 echo '<p><em>* This Bridge/plugin will also add a PHP Conditional Tag to your installation of bbPress®. This is 100% optional. Once installed, you could do something like this inside your bbPress® theme files with PHP code: ' . c_ws_plugin__s2member_utils_strings::highlight_php ('<?php if(current_wp_user_is("s2member_level2")){ /* Content. */ } ?>') . ' ... you can test for any WordPress® Role. The most common Roles associated with s2Member are: <code>subscriber</code>, <code>s2member_level1</code>, <code>s2member_level2</code>, <code>s2member_level3</code>, <code>s2member_level4</code>. This may come in handy for a developer integrating bbPress® in creative ways.</em></p>' . "\n";
80 do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_during_api_easy_way", get_defined_vars ());
81 /**/
82 echo '<form method="post" name="ws_plugin__s2member_bridge_bbpress_form" id="ws-plugin--s2member-bridge-bbpress-form">' . "\n";
83 echo '<input type="hidden" name="ws_plugin__s2member_bridge_bbpress" id="ws-plugin--s2member-bridge-bbpress" value="' . esc_attr (wp_create_nonce ("ws-plugin--s2member-bridge-bbpress")) . '" />' . "\n";
84 /**/
85 echo '<table class="form-table">' . "\n";
86 echo '<tbody>' . "\n";
87 echo '<tr>' . "\n";
88 /**/
89 echo '<th>' . "\n";
90 echo '<label for="ws_plugin--s2member-bridge-bbpress-plugins-dir">' . "\n";
91 echo 'Server path to your bbPress® plugins directory:' . "\n";
92 echo '</label>' . "\n";
93 echo '</th>' . "\n";
94 /**/
95 echo '</tr>' . "\n";
96 echo '<tr>' . "\n";
97 /**/
98 echo '<td>' . "\n";
99 echo '<input type="text" name="ws_plugin__s2member_bridge_bbpress_plugins_dir" id="ws_plugin--s2member-bridge-bbpress-plugins-dir" value="' . format_to_edit ($_POST["ws_plugin__s2member_bridge_bbpress_plugins_dir"]) . '" /><br />' . "\n";
100 echo 'Something like: <code>' . esc_html (rtrim ($_SERVER["DOCUMENT_ROOT"], DIRECTORY_SEPARATOR . "/") . "/bbpress/my-plugins") . '</code>' . "\n";
101 echo '</td>' . "\n";
102 /**/
103 echo '</tr>' . "\n";
104 echo '<tr>' . "\n";
105 /**/
106 echo '<th>' . "\n";
107 echo '<label for="ws_plugin--s2member-bridge-bbpress-ovg">' . "\n";
108 echo 'Allow Open Viewing? ( can public visitors read forum posts? )' . "\n";
109 echo '</label>' . "\n";
110 echo '</th>' . "\n";
111 /**/
112 echo '</tr>' . "\n";
113 echo '<tr>' . "\n";
114 /**/
115 echo '<td>' . "\n";
116 echo '<select name="ws_plugin__s2member_bridge_bbpress_ovg" id="ws-plugin--s2member-bbpress-ovg">' . "\n";
117 echo '<option value="0"' . ((!$_POST["ws_plugin__s2member_bridge_bbpress_min_level"]) ? ' selected="selected"' : '') . '>No ( my bbPress® forums are off-limits to the public )</option>' . "\n";
118 echo '<option value="1"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"]) ? ' selected="selected"' : '') . '>Yes ( enable Open Viewing for public visitors ) read-only</option>' . "\n";
119 echo '</select><span id="ws-plugin--s2member-bbpress-ovg-off-note" style="display:none;"><br />When this is <code>No</code>, the next setting below will include both read-access &amp; participation together ( as one concept ).</span>' . "\n";
120 echo '</td>' . "\n";
121 /**/
122 echo '</tr>' . "\n";
123 echo '<tr>' . "\n";
124 /**/
125 echo '<th>' . "\n";
126 echo '<label for="ws_plugin--s2member-bridge-bbpress-min-level">' . "\n";
127 echo 'Minimum Level to participate in your bbPress® forums.' . "\n";
128 echo '</label>' . "\n";
129 echo '</th>' . "\n";
130 /**/
131 echo '</tr>' . "\n";
132 echo '<tr>' . "\n";
133 /**/
134 echo '<td>' . "\n";
135 echo '<select name="ws_plugin__s2member_bridge_bbpress_min_level" id="ws-plugin--s2member-bbpress-min-level">' . "\n";
136 echo '<option value="0"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "0") ? ' selected="selected"' : '') . '>Require s2Member Level #0 ( to participate )</option>' . "\n";
137 echo '<option value="1"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "1") ? ' selected="selected"' : '') . '>Require s2Member Level #1 ( to participate )</option>' . "\n";
138 echo '<option value="2"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "2") ? ' selected="selected"' : '') . '>Require s2Member Level #2 ( to participate )</option>' . "\n";
139 echo '<option value="3"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "3") ? ' selected="selected"' : '') . '>Require s2Member Level #3 ( to participate )</option>' . "\n";
140 echo '<option value="4"' . (($_POST["ws_plugin__s2member_bridge_bbpress_min_level"] === "4") ? ' selected="selected"' : '') . '>Require s2Member Level #4 ( to participate )</option>' . "\n";
141 echo '</select>' . "\n";
142 echo '</td>' . "\n";
143 /**/
144 echo '</tr>' . "\n";
145 echo '</tbody>' . "\n";
146 echo '</table>' . "\n";
147 /**/
148 echo '<br />' . "\n";
149 /**/
150 echo '<p class="submit"><input type="submit" name="ws_plugin__s2member_bridge_bbpress_action" class="button-primary" value="Install / Re-Install" /> &nbsp;&nbsp; <input type="submit" name="ws_plugin__s2member_bridge_bbpress_action" class="button-primary" value="Un-Install" /></p>' . "\n";
151 /**/
152 echo '</form>' . "\n";
153 echo '</div>' . "\n";
154 /**/
155 echo '</div>' . "\n";
156 /**/
157 do_action ("ws_plugin__s2member_during_integrations_page_during_left_sections_after_bbpress", get_defined_vars ());
158 }
159 /**/
160 do_action ("ws_plugin__s2member_during_integrations_page_after_left_sections", get_defined_vars ());
161 /**/
162 echo '</td>' . "\n";
163 /**/
164 echo '<td class="ws-menu-page-table-r">' . "\n";
165 c_ws_plugin__s2member_menu_pages_rs::display ();
166 echo '</td>' . "\n";
167 /**/
168 echo '</tr>' . "\n";
169 echo '</tbody>' . "\n";
170 echo '</table>' . "\n";
171 /**/
172 echo '</div>' . "\n";
173 }
174 }
175 }
176 /**/
177 new c_ws_plugin__s2member_menu_page_integrations ();
178 ?>