本文整理汇总了PHP中c_ws_plugin__s2member_utils_urls::n_amps方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_urls::n_amps方法的具体用法?PHP c_ws_plugin__s2member_utils_urls::n_amps怎么用?PHP c_ws_plugin__s2member_utils_urls::n_amps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类c_ws_plugin__s2member_utils_urls
的用法示例。
在下文中一共展示了c_ws_plugin__s2member_utils_urls::n_amps方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sc_google_button
/**
* Shortcode `[s2Member-Pro-Google-Button /]`.
*
* @package s2Member\Google
* @since 1.5
*
* @attaches-to ``add_shortcode("s2Member-Pro-Google-Button");``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
* @return string The resulting Google Button Code; HTML markup.
*/
public static function sc_google_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$jwt_attr = c_ws_plugin__s2member_utils_encryption::encrypt(serialize($attr));
$attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "rrt" => "", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor", "success" => "", "failure" => ""), $attr);
if ($attr["modify"] || $attr["cancel"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-edit-button.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-cancellation-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
unset($href, $url, $m);
} else {
if ($attr["sp"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-sp-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
$code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
} else {
if ($attr["level"] === "*") {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-ccaps-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
$code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
} else {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-wallet-co.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = preg_replace("/%%jwt_attr%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($jwt_attr)), $code);
$code = preg_replace(array("/%%success%%/", "/%%failure%%/"), array($attr["success"], $attr["failure"]), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
}
}
}
return $code;
}
示例2: e_amps
/**
* Encodes all types of amperands to `amp;`, for use in XHTML code.
*
* Note however, this is usually NOT necessary. Just use WordPress® ``esc_html()`` or ``esc_attr()``.
*
* @package s2Member\Utilities
* @since 111106
*
* @param str $url_uri_query A full URL, a partial URI, or just the query string.
* @return str A full URL, a partial URI, or just the query string; after having been encoded by this routine.
*/
public static function e_amps($url_uri_query = FALSE)
{
return str_replace("&", "&", c_ws_plugin__s2member_utils_urls::n_amps((string) $url_uri_query));
}
示例3: sc_paypal_button
/**
* Handles the Shortcode for: `[s2Member-PayPal-Button /]`.
*
* @package s2Member\PayPal
* @since 3.5
*
* @attaches-to ``add_shortcode("s2Member-PayPal-Button");``
*
* @param array $attr An array of Attributes.
* @param str $content Content inside the Shortcode.
* @param str $shortcode The actual Shortcode name itself.
* @return str The resulting PayPal Button Code.
*/
public static function sc_paypal_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_sc_paypal_button", get_defined_vars());
unset($__refs, $__v);
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$attr = shortcode_atts(apply_filters("ws_plugin__s2member_sc_paypal_button_default_attrs", array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "ps" => "paypal", "lc" => "", "lang" => "", "cc" => "USD", "dg" => "0", "ns" => "1", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "rrt" => "", "rra" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "button"), get_defined_vars()), $attr);
$attr["modify"] = $attr["modify"] === "1" && (!is_user_logged_in() || !get_user_option("s2member_subscr_id")) && $attr["tp"] ? "0" : $attr["modify"];
$attr["lc"] = strtoupper($attr["lc"]);
$attr["tt"] = strtoupper($attr["tt"]);
$attr["rt"] = strtoupper($attr["rt"]);
$attr["rr"] = strtoupper($attr["rr"]);
$attr["ccaps"] = strtolower($attr["ccaps"]);
$attr["ccaps"] = str_replace(" ", "", $attr["ccaps"]);
$attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"];
$attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"];
$attr["ns"] = $attr["dg"] === "1" ? "1" : $attr["ns"];
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_before_sc_paypal_button_after_shortcode_atts", get_defined_vars());
unset($__refs, $__v);
if ($attr["cancel"]) {
$default_image = "https://www.paypal.com/" . ($attr["lang"] ? $attr["lang"] : _x("en_US", "s2member-front paypal-button-lang-code", "s2member")) . "/i/btn/btn_unsubscribe_LG.gif";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-cancellation-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
$code = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $code);
$code = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
unset($href, $url, $m);
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_during_sc_paypal_cancellation_button", get_defined_vars());
unset($__refs, $__v);
} else {
if ($attr["sp"]) {
$default_image = "https://www.paypal.com/" . ($attr["lang"] ? $attr["lang"] : _x("en_US", "s2member-front paypal-button-lang-code", "s2member")) . "/i/btn/btn_xpressCheckout.gif";
$paypal_on0_input_value = ($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id()) ? "Referencing Customer ID" : "Originating Domain";
$paypal_os0_input_value = $referencing ? $referencing : $_SERVER["HTTP_HOST"];
$paypal_on1_input_value = "Customer IP Address";
$paypal_os1_input_value = $_SERVER["REMOTE_ADDR"];
$paypal_invoice_input_value = uniqid() . "~" . $_SERVER["REMOTE_ADDR"];
$attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
$success_return_url = site_url("/?s2member_paypal_return=1");
$success_return_url = apply_filters("ws_plugin__s2member_during_sc_paypal_button_success_return_url", $success_return_url, get_defined_vars());
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(__FILE__)) . "/templates/buttons/paypal-sp-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
$code = preg_replace("/%%endpoint%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] ? "www.sandbox.paypal.com" : "www.paypal.com")), $code);
$code = preg_replace("/%%paypal_business%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"])), $code);
$code = preg_replace("/%%cancel_return%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(home_url("/"))), $code);
$code = preg_replace("/%%notify_url%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url("/?s2member_paypal_notify=1"))), $code);
$code = preg_replace("/%%return%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($success_return_url)), $code);
$code = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["custom"])), $code);
$code = preg_replace('/ name\\="lc" value\\="(.*?)"/', ' name="lc" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["lc"])) . '"', $code);
$code = preg_replace('/ name\\="no_shipping" value\\="(.*?)"/', ' name="no_shipping" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["ns"])) . '"', $code);
$code = preg_replace('/ name\\="item_name" value\\="(.*?)"/', ' name="item_name" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["desc"])) . '"', $code);
$code = preg_replace('/ name\\="item_number" value\\="(.*?)"/', ' name="item_number" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["sp_ids_exp"])) . '"', $code);
$code = preg_replace('/ name\\="page_style" value\\="(.*?)"/', ' name="page_style" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["ps"])) . '"', $code);
$code = preg_replace('/ name\\="currency_code" value\\="(.*?)"/', ' name="currency_code" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["cc"])) . '"', $code);
$code = preg_replace('/ name\\="custom" value\\="(.*?)"/', ' name="custom" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["custom"])) . '"', $code);
$code = preg_replace('/ name\\="invoice" value\\="(.*?)"/', ' name="invoice" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($paypal_invoice_input_value)) . '"', $code);
$code = preg_replace('/ name\\="on0" value\\="(.*?)"/', ' name="on0" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($paypal_on0_input_value)) . '"', $code);
$code = preg_replace('/ name\\="os0" value\\="(.*?)"/', ' name="os0" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($paypal_os0_input_value)) . '"', $code);
$code = preg_replace('/ name\\="on1" value\\="(.*?)"/', ' name="on1" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($paypal_on1_input_value)) . '"', $code);
$code = preg_replace('/ name\\="os1" value\\="(.*?)"/', ' name="os1" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($paypal_os1_input_value)) . '"', $code);
$code = preg_replace('/ name\\="amount" value\\="(.*?)"/', ' name="amount" value="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["ra"])) . '"', $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? '<a href="' . esc_attr(c_ws_plugin__s2member_utils_forms::form_whips_2_url($code)) . '"><img src="' . esc_attr($attr["image"] && $attr["image"] !== "default" ? $attr["image"] : $default_image) . '" style="width:auto; height:auto; border:0;" alt="PayPal" /></a>' : $code;
$code = $attr["output"] === "url" ? c_ws_plugin__s2member_utils_forms::form_whips_2_url($code) : $code;
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_during_sc_paypal_sp_button", get_defined_vars());
unset($__refs, $__v);
} else {
if ($attr["level"] === "*") {
$default_image = "https://www.paypal.com/" . ($attr["lang"] ? $attr["lang"] : _x("en_US", "s2member-front paypal-button-lang-code", "s2member")) . "/i/btn/btn_xpressCheckout.gif";
//.........这里部分代码省略.........
示例4: sc_authnet_form
/**
* Shortcode `[s2Member-Pro-AuthNet-Form /]`.
*
* @package s2Member\AuthNet
* @since 1.5
*
* @attaches-to ``add_shortcode("s2Member-Pro-AuthNet-Form");``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
* @return string The resulting Form Code, HTML markup.
*/
public static function sc_authnet_form($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_pro_before_sc_authnet_form", get_defined_vars());
unset($__refs, $__v);
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$options = array();
// Initialize options to an empty array.
$option_selections = '';
// Initialize w/ no options.
if ($content && ($content = strip_tags($content))) {
// This allows for nested Pro-Form Shortcodes as options.
$content = str_replace('s2Member-Pro-AuthNet-Form ', 's2Member-Pro-AuthNet-xFormOption ', $content);
}
if ($content && ($content_options = do_shortcode($content))) {
foreach (preg_split('/\\s*\\|\\:\\:\\|\\s*/', $content_options, NULL, PREG_SPLIT_NO_EMPTY) as $_content_option_key => $_content_option) {
$_content_option_id = $_content_option_key + 1;
$options[$_content_option_id] = maybe_unserialize(trim($_content_option));
if (!is_array($options[$_content_option_id])) {
unset($options[$_content_option_id]);
continue;
}
if (!empty($_REQUEST['s2p-option']) && (int) $_REQUEST['s2p-option'] === $_content_option_id) {
$options[$_content_option_id]['selected'] = TRUE;
}
}
unset($_content_option_key, $_content_option, $_content_option_id);
// Housekeeping.
foreach ($options as $_option_id => $_option) {
if (!empty($_option['selected'])) {
$attr = array_merge($attr, $_option);
$_selected_option_id = $_option_id;
}
}
unset($_option_id, $_option);
// Housekeeping.
if (empty($_selected_option_id)) {
foreach ($options as $_option_id => $_option) {
$attr = array_merge($attr, $_option);
break;
}
}
// Force a selected option (default).
unset($_option_id, $_option, $_selected_option_id);
// Housekeeping.
foreach ($options as $_option_id => $_option) {
// Build option selections.
$option_selections .= '<option value="' . esc_attr($_option_id) . '"' . (!empty($_option['selected']) ? ' selected="selected"' : '') . '>' . esc_html($_option['desc']) . '</option>';
}
unset($_option_id, $_option);
// Housekeeping.
}
$attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => @$attr["register"] ? "0" : "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "rrt" => "", "modify" => "0", "cancel" => "0", "unsub" => "0", "sp" => "0", "register" => "0", "update" => "0", "accept" => "visa,mastercard,amex,discover", "coupon" => "", "accept_coupons" => "0", "default_country_code" => "US", "captcha" => "", "template" => "", "success" => ""), $attr);
$attr["tt"] = strtoupper($attr["tt"]);
$attr["rt"] = strtoupper($attr["rt"]);
$attr["rr"] = strtoupper($attr["rr"]);
$attr["ccaps"] = strtolower($attr["ccaps"]);
$attr["ccaps"] = str_replace(" ", "", $attr["ccaps"]);
$attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"];
$attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"];
$attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"];
$attr["default_country_code"] = strtoupper($attr["default_country_code"]);
$attr["success"] = c_ws_plugin__s2member_utils_urls::n_amps($attr["success"]);
$attr["accept"] = trim($attr["accept"]) ? preg_split("/[;,]+/", preg_replace("/[\r\n\t\\s]+/", "", strtolower($attr["accept"]))) : array();
$attr["accept"] = empty($attr["accept"]) ? array_merge($attr["accept"], array("visa")) : $attr["accept"];
$attr["coupon"] = !empty($_GET["s2p-coupon"]) ? trim(strip_tags(stripslashes($_GET["s2p-coupon"]))) : $attr["coupon"];
$attr["singular"] = get_the_ID();
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action("ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts", get_defined_vars());
unset($__refs, $__v);
if ($attr["cancel"]) {
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST));
/*
Obtain a possible response and/or validation error.
*/
$response = c_ws_plugin__s2member_pro_authnet_responses::authnet_cancellation_response($attr);
/*
Empty post vars on successful response.
*/
$_p = $response["response"] && !$response["error"] ? array() : $_p;
/*
Build the reCaptcha box via JavaScript.
//.........这里部分代码省略.........
示例5: sc_ccbill_button
/**
* Shortcode `[s2Member-Pro-ccBill-Button /]`.
*
* @package s2Member\ccBill
* @since 1.5
*
* @attaches-to ``add_shortcode("s2Member-Pro-ccBill-Button");``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
* @return string The resulting ccBill Button Code, HTML markup.
*/
public static function sc_ccbill_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "2.95", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "sub_account" => "", "form" => "", "output" => "anchor"), $attr);
$attr["tt"] = strtoupper($attr["tt"]);
$attr["rt"] = strtoupper($attr["rt"]);
$attr["ccaps"] = strtolower($attr["ccaps"]);
$attr["ccaps"] = str_replace(" ", "", $attr["ccaps"]);
$attr["rr"] = $attr["rt"] === "L" ? "0" : $attr["rr"];
$attr["rr"] = $attr["level"] === "*" ? "0" : $attr["rr"];
if ($attr["rr"] && ($attr["ta"] <= 0 || $attr["tp"] <= 0 || !$attr["tt"])) {
eval('$attr["ta"] = $attr["ra"]; $attr["tp"] = $attr["rp"]; $attr["tt"] = $attr["rt"];');
}
if ($attr["modify"] || $attr["cancel"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/ccbill-edit-button.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-cancellation-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
unset($href, $url, $m);
} else {
if ($attr["sp"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/ccbill-button.png";
$attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-sp-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => round($attr["exp"] / 24), "currencyCode" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_desc" => $attr["desc"], "s2_invoice" => $attr["sp_ids_exp"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
if ($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id()) {
$vars["s2_referencing"] = $referencing;
}
$code = preg_replace("/%%url%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($url = c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_link_gen($vars))), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
$code = $attr["output"] === "url" ? $url : $code;
unset($href, $url, $m);
} else {
if ($attr["level"] === "*") {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/ccbill-button.png";
$attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
$attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-ccaps-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
$vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "currencyCode" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
if ($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id()) {
$vars["s2_referencing"] = $referencing;
}
$code = preg_replace("/%%url%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($url = c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_link_gen($vars))), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
$code = $attr["output"] === "url" ? $url : $code;
unset($href, $url, $m);
} else {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/ccbill-button.png";
$attr["desc"] = !$attr["desc"] ? $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $attr["level"] . "_label"] : $attr["desc"];
$attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
$attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/ccbill-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr(home_url())), $code);
if (!$attr["rr"]) {
$vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ra"], "formPeriod" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "currencyCode" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_p1" => "0 D", "s2_p3" => $attr["rp"] . " " . $attr["rt"], "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
} else {
// Otherwise, we need to include both an Initial and Regular/Recurring period. This will ALWAYS recur.
$vars = array("clientAccnum" => $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_id"], "clientSubacc" => $attr["sub_account"] ? $attr["sub_account"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_client_sid"], "formName" => $attr["form"] ? $attr["form"] : $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_ccbill_form_name"], "formPrice" => $attr["ta"], "formPeriod" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_per_term_2_days($attr["tp"], $attr["tt"]), "formRecurringPrice" => $attr["ra"], "formRecurringPeriod" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_per_term_2_days($attr["rp"], $attr["rt"]), "formRebills" => "99", "currencyCode" => c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_currency_numr($attr["cc"]), "s2_p1" => $attr["tp"] . " " . $attr["tt"], "s2_p3" => $attr["rp"] . " " . $attr["rt"], "s2_desc" => $attr["desc"], "s2_invoice" => $attr["level_ccaps_eotper"], "s2_custom" => $attr["custom"], "s2_customer_ip" => $_SERVER["REMOTE_ADDR"]);
}
if ($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id()) {
$vars["s2_referencing"] = $referencing;
}
$code = preg_replace("/%%url%%/", c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($url = c_ws_plugin__s2member_pro_ccbill_utilities::ccbill_link_gen($vars))), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_refs(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
$code = $attr["output"] === "url" ? $url : $code;
unset($href, $url, $m);
}
}
}
return $code;
}
示例6: sc_clickbank_button
/**
* Shortcode `[s2Member-Pro-ClickBank-Button /]`.
*
* @package s2Member\ClickBank
* @since 1.5
*
* @attaches-to ``add_shortcode("s2Member-Pro-ClickBank-Button");``
*
* @param array $attr An array of Attributes.
* @param str $content Content inside the Shortcode.
* @param str $shortcode The actual Shortcode name itself.
* @return str The resulting ClickBank Button Code, HTML markup.
*/
public static function sc_clickbank_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$attr = shortcode_atts(array("cbp" => "0", "cbskin" => "", "cbfid" => "", "cbur" => "", "cbf" => "auto", "ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "custom" => $_SERVER["HTTP_HOST"], "tp" => "0", "tt" => "D", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor"), $attr);
$attr["tt"] = strtoupper($attr["tt"]);
$attr["rt"] = strtoupper($attr["rt"]);
$attr["ccaps"] = strtolower($attr["ccaps"]);
$attr["ccaps"] = str_replace(" ", "", $attr["ccaps"]);
$attr["rr"] = $attr["rt"] === "L" ? "0" : $attr["rr"];
$attr["rr"] = $attr["level"] === "*" ? "0" : $attr["rr"];
$attr["desc"] = str_replace("+", "plus", $attr["desc"]);
// Workaround for a known bug @ ClickBank.
// ClickBank will NOT properly parse `+` signs in URLs leading to (and returning from) ClickBank checkout forms.
if ($attr["cbur"] && $attr["cbf"] === "auto" && !empty($_REQUEST["cbf"])) {
$attr["cbf"] = esc_html((string) $_REQUEST["cbf"]);
} else {
if (!$attr["cbur"] || $attr["cbf"] === "auto") {
$attr["cbf"] = "";
}
}
if ($attr["modify"] || $attr["cancel"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/clickbank-edit-button.png";
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-cancellation-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
unset($href, $url, $m);
} else {
if ($attr["sp"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/clickbank-button.png";
$attr["sp_ids_exp"] = "sp:" . $attr["ids"] . ":" . $attr["exp"];
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-sp-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
$code = preg_replace("/%%item%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code);
$code = preg_replace("/%%vendor%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_username"])), $code);
$code = preg_replace("/%%invoice%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["sp_ids_exp"])), $code);
$code = preg_replace("/%%desc%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["desc"])), $code);
$code = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["custom"])), $code);
$code = preg_replace("/%%cbskin%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code);
$code = preg_replace("/%%cbfid%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code);
$code = preg_replace("/%%cbur%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbur"])), $code);
$code = preg_replace("/%%cbf%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbf"])), $code);
$code = str_replace(array("&cbskin=&", "&cbfid=&", "&cbur=&", "&cbf=&"), "&", $code);
$code = preg_replace("/\\<\\?php echo S2MEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code);
$code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__s2member_utils_strings::esc_ds("&s2_referencing=" . urlencode($referencing)) : "", $code);
if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__s2member_utils_urls::n_amps($m[1]))) {
$code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(c_ws_plugin__s2member_utils_urls::add_s2member_sig($url))) . '"', $code);
}
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
unset($href, $url, $m);
} else {
if ($attr["level"] === "*") {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/clickbank-button.png";
$attr["level_ccaps_eotper"] = !$attr["rr"] && $attr["rt"] !== "L" ? $attr["level"] . ":" . $attr["ccaps"] . ":" . $attr["rp"] . " " . $attr["rt"] : $attr["level"] . ":" . $attr["ccaps"];
$attr["level_ccaps_eotper"] = rtrim($attr["level_ccaps_eotper"], ":");
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/clickbank-ccaps-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
$code = preg_replace("/%%item%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["cbp"])), $code);
$code = preg_replace("/%%vendor%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_clickbank_username"])), $code);
$code = preg_replace("/%%invoice%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["level_ccaps_eotper"])), $code);
$code = preg_replace("/%%desc%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["desc"])), $code);
$code = preg_replace("/%%custom%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["custom"])), $code);
$code = preg_replace("/%%cbskin%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbskin"])), $code);
$code = preg_replace("/%%cbfid%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbfid"])), $code);
$code = preg_replace("/%%cbur%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbur"])), $code);
$code = preg_replace("/%%cbf%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($attr["cbf"])), $code);
$code = str_replace(array("&cbskin=&", "&cbfid=&", "&cbur=&", "&cbf=&"), "&", $code);
$code = !$attr["rr"] ? preg_replace("/&s2_subscr_id\\=s2-\\<\\?php echo uniqid\\(\\); \\?\\>/", "", $code) : preg_replace("/\\<\\?php echo uniqid\\(\\); \\?\\>/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode(uniqid())), $code);
$code = preg_replace("/\\<\\?php echo S2MEMBER_CURRENT_USER_IP; \\?\\>/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($_SERVER["REMOTE_ADDR"])), $code);
$code = preg_replace("/%%referencing%%/", ($referencing = c_ws_plugin__s2member_utils_users::get_user_subscr_or_wp_id()) ? c_ws_plugin__s2member_utils_strings::esc_ds("&s2_referencing=" . urlencode($referencing)) : "", $code);
if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__s2member_utils_urls::n_amps($m[1]))) {
$code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(c_ws_plugin__s2member_utils_urls::add_s2member_sig($url))) . '"', $code);
}
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
//.........这里部分代码省略.........
示例7: sc_stripe_form
/**
* Shortcode `[s2Member-Pro-Stripe-Form /]`.
*
* @package s2Member\Stripe
* @since 140617
*
* @attaches-to ``add_shortcode('s2Member-Pro-Stripe-Form');``
*
* @param array $attr An array of Attributes.
* @param string $content Content inside the Shortcode.
* @param string $shortcode The actual Shortcode name itself.
*
* @return string The resulting Form Code, HTML markup.
*/
public static function sc_stripe_form($attr, $content = '', $shortcode = '')
{
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
}
do_action('ws_plugin__s2member_pro_before_sc_stripe_form', get_defined_vars());
unset($__refs, $__v);
// Ditch these temporary vars.
c_ws_plugin__s2member_no_cache::no_cache_constants(TRUE);
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
$options = array();
// Initialize options to an empty array.
$option_selections = '';
// Initialize w/ no options.
if ($content && ($content = strip_tags($content))) {
// This allows for nested Pro-Form Shortcodes as options.
$content = str_replace('s2Member-Pro-Stripe-Form ', 's2Member-Pro-Stripe-xFormOption ', $content);
}
if ($content && ($content_options = do_shortcode($content))) {
foreach (preg_split('/\\s*\\|\\:\\:\\|\\s*/', $content_options, NULL, PREG_SPLIT_NO_EMPTY) as $_content_option_key => $_content_option) {
$_content_option_id = $_content_option_key + 1;
$options[$_content_option_id] = maybe_unserialize(trim($_content_option));
if (!is_array($options[$_content_option_id])) {
unset($options[$_content_option_id]);
continue;
// Invalid option.
}
if (!empty($_REQUEST['s2p-option']) && (int) $_REQUEST['s2p-option'] === $_content_option_id) {
$options[$_content_option_id]['selected'] = TRUE;
}
}
unset($_content_option_key, $_content_option, $_content_option_id);
// Housekeeping.
foreach ($options as $_option_id => $_option) {
if (!empty($_option['selected'])) {
$attr = array_merge($attr, $_option);
$_selected_option_id = $_option_id;
}
}
unset($_option_id, $_option);
// Housekeeping.
if (empty($_selected_option_id)) {
foreach ($options as $_option_id => $_option) {
$attr = array_merge($attr, $_option);
break;
// Force a selected option (default).
}
}
unset($_option_id, $_option, $_selected_option_id);
// Housekeeping.
foreach ($options as $_option_id => $_option) {
// Build option selections.
$option_selections .= '<option value="' . esc_attr($_option_id) . '"' . (!empty($_option['selected']) ? ' selected="selected"' : '') . '>' . esc_html($_option['desc']) . '</option>';
}
unset($_option_id, $_option);
// Housekeeping.
}
$attr = shortcode_atts(array('ids' => '0', 'exp' => '72', 'level' => @$attr['register'] ? '0' : '1', 'ccaps' => '', 'desc' => '', 'cc' => 'USD', 'custom' => $_SERVER['HTTP_HOST'], 'ta' => '0', 'tp' => '0', 'tt' => 'D', 'ra' => '0.50', 'rp' => '1', 'rt' => 'M', 'rr' => '1', 'rrt' => '', 'modify' => '0', 'cancel' => '0', 'unsub' => '0', 'sp' => '0', 'register' => '0', 'update' => '0', 'accept' => $GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_stripe_api_accept_bitcoin'] ? 'bitcoin' : '', 'coupon' => '', 'accept_coupons' => '0', 'default_country_code' => 'US', 'captcha' => '', 'template' => '', 'success' => ''), $attr);
$attr['tt'] = strtoupper($attr['tt']);
// Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts().
$attr['rt'] = strtoupper($attr['rt']);
// Term lengths absolutely must be provided in upper-case format. Only after running shortcode_atts().
$attr['rr'] = strtoupper($attr['rr']);
// Must be provided in upper-case format. Numerical, or BN value. Only after running shortcode_atts().
$attr['cc'] = strtoupper($attr['cc']);
// Must be provided in upper-case format. Only after running shortcode_atts().
$attr['ccaps'] = strtolower($attr['ccaps']);
// Custom Capabilities must be typed in lower-case format. Only after running shortcode_atts().
$attr['ccaps'] = str_replace(' ', '', $attr['ccaps']);
// Custom Capabilities should not have spaces.
$attr['rr'] = $attr['rt'] === 'L' ? 'BN' : $attr['rr'];
// Lifetime Subscriptions require Buy Now. Only after running shortcode_atts().
$attr['rr'] = $attr['level'] === '*' ? 'BN' : $attr['rr'];
// Independent Ccaps require Buy Now. Only after running shortcode_atts().
$attr['rr'] = !$attr['tp'] && !$attr['rr'] ? 'BN' : $attr['rr'];
// No Trial / non-recurring. Only after running shortcode_atts().
$attr['default_country_code'] = strtoupper($attr['default_country_code']);
// This MUST be in uppercase format.
$attr['success'] = c_ws_plugin__s2member_utils_urls::n_amps($attr['success']);
// Normalize ampersands.
$attr['coupon'] = !empty($_GET['s2p-coupon']) ? trim(strip_tags(stripslashes($_GET['s2p-coupon']))) : $attr['coupon'];
$attr['singular'] = get_the_ID();
// Collect the Singular ID for this Post/Page.
$attr['accept'] = trim($attr['accept']) ? preg_split('/[;,]+/', preg_replace('/[' . "\r\n\t" . '\\s]+/', '', trim(strtolower($attr['accept'])))) : array();
foreach (array_keys(get_defined_vars()) as $__v) {
$__refs[$__v] =& ${$__v};
//.........这里部分代码省略.........
示例8: sc_authnet_form
/**
* Shortcode `[s2Member-Pro-AuthNet-Form /]`.
*
* @package s2Member\AuthNet
* @since 1.5
*
* @attaches-to ``add_shortcode("s2Member-Pro-AuthNet-Form");``
*
* @param array $attr An array of Attributes.
* @param str $content Content inside the Shortcode.
* @param str $shortcode The actual Shortcode name itself.
* @return str The resulting Form Code, HTML markup.
*/
public static function sc_authnet_form($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_pro_before_sc_authnet_form", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
/**/
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
/**/
$attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => $attr["register"] ? "0" : "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "register" => "0", "update" => "0", "accept" => "visa,mastercard,amex,discover", "coupon" => "", "accept_coupons" => "0", "default_country_code" => "US", "captcha" => "", "template" => "", "success" => ""), $attr);
/**/
$attr["tt"] = strtoupper($attr["tt"]);
$attr["rt"] = strtoupper($attr["rt"]);
$attr["rr"] = strtoupper($attr["rr"]);
$attr["ccaps"] = strtolower($attr["ccaps"]);
$attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"];
$attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"];
$attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"];
$attr["cc"] = "USD";
$attr["default_country_code"] = strtoupper($attr["default_country_code"]);
$attr["success"] = c_ws_plugin__s2member_utils_urls::n_amps($attr["success"]);
/**/
$attr["accept"] = trim($attr["accept"]) ? preg_split("/[;,]+/", preg_replace("/[\r\n\t\\s]+/", "", strtolower($attr["accept"]))) : array();
$attr["accept"] = empty($attr["accept"]) ? array_merge($attr["accept"], array("visa")) : $attr["accept"];
/**/
$attr["coupon"] = $_GET["s2p-coupon"] ? trim(strip_tags(stripslashes($_GET["s2p-coupon"]))) : $attr["coupon"];
/**/
$attr["singular"] = get_the_ID();
/**/
eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
do_action("ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts", get_defined_vars());
unset($__refs, $__v);
/* Unset defined __refs, __v. */
/**/
if ($attr["cancel"]) {
$_p = c_ws_plugin__s2member_utils_strings::trim_deep(stripslashes_deep($_POST));
/*
Obtain a possible response and/or validation error.
*/
$response = c_ws_plugin__s2member_pro_authnet_responses::authnet_cancellation_response($attr);
/*
Empty post vars on successful response.
*/
$_p = $response["response"] && !$response["error"] ? array() : $_p;
/*
Build the reCaptcha box via JavaScript.
*/
if ($attr["captcha"]) {
$captcha = '<div id="s2member-pro-authnet-cancellation-form-captcha-section" class="s2member-pro-authnet-form-section s2member-pro-authnet-cancellation-form-section s2member-pro-authnet-form-captcha-section s2member-pro-authnet-cancellation-form-captcha-section">' . "\n";
/**/
$captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-section-title" class="s2member-pro-authnet-form-section-title s2member-pro-authnet-cancellation-form-section-title s2member-pro-authnet-form-captcha-section-title s2member-pro-authnet-cancellation-form-captcha-section-title">' . "\n";
$captcha .= _x("Security Code", "s2member-front", "s2member") . "\n";
$captcha .= '</div>' . "\n";
/**/
$captcha .= '<div id="s2member-pro-authnet-cancellation-form-captcha-div" class="s2member-pro-authnet-form-div s2member-pro-authnet-cancellation-form-div s2member-pro-authnet-form-captcha-div s2member-pro-authnet-cancellation-form-captcha-div">' . "\n";
/**/
$captcha .= '<label id="s2member-pro-authnet-cancellation-form-captcha-label" class="s2member-pro-authnet-form-captcha-label s2member-pro-authnet-cancellation-form-captcha-label">' . "\n";
$captcha .= c_ws_plugin__s2member_utils_captchas::recaptcha_script_tag($attr["captcha"], 10) . "\n";
$captcha .= '</label>' . "\n";
/**/
$captcha .= '</div>' . "\n";
/**/
$captcha .= '</div>' . "\n";
}
/*
Build the hidden input variables.
*/
$hidden_inputs = '<input type="hidden" name="s2member_pro_authnet_cancellation[nonce]" id="s2member-pro-authnet-cancellation-nonce" value="' . esc_attr(wp_create_nonce("s2member-pro-authnet-cancellation")) . '" />';
$hidden_inputs .= '<input type="hidden" name="s2member_pro_authnet_cancellation[attr]" id="s2member-pro-authnet-cancellation-attr" value="' . esc_attr(c_ws_plugin__s2member_utils_encryption::encrypt(serialize($attr))) . '" />';
/*
Get the form template.
*/
$custom_template = file_exists(TEMPLATEPATH . "/authnet-cancellation-form.php") ? TEMPLATEPATH . "/authnet-cancellation-form.php" : false;
$custom_template = file_exists(TEMPLATEPATH . "/authnet-cancellation-form.html") ? TEMPLATEPATH . "/authnet-cancellation-form.html" : $custom_template;
$custom_template = $attr["template"] && file_exists(TEMPLATEPATH . "/" . $attr["template"]) ? TEMPLATEPATH . "/" . $attr["template"] : $custom_template;
$custom_template = $attr["template"] && file_exists(WP_CONTENT_DIR . "/" . $attr["template"]) ? WP_CONTENT_DIR . "/" . $attr["template"] : $custom_template;
/**/
$code = trim(file_get_contents($custom_template ? $custom_template : dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/forms/authnet-cancellation-form.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);
/*
Fill in the action.
*/
$code = preg_replace("/%%action%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($_SERVER["REQUEST_URI"])), $code);
/*
Fill in the response.
//.........这里部分代码省略.........
示例9: sc_google_button
/**
* Shortcode `[s2Member-Pro-Google-Button /]`.
*
* @package s2Member\Google
* @since 1.5
*
* @attaches-to ``add_shortcode("s2Member-Pro-Google-Button");``
*
* @param array $attr An array of Attributes.
* @param str $content Content inside the Shortcode.
* @param str $shortcode The actual Shortcode name itself.
* @return str The resulting Google® Button Code, HTML markup.
*/
public static function sc_google_button($attr = FALSE, $content = FALSE, $shortcode = FALSE)
{
c_ws_plugin__s2member_no_cache::no_cache_constants(true);
/**/
$attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
/**/
$attr = shortcode_atts(array("ids" => "0", "exp" => "72", "level" => "1", "ccaps" => "", "desc" => "", "cc" => "USD", "custom" => $_SERVER["HTTP_HOST"], "ta" => "0", "tp" => "0", "tt" => "D", "ra" => "0.01", "rp" => "1", "rt" => "M", "rr" => "1", "modify" => "0", "cancel" => "0", "sp" => "0", "image" => "default", "output" => "anchor"), $attr);
/**/
$attr["tt"] = strtoupper($attr["tt"]);
$attr["rt"] = strtoupper($attr["rt"]);
$attr["rr"] = strtoupper($attr["rr"]);
$attr["ccaps"] = strtolower($attr["ccaps"]);
$attr["rr"] = $attr["rt"] === "L" ? "BN" : $attr["rr"];
$attr["rr"] = $attr["level"] === "*" ? "BN" : $attr["rr"];
$attr["rr"] = !$attr["tp"] && !$attr["rr"] ? "BN" : $attr["rr"];
/**/
if ($attr["modify"] || $attr["cancel"]) {
$default_image = $GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images/google-edit-button.png";
/**/
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-cancellation-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
/**/
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
/**/
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
/**/
unset($href, $url, $m);
} else {
if ($attr["sp"]) {
$default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_google_merchant_id"]) . "&w=180&h=46&style=trans&variant=text&loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member"));
/**/
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-sp-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
/**/
foreach ($attr as $key => $val) {
$code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($val)), $code);
}
/**/
if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__s2member_utils_urls::n_amps($m[1]))) {
$code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(c_ws_plugin__s2member_utils_urls::add_s2member_sig($url))) . '"', $code);
}
/**/
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
/**/
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
/**/
unset($href, $url, $m);
} else {
if ($attr["level"] === "*") {
$default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_google_merchant_id"]) . "&w=180&h=46&style=trans&variant=text&loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member"));
/**/
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-ccaps-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
/**/
foreach ($attr as $key => $val) {
$code = preg_replace("/%%" . preg_quote($key, "/") . "%%/", c_ws_plugin__s2member_utils_strings::esc_ds(urlencode($val)), $code);
}
/**/
if (preg_match('/ href\\="(.*?)"/', $code, $m) && ($url = c_ws_plugin__s2member_utils_urls::n_amps($m[1]))) {
$code = preg_replace('/ href\\=".*?"/', ' href="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(c_ws_plugin__s2member_utils_urls::add_s2member_sig($url))) . '"', $code);
}
/**/
$code = $_code = $attr["image"] && $attr["image"] !== "default" ? preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($attr["image"])) . '"', $code) : preg_replace('/ src\\="(.*?)"/', ' src="' . c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($default_image)) . '"', $code);
/**/
$code = $attr["output"] === "anchor" ? $code : $code;
if ($attr["output"] === "url" && preg_match('/ href\\="(.*?)"/', $code, $m) && ($href = $m[1])) {
$code = $url = c_ws_plugin__s2member_utils_urls::n_amps($href);
}
/**/
unset($href, $url, $m);
} else {
$default_image = "https://checkout.google.com/buttons/checkout.gif?merchant_id=" . urlencode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_google_merchant_id"]) . "&w=180&h=46&style=trans&variant=text&loc=" . urlencode(_x("en_US", "s2member-front google-button-lang-code", "s2member"));
/**/
$code = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents(dirname(dirname(dirname(dirname(__FILE__)))) . "/templates/buttons/google-checkout-button.php")));
$code = preg_replace("/%%images%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr($GLOBALS["WS_PLUGIN__"]["s2member_pro"]["c"]["dir_url"] . "/images")), $code);
$code = preg_replace("/%%wpurl%%/", c_ws_plugin__s2member_utils_strings::esc_ds(esc_attr(site_url())), $code);
/**/
foreach ($attr as $key => $val) {
//.........这里部分代码省略.........