本文整理汇总了PHP中c_ws_plugin__s2member_utils_conds::is_multisite_farm方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_conds::is_multisite_farm方法的具体用法?PHP c_ws_plugin__s2member_utils_conds::is_multisite_farm怎么用?PHP c_ws_plugin__s2member_utils_conds::is_multisite_farm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c_ws_plugin__s2member_utils_conds
的用法示例。
在下文中一共展示了c_ws_plugin__s2member_utils_conds::is_multisite_farm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sc_get_details
/**
* Handles the Shortcode for: `[s2Get /]`.
*
* @package s2Member\s2Get
* @since 3.5
*
* @attaches-to ``add_shortcode("s2Get");``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
* @return mixed Value of the requested data, or null on failure.
*
* @todo Prevent this routine from potentially returning objects/arrays?
*/
public static function sc_get_details($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_sc_get_details", get_defined_vars());
unset($__refs, $__v);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
// Force array; trim quote entities.
$attr = shortcode_atts(array("constant" => "", "user_field" => "", "user_option" => "", "user_id" => ""), $attr);
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_sc_get_details_after_shortcode_atts", get_defined_vars());
unset($__refs, $__v);
if ($attr["constant"] && defined($attr["constant"])) {
if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || preg_match("/^S2MEMBER_/i", $attr["constant"])) {
$get = constant($attr["constant"]);
}
} else {
if ($attr["user_field"] && (is_user_logged_in() || $attr["user_id"])) {
$get = c_ws_plugin__s2member_utils_users::get_user_field($attr["user_field"], (int) $attr["user_id"]);
} else {
if ($attr["user_option"] && (is_user_logged_in() || $attr["user_id"])) {
$get = get_user_option($attr["user_option"], (int) $attr["user_id"]);
}
}
}
return apply_filters("ws_plugin__s2member_sc_get_details", isset($get) ? $get : null, get_defined_vars());
}
示例2: return_template
/**
* Handles Return templates w/ response message.
*
* @package s2Member\Return_Templates
* @since 110720
*
* @param str $template Optional A Subscr. Gateway code should be used as the template name, or `default` is a multipurpose template. Defaults to `default`. Used in template selection.
* @param str $response Optional. Response message to fill template with, using the Replacement Code `%%response%%` inside the template file. Defaults to: `Thank you. Please click the link below.`.
* @param str $continue_html Optional. The HTML value of the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: `Continue`.
* @param str $continue_link Optional. The HREF value for the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: ``home_url ("/")``.
* @return str The full HTML code of the template. All Replacement Codes inside the template file will have already been filled by this routine.
*/
public static function return_template($template = FALSE, $response = FALSE, $continue_html = FALSE, $continue_link = FALSE)
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_return_template", get_defined_vars());
unset($__refs, $__v);
$template = $template ? $template : "default";
$continue_link = $continue_link ? $continue_link : home_url("/");
$continue_html = $continue_html ? $continue_html : _x("Continue", "s2member-front", "s2member");
$response = $response ? $response : _x("Thank you. Please click the link below.", "s2member-front", "s2member");
$custom_template = file_exists(TEMPLATEPATH . "/" . $template . "-return.php") ? TEMPLATEPATH . "/" . $template . "-return.php" : false;
$custom_template = file_exists(TEMPLATEPATH . "/" . $template . "-return.html") ? TEMPLATEPATH . "/" . $template . "-return.html" : $custom_template;
$custom_template = file_exists(WP_CONTENT_DIR . "/" . $template . "-return.php") ? WP_CONTENT_DIR . "/" . $template . "-return.php" : $custom_template;
$custom_template = file_exists(WP_CONTENT_DIR . "/" . $template . "-return.html") ? WP_CONTENT_DIR . "/" . $template . "-return.html" : $custom_template;
$custom_template = !$custom_template && file_exists(TEMPLATEPATH . "/default-return.php") ? TEMPLATEPATH . "/default-return.php" : $custom_template;
$custom_template = !$custom_template && file_exists(TEMPLATEPATH . "/default-return.html") ? TEMPLATEPATH . "/default-return.html" : $custom_template;
$custom_template = !$custom_template && file_exists(WP_CONTENT_DIR . "/default-return.php") ? WP_CONTENT_DIR . "/default-return.php" : $custom_template;
$custom_template = !$custom_template && file_exists(WP_CONTENT_DIR . "/default-return.html") ? WP_CONTENT_DIR . "/default-return.html" : $custom_template;
$specific_template = $custom_template ? $custom_template : (file_exists($_default_specific_template = dirname(dirname(__FILE__)) . "/templates/returns/" . $template . "-return.php") ? $_default_specific_template : false);
$code = trim(file_get_contents($specific_template ? $specific_template : ($_default_template = dirname(dirname(__FILE__)) . "/templates/returns/default-return.php")));
$code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code);
$doctype_html_head = c_ws_plugin__s2member_utils_html::doctype_html_head(get_bloginfo("name"), "ws_plugin__s2member_during_return_template_head_" . ($specific_template ? basename($specific_template) : "default-return.php"));
$code = preg_replace("/%%doctype_html_head%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_doctype_html_head", $doctype_html_head, get_defined_vars())), $code);
$code = preg_replace("/%%header%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_header", sprintf(_x('[ %s ] <strong><em>says…</em></strong>', "s2member-front", "s2member"), esc_html($_SERVER["HTTP_HOST"])), get_defined_vars())), $code);
$code = preg_replace("/%%response%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_response", $response, get_defined_vars())), $code);
$code = preg_replace("/%%continue%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_continue", '<a href="' . esc_attr($continue_link) . '">' . $continue_html . '</a>', get_defined_vars())), $code);
$code = preg_replace("/%%support%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_support", sprintf(_x('If you need assistance, please <a href="%s" target="_blank">contact support</a>.', "s2member-front", "s2member"), esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_support_link"])), get_defined_vars())), $code);
$code = preg_replace("/%%tracking%%/i", c_ws_plugin__s2member_utils_strings::esc_ds(apply_filters("ws_plugin__s2member_return_template_tracking", c_ws_plugin__s2member_tracking_codes::generate_all_tracking_codes(), get_defined_vars())), $code);
return apply_filters("ws_plugin__s2member_return_template", $code, get_defined_vars());
}
示例3: __construct
public function __construct()
{
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h3 style="margin:0;">Auto-Return Page Template (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-pro-paypal-return-page-template\').toggle(); return false;" class="ws-dotted-link">optional customizations</a>)</h3>' . "\n";
echo '<div id="ws-plugin--s2member-pro-paypal-return-page-template" style="display:none;">' . "\n";
echo '<p>With s2Member Pro installed, you have the ability to customize your <a href="' . esc_attr(site_url("/?s2member_paypal_return=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">Auto-Return Page Template</a>. If you are using PayPal Standard integration <em>(i.e. PayPal Buttons)</em>, each of your Customers are returned back to your site immediately after they complete checkout at PayPal. Your Auto-Return Page displays a message and instructions for the Customer. s2Member may change the message and instructions dynamically, based on what the Customer is actually doing <em>(i.e. based on the type of transaction that is taking place)</em>. So, although we do NOT recommend that you attempt to change the message and instructions presented dynamically by s2Member, you CAN certainly control the Header, and/or the overall appearance of s2Member\'s Auto-Return Page Template.</p>' . "\n";
echo '<p>The quickest/easiest way, is to simply add some HTML code in the box below. For instance, you might include an <img> tag with your logo. The box below, allows you to customize the Header section <em>(i.e. the top)</em> of s2Member\'s default Auto-Return Page Template. Everything else, including the textual response and other important details that each Customer needs to know about, are already handled dynamically by s2Member <em>(based on the type of transaction that is taking place)</em>. All you need to do is customize the Header with your logo and anything else you feel is important. Although this Header customization is completely optional, we recommend an <a href="http://www.w3schools.com/tags/tag_img.asp" target="_blank" rel="external"><img> tag</a>, with a logo that is around 300px wide. After you "Save All Changes" below, you may <a href="' . esc_attr(site_url("/?s2member_paypal_return=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">click this link to see what your Header looks like</a>.</p>' . "\n";
echo '<table class="form-table">' . "\n";
echo '<tbody>' . "\n";
echo '<tr>' . "\n";
echo '<th>' . "\n";
echo '<label for="ws-plugin--s2member-pro-paypal-return-template-header">' . "\n";
echo 'Auto-Return Page Template Header:' . "\n";
echo '</label>' . "\n";
echo '</th>' . "\n";
echo '</tr>' . "\n";
echo '<tr>' . "\n";
echo '<td>' . "\n";
echo '<textarea name="ws_plugin__s2member_pro_paypal_return_template_header" id="ws-plugin--s2member-pro-paypal-return-template-header" rows="5" wrap="off" spellcheck="false">' . format_to_edit($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_paypal_return_template_header"]) . '</textarea><br />' . "\n";
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";
echo '</td>' . "\n";
echo '</tr>' . "\n";
echo '</tbody>' . "\n";
echo '</table>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
echo '<p>It is also possible to build your own Auto-Return Page Template, if you prefer. If you feel the need to create your own Auto-Return Page Template, please make a copy of s2Member\'s default template: <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir"] . "/includes/templates/returns/default-template.php")) . '</code>. Place your copy of this default template, inside your active WordPress theme directory, and name the file: <code>/paypal-return.php</code>. s2Member will automatically find your Auto-Return Page Template in this location, and s2Member will use your template, instead of the default. Further details are provided inside s2Member\'s default template file. Once your custom template file is in place, you may <a href="' . esc_attr(site_url("/?s2member_paypal_return=1&s2member_paypal_proxy=paypal&s2member_paypal_proxy_use=x-preview")) . '" target="_blank" rel="external">click this link to see what it looks like</a>.</p>' . "\n";
}
echo '<p>It is also possible to bypass s2Member\'s Auto-Return system all together, if you prefer. For further details, please read more about the <code>success=""</code> Shortcode Attribute for PayPal Buttons generated by s2Member. You will find details on this inside your Dashboard, under: <code>s2Member -› PayPal Buttons -› Shortcode Attributes (Explained)</code>. Please note: you will still need to configure your PayPal account for Auto-Return/PDT <em>(as instructed above)</em>. Then, you may use the <code>success=""</code> Attribute in your Shortcode, when/if you need it. In other words, if you use the <code>success=""</code> Attribute in your Shortcode, the initial redirection back to s2Member\'s default Auto-Return/PDT handler MUST still occur. However, instead of s2Member displaying an Auto-Return Template to the Customer, s2Member will silently redirect the Customer to the URL that you specified in the <code>success="http://..."</code> Attribute of your Shortcode, allowing you to take complete control over what happens next.</p>' . "\n";
echo '</div>' . "\n";
}
示例4: register
/**
* Handles Registration Links.
*
* @package s2Member\Registrations
* @since 3.5
*
* @attaches-to ``add_action("init");``
*
* @return null Or exits script execution after redirection.
*/
public static function register()
{
do_action("ws_plugin__s2member_before_register", get_defined_vars());
/**/
if (!empty($_GET["s2member_register"])) {
eval('while (@ob_end_clean ());');
/* First we end/clean any output buffers that may exist already. */
/**/
$msg_503 = _x('<strong>Your Link Expired:</strong><br />Please contact Support if you need assistance.', "s2member-front", "s2member");
/**/
if (is_array($register = preg_split("/\\:\\.\\:\\|\\:\\.\\:/", c_ws_plugin__s2member_utils_encryption::decrypt(trim(stripslashes((string) $_GET["s2member_register"])))))) {
if (count($register) === 6 && $register[0] === "subscr_gateway_subscr_id_custom_item_number_time") {
if (is_numeric($register[5]) && $register[5] <= strtotime("now") && $register[5] >= strtotime("-" . apply_filters("ws_plugin__s2member_register_link_exp_time", "2 days", get_defined_vars()))) {
$_COOKIE["s2member_subscr_gateway"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[1]);
$_COOKIE["s2member_subscr_id"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[2]);
$_COOKIE["s2member_custom"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[3]);
$_COOKIE["s2member_item_number"] = c_ws_plugin__s2member_utils_encryption::encrypt($register[4]);
/**/
if (($reg_cookies = c_ws_plugin__s2member_register_access::reg_cookies_ok()) && extract($reg_cookies)) {
status_header(200);
/* Send a 200 OK status header. */
header("Content-Type: text/html; charset=utf-8");
/* Content-Type with UTF-8. */
/**/
setcookie("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_subscr_gateway", $_COOKIE["s2member_subscr_gateway"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
setcookie("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_subscr_id", $_COOKIE["s2member_subscr_id"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
setcookie("s2member_custom", $_COOKIE["s2member_custom"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_custom", $_COOKIE["s2member_custom"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
setcookie("s2member_item_number", $_COOKIE["s2member_item_number"], time() + 31556926, COOKIEPATH, COOKIE_DOMAIN) . setcookie("s2member_item_number", $_COOKIE["s2member_item_number"], time() + 31556926, SITECOOKIEPATH, COOKIE_DOMAIN);
/**/
do_action("ws_plugin__s2member_during_register", get_defined_vars());
/**/
if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && is_main_site() && ($location = c_ws_plugin__s2member_utils_urls::wp_signup_url())) {
echo '<script type="text/javascript">' . "\n";
echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($location) . "';";
echo '</script>' . "\n";
} else {
if ($location = c_ws_plugin__s2member_utils_urls::wp_register_url()) {
echo '<script type="text/javascript">' . "\n";
echo "window.location = '" . c_ws_plugin__s2member_utils_strings::esc_js_sq($location) . "';";
echo '</script>' . "\n";
}
}
exit;
/* Clean exit. The browser will now be redirected to ``$location``. */
} else {
status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
}
} else {
status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
}
} else {
status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
}
} else {
status_header(503) . header("Content-Type: text/html; charset=utf-8") . exit($msg_503);
}
}
/**/
do_action("ws_plugin__s2member_after_register", get_defined_vars());
}
示例5: return_template
/**
* Handles Return templates w/ response message.
*
* @package s2Member\Return_Templates
* @since 110720
*
* @param string $template Optional A Subscr. Gateway code should be used as the template name, or `default` is a multipurpose template. Defaults to `default`. Used in template selection.
* @param string $response Optional. Response message to fill template with, using the Replacement Code `%%response%%` inside the template file. Defaults to: `Thank you. Please click the link below.`.
* @param string $continue_html Optional. The HTML value of the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: `Continue`.
* @param string $continue_link Optional. The HREF value for the continuation link presented within the template using Replacement Code `%%continue%%`. Defaults to: ``home_url ('/', 'http')``.
*
* @return string The full HTML code of the template. All Replacement Codes inside the template file will have already been filled by this routine.
*/
public static function return_template($template = '', $response = '', $continue_html = '', $continue_link = '')
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_before_return_template', get_defined_vars());
unset($__refs, $__v);
// Housekeeping.
$template = $template ? $template : 'default';
$continue_link = $continue_link ? $continue_link : home_url('/', 'http');
$continue_html = $continue_html ? $continue_html : _x('Continue', 's2member-front', 's2member');
$response = $response ? $response : _x('Thank you. Please click the link below.', 's2member-front', 's2member');
$custom_template = is_file(TEMPLATEPATH . '/' . $template . '-return.php') ? TEMPLATEPATH . '/' . $template . '-return.php' : '';
$custom_template = is_file(get_stylesheet_directory() . '/' . $template . '-return.php') ? get_stylesheet_directory() . '/' . $template . '-return.php' : $custom_template;
$custom_template = is_file(WP_CONTENT_DIR . '/' . $template . '-return.php') ? WP_CONTENT_DIR . '/' . $template . '-return.php' : $custom_template;
$custom_template = !$custom_template && is_file(TEMPLATEPATH . '/default-return.php') ? TEMPLATEPATH . '/default-return.php' : $custom_template;
$custom_template = !$custom_template && is_file(get_stylesheet_directory() . '/default-return.php') ? get_stylesheet_directory() . '/default-return.php' : $custom_template;
$custom_template = !$custom_template && is_file(WP_CONTENT_DIR . '/default-return.php') ? WP_CONTENT_DIR . '/default-return.php' : $custom_template;
$specific_template = $custom_template ? $custom_template : (is_file($_default_specific_template = dirname(dirname(__FILE__)) . '/templates/returns/' . $template . '-return.php') ? $_default_specific_template : '');
$code = trim(file_get_contents($specific_template ? $specific_template : ($_default_template = dirname(dirname(__FILE__)) . '/templates/returns/default-return.php')));
$code = trim(!$custom_template || !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code);
$doctype_html_head = c_ws_plugin__s2member_utils_html::doctype_html_head(get_bloginfo('name'), 'ws_plugin__s2member_during_return_template_head_' . ($specific_template ? basename($specific_template) : 'default-return.php'));
$code = preg_replace('/%%doctype_html_head%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_doctype_html_head', $doctype_html_head, get_defined_vars())), $code);
$code = preg_replace('/%%header%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_header', sprintf(_x('[ %s ] <strong><em>says…</em></strong>', 's2member-front', 's2member'), esc_html($_SERVER['HTTP_HOST'])), get_defined_vars())), $code);
$code = preg_replace('/%%response%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_response', $response, get_defined_vars())), $code);
$code = preg_replace('/%%continue%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_continue', '<a href="' . esc_attr($continue_link) . '">' . $continue_html . '</a>', get_defined_vars())), $code);
$code = preg_replace('/%%support%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_support', sprintf(_x('If you need assistance, please <a href="%s" target="_blank">contact support</a>.', 's2member-front', 's2member'), esc_attr($GLOBALS['WS_PLUGIN__']['s2member']['o']['reg_email_support_link'])), get_defined_vars())), $code);
$code = preg_replace('/%%tracking%%/i', c_ws_plugin__s2member_utils_strings::esc_refs(apply_filters('ws_plugin__s2member_return_template_tracking', c_ws_plugin__s2member_tracking_codes::generate_all_tracking_codes(), get_defined_vars())), $code);
return apply_filters('ws_plugin__s2member_return_template', $code, get_defined_vars());
}
示例6: __construct
public function __construct()
{
if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
echo '<div class="ws-menu-page-group" title="Pro API For Remote Operations">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-remote-operations-section">' . "\n";
echo '<h3>Pro API For Remote Operations (PHP scripting required)</h3>' . "\n";
echo '<p>With s2Member Pro installed, you have access to the s2Member Pro API For Remote Operations. This is made available for developers that wish to create User/Member accounts dynamically through custom scripts of their own. s2Member\'s Remote Operations API requires a secret API Key in order to POST authenticated requests to your installation of s2Member.</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h4>Remote Operations API: <strong>Your secret API Key</strong></h4>' . "\n";
echo '<input type="text" autocomplete="off" value="' . format_to_edit(c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen()) . '" style="width:99%;" />' . "\n";
echo '<p><em><strong class="ws-menu-page-hilite">Experimental:</strong> The Remote Operations API is currently in an experimental state. The Operations that are currently possible include: <code>auth_check_user</code>, <code>get_user</code>, <code>create_user</code>, <code>modify_user</code>, <code>delete_user</code>. In a future release of s2Member Pro, we will add further documentation and some additional Remote Operations to this API. Thanks for your patience.</em></p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h4>Remote Operation: <code>auth_check_user</code> (authenticate existing Users/Members)</h4>' . "\n";
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-auth-check-user.x-php"))))) . '</p>' . "\n";
echo '<h4>Remote Operation: <code>get_user</code> (retrieve data about existing Users/Members)</h4>' . "\n";
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-get-user.x-php"))))) . '</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h4>Remote Operation: <code>create_user</code> (or update existing Users/Members)</h4>' . "\n";
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-create-user.x-php"))))) . '</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h4>Remote Operation: <code>modify_user</code> (updates existing Users/Members)</h4>' . "\n";
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-modify-user.x-php"))))) . '</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<h4>Remote Operation: <code>delete_user</code> (deletes existing Users/Members)</h4>' . "\n";
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-delete-user.x-php"))))) . '</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex -› API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.</p>' . "\n";
echo '</div>' . "\n";
echo '</div>' . "\n";
}
}
示例7: return_template_header
/**
* Applies custom Return Template Headers.
*
* @package s2Member\Return_Templates
* @since 110720
*
* @attaches-to ``add_filter("ws_plugin__s2member_return_template_header");``
*
* @param str $default_header The default header *(i.e. HTML code)*, passed through by the Filter.
* @param array $vars An array of defined variables, passed through by the Filter.
* @return str A custom Return Template Header, if configured, else the ``$default_header``.
*/
public static function return_template_header($default_header = FALSE, $vars = FALSE)
{
if (!empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $vars["template"] . "_return_template_header"])) {
$code = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $vars["template"] . "_return_template_header"];
$code = !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code;
return $custom_header = $code;
}
return $default_header;
}
示例8: __construct
public function __construct()
{
if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<p><strong>Unlimited Membership Levels (via <code>/wp-config.php</code>)</strong><br />' . "\n";
echo 'With s2Member Pro installed, you may configure an unlimited number of Membership Levels. You can set the number of Membership Levels by adding this line to the top of your <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank" rel="external">/wp-config.php</a> file: <code><span style="color:#000000"><span style="color:#0000BB">define</span><span style="color:#007700">(</span><span style="color:#DD0000">"MEMBERSHIP_LEVELS"</span><span style="color:#007700">, </span><span style="color:#0000BB">4</span><span style="color:#007700">);</span></span></code>. This line should be inserted at the top of your <code>/wp-config.php</code> file, right after the <code><?php</code> tag. Feel free to change the default value of <code>4</code> to whatever you need. The minimum allowed value is <code>' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["min_levels"]) . '</code>. The recommended maximum is <code>' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["max_levels"]) . '</code> <em>(when/if needed)</em>. If you intend to exceed the recommended maximum, you will also need to add a <a href="http://www.s2member.com/kb/hacking-s2member/" target="_blank" rel="external">WordPress Filter</a> like this: <code>add_filter("ws_plugin__s2member_max_levels", function(){ return PHP_INT_MAX; });</code></p>' . "\n";
echo '<div class="ws-menu-page-hr" style="margin-bottom:0;"></div>' . "\n";
}
}
示例9: return_template_header
/**
* Applies custom Return Template Headers.
*
* @package s2Member\Return_Templates
* @since 110720
*
* @attaches-to ``add_filter('ws_plugin__s2member_return_template_header');``
*
* @param string $default_header The default header *(i.e., HTML code)*, passed through by the Filter.
* @param array $vars An array of defined variables, passed through by the Filter.
*
* @return string A custom Return Template Header, if configured, else the ``$default_header``.
*/
public static function return_template_header($default_header = '', $vars = array())
{
if (!empty($GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_' . $vars['template'] . '_return_template_header'])) {
$code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_' . $vars['template'] . '_return_template_header'];
$code = !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? c_ws_plugin__s2member_utilities::evl($code) : $code;
return $custom_header = $code;
}
return $default_header;
}
示例10: sc_get_details
/**
* Handles the Shortcode for: `[s2Get /]`.
*
* @package s2Member\s2Get
* @since 3.5
*
* @attaches-to ``add_shortcode('s2Get');``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
*
* @return mixed Value of the requested data, or null on failure.
*/
public static function sc_get_details($attr = array(), $content = '', $shortcode = '')
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_before_sc_get_details', get_defined_vars());
unset($__refs, $__v);
// Allow variables to be modified by reference.
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
// Force array; trim quote entities.
$attr = shortcode_atts(array('constant' => '', 'user_field' => '', 'user_option' => '', 'user_id' => ''), $attr);
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_before_sc_get_details_after_shortcode_atts', get_defined_vars());
unset($__refs, $__v);
// Allow variables to be modified by reference.
if ($attr['constant'] && defined($attr['constant'])) {
if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || preg_match('/^S2MEMBER_/i', $attr['constant'])) {
$get = constant($attr['constant']);
}
} else {
if ($attr['user_field'] && (is_user_logged_in() || $attr['user_id'])) {
$get = c_ws_plugin__s2member_utils_users::get_user_field($attr['user_field'], (int) $attr['user_id']);
} else {
if ($attr['user_option'] && (is_user_logged_in() || $attr['user_id'])) {
$get = get_user_option($attr['user_option'], (int) $attr['user_id']);
}
}
}
if (isset($get) && (is_array($get) || is_object($get))) {
$_get_array = $get;
// Temporary variable.
$get = array();
// New empty array.
foreach ($_get_array as $_key_prop => $_value) {
if (is_scalar($_value)) {
// One dimension only.
$get[$_key_prop] = (string) $_value;
}
}
unset($_get_array, $_key_prop, $_value);
// Housekeeping.
$get = implode(', ', $get);
// Convert to a string now.
}
if (isset($get) && !is_scalar($get)) {
$get = '';
} else {
if (isset($get)) {
$get = (string) $get;
}
}
// Convert to a string.
return apply_filters('ws_plugin__s2member_sc_get_details', isset($get) ? $get : '', get_defined_vars());
}
示例11: __construct
public function __construct()
{
if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
echo '<p><strong>S2MEMBER_PRO_VERSION</strong><br />This will always be a (string) with the current s2Member Pro version. Available since s2Member Pro v1.0. Dated versions began with s2Member Pro v110604.</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
} else {
echo '<p><strong>S2MEMBER_PRO_VERSION</strong><br />This will always be a (string) with the current s2Member Pro version. Available since s2Member Pro v1.0. Dated versions began with s2Member Pro v110604.</p>' . "\n";
echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(file_get_contents(dirname(__FILE__) . "/code-samples/pro-version.x-php")) . '</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
}
}
示例12: wp_footer_code
/**
* Generates footer code, when/if configured.
*
* @package s2Member\WP_Footer
* @since 110524RC
*
* @return null
*/
public static function wp_footer_code()
{
do_action('ws_plugin__s2member_before_wp_footer_code', get_defined_vars());
if ($code = $GLOBALS['WS_PLUGIN__']['s2member']['o']['wp_footer_code']) {
if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
echo do_shortcode($code) . "\n";
} else {
echo do_shortcode(c_ws_plugin__s2member_utilities::evl($code));
}
}
do_action('ws_plugin__s2member_after_wp_footer_code', get_defined_vars());
}
示例13: __construct
public function __construct()
{
echo '<h3><i class="fa fa-paypal"></i> PayPal Pro Integration (<a href="#" onclick="jQuery(\'div#ws-plugin--s2member-paypal-pro-details\').toggle(); return false;" class="ws-dotted-link">please read</a>)</h3>' . "\n";
echo '<div id="ws-plugin--s2member-paypal-pro-details" style="display:none;">' . "\n";
echo '<p><strong>PayPal Pro Integration:</strong> The s2Member Pro Add-on enables PayPal Pro-Forms. PayPal Pro-Forms are implemented with WordPress Shortcodes. Pro-Forms allow you to keep Customers on your site at all times, and it consolidates the Registration/Checkout steps into a single form that you can dress up just the way you like. If you would like to take advantage of PayPal Pro integration, please supply your PayPal Pro API Username, Password, and Signature. You will need a <a href="http://www.s2member.com/r/paypal/" target="_blank" rel="external">PayPal Payments Pro</a> account. PayPal Pro accounts require a formal application, along with a small monthly fee. Once you have a PayPal Pro account, you\'ll need access to your <a href="http://s2member.com/r/paypal-profile-api-access/" target="_blank" rel="external">PayPal API Credentials</a>. Log into your PayPal Pro account, and navigate to <strong>Profile → API Access (or → Request API Credentials)</strong>. From the available options, please choose "Request API Signature".</p>' . "\n";
echo '<p><strong>Recurring Billing:</strong> If you plan to use any of the "Subscription" options in the s2Member Pro-Form Generator for PayPal Pro, you will <em>also</em> need <a href="http://s2member.com/r/paypal-pro-recurring-payments-faqs/" target="_blank" rel="external">Recurring Billing</a> enabled for your PayPal Pro account. PayPal\'s Recurring Billing service for Pro accounts is <strong>required</strong> for all types of "Subscriptions", whether you intend for them to be recurring or not. However, it is not required for "Buy Now" functionality. The drop-down menus in s2Member Pro-Form Generators have been marked "Subscription" and "Buy Now" to help you make this distinction. See: <strong>s2Member → PayPal Pro-Forms</strong>. From that section, you can see which options will require the use of PayPal\'s Recurring Billing service. PayPal will charge you a small monthly fee for their Recurring Billing service; which is an add-on for PayPal Pro accounts.</p>' . "\n";
echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<p><strong>Secure Server:</strong> In order to comply with PayPal and PCI Compliance policies, as set forth by major credit card companies; you will need to host all of your PayPal Pro-Forms on an SSL enabled site. Please check with your hosting provider to ask about obtaining an SSL certificate for your domain. Please note; when you create PayPal Pro-Forms with s2Member; you\'ll be supplied with WordPress Shortcodes, which you\'ll insert into Posts/Pages of your choosing. These special Posts/Pages will need to be displayed in SSL mode, using links that start with (<code>https://</code>). You can skip the SSL certificate during Sandbox testing. SSL is not required until you officially go live. Once you\'re live, you can add the Custom Field <code>s2member_force_ssl = yes</code> to any Post/Page.</p>' . "\n" : '<p><strong>Secure Server:</strong> In order to comply with PayPal and PCI Compliance policies, as set forth by major credit card companies; you will need to host all of your PayPal Pro-Forms on an SSL enabled page. When you create PayPal Pro-Forms with s2Member; you\'ll be supplied with WordPress Shortcodes, which you\'ll insert into Posts/Pages of your choosing. These special Posts/Pages will need to be displayed in SSL mode, using links that start with (<code>https://</code>). You can add the Custom Field <code>s2member_force_ssl = yes</code> to any Post/Page that contains a Pro-Form Shortcode. This tells s2Member to force those special Posts/Pages to be viewed over SSL at all times; no matter what.</p>' . "\n";
echo !is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() ? '<p><strong>SSL Compatibility:</strong> Most themes available at <a href="http://www.s2member.com/r/themeforest/" target="_blank" rel="external">ThemeForest™</a> include full support for SSL, as does WordPress itself. However, there are many themes/plugins that do not support SSL enabled Posts/Pages like they should. For this reason, you should be very careful when choosing a WordPress theme to use with s2Member Pro. Otherwise, your visitors could see the infamous "Secure/Insecure" warnings in Internet Explorer browsers. With s2Member installed, you can add the Custom Field <code>s2member_force_ssl = yes</code> to any Post/Page. s2Member will buffer output on those special Posts/Pages, converting everything over to <code>https://</code> for you automatically, and forcing those specific Posts/Pages to be viewed over a secure SSL connection; so long as your server supports the https protocol.</p>' . "\n" : '';
echo '<p><strong>PayPal Pro is not Absolutely Required:</strong> s2Member is quite flexible. It is now possible to integrate Pro-Forms without a PayPal Pro account, whereby the enhanced Pro-Form Shortcodes that s2Member provides can be integrated only with PayPal Express Checkout. In other words, if you get declined for PayPal Pro service, you can still use s2Member Pro-Forms. Ask PayPal to activate Express Checkout for you (free). Once Express Checkout is enabled, you will have access to your <a href="http://s2member.com/r/paypal-profile-api-access/" target="_blank" rel="external">PayPal API Credentials</a>. Log into your PayPal account, and navigate to <strong>Profile → API Access (or → Request API Credentials)</strong>. From the available options, please choose "Request API Signature". Now, the tricky part. Whenever you generate a Pro-Form Shortcode with s2Member, be sure to change <code>accept="paypal,visa,mastercard,amex,discover,maestro,solo"</code> to just <code>accept="paypal"</code>; thereby excluding the on-site credit card processing functionality.</p>' . "\n";
echo '</div>' . "\n";
echo '<div class="ws-menu-page-hr" style="margin-bottom:0;"></div>' . "\n";
}
示例14: wp_footer_code
/**
* Generates footer code, when/if configured.
*
* @package s2Member\WP_Footer
* @since 110524RC
*
* @return null
*/
public static function wp_footer_code()
{
do_action("ws_plugin__s2member_before_wp_footer_code", get_defined_vars());
if ($code = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["wp_footer_code"]) {
if (is_multisite() && c_ws_plugin__s2member_utils_conds::is_multisite_farm() && !is_main_site()) {
echo do_shortcode($code) . "\n";
} else {
echo do_shortcode(c_ws_plugin__s2member_utilities::evl($code));
}
}
do_action("ws_plugin__s2member_after_wp_footer_code", get_defined_vars());
return;
}
示例15: __construct
public function __construct()
{
if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
echo '<div class="ws-menu-page-group" title="Pro Login Widget via PHP">' . "\n";
echo '<div class="ws-menu-page-section ws-plugin--s2member-api-login-widget-section">' . "\n";
echo '<h3>Pro Login Widget via PHP Tag (some scripting required)</h3>' . "\n";
echo '<p>With s2Member Pro installed, you have access to the s2Member Pro Login Widget. This is made available in your Dashboard under: <strong>Appearance → Widgets</strong>. Very simple to use; just drag & drop (that\'s it). For developers though, sometimes it is necessary to include the Pro Login Widget in non-widgetized sections of a WordPress theme; or even into another plugin that you run in concert with s2Member. You can use this PHP tag to build the Pro Login Widget dynamically: ' . c_ws_plugin__s2member_utils_strings::highlight_php('<?php echo s2member_pro_login_widget(); ?>') . '</p>' . "\n";
echo '<p>The Pro Login Widget can also be configured with an <em>optional</em> array of <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_pro_login_widget()" target="_blank" rel="external">configuration parameters</a>.</p>' . "\n";
echo '<div class="ws-menu-page-hr"></div>' . "\n";
echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex → API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex → API Functions</a>.</p>' . "\n";
echo '</div>' . "\n";
echo '</div>' . "\n";
}
}