当前位置: 首页>>代码示例>>PHP>>正文


PHP c_ws_plugin__s2member_utils_strings::trim方法代码示例

本文整理汇总了PHP中c_ws_plugin__s2member_utils_strings::trim方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_strings::trim方法的具体用法?PHP c_ws_plugin__s2member_utils_strings::trim怎么用?PHP c_ws_plugin__s2member_utils_strings::trim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在c_ws_plugin__s2member_utils_strings的用法示例。


在下文中一共展示了c_ws_plugin__s2member_utils_strings::trim方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: s2member_sig_ok

 /**
  * Verifies an s2Member-generated signature; in a full URL, a partial URI, or in just a query string.
  *
  * @package s2Member\Utilities
  * @since 111106
  *
  * @param str $url_uri_query A full URL, a partial URI, or just a query string. Must have an s2Member-generated signature to validate.
  * @param bool $check_time Optional. Defaults to false. If true, s2Member will also check if the signature has expired, based on ``$exp_secs``.
  * @param str|int $exp_secs Optional. Defaults to (int)10. If ``$check_time`` is true, s2Member will check if the signature has expired, based on ``$exp_secs``.
  * @param str $sig_var Optional. The name of the s2Member-generated signature variable. Defaults to `_s2member_sig`.
  * @return bool True if the s2Member-generated signature is OK, else false.
  */
 public static function s2member_sig_ok($url_uri_query = FALSE, $check_time = FALSE, $exp_secs = FALSE, $sig_var = FALSE)
 {
     $url_uri_query = $query = c_ws_plugin__s2member_utils_strings::trim((string) $url_uri_query, false, "?&=");
     if (preg_match("/^(?:[a-z]+\\:\\/\\/|\\/)/i", $url_uri_query)) {
         $query = trim(c_ws_plugin__s2member_utils_urls::parse_url($url_uri_query, PHP_URL_QUERY), "?&=");
     }
     /**/
     $check_time = $check_time ? true : false;
     $exp_secs = is_numeric($exp_secs) ? (int) $exp_secs : 10;
     $sig_var = $sig_var && is_string($sig_var) ? $sig_var : "_s2member_sig";
     /**/
     $key = c_ws_plugin__s2member_utils_encryption::key();
     /**/
     if (preg_match_all("/" . preg_quote($sig_var, "/") . "\\=([0-9]+)-([^&\$]+)/", $query, $sigs)) {
         $query = c_ws_plugin__s2member_utils_urls::remove_s2member_sigs($query, $sig_var);
         /**/
         wp_parse_str($query, $vars);
         $vars = c_ws_plugin__s2member_utils_arrays::remove_0b_strings(c_ws_plugin__s2member_utils_strings::trim_deep($vars));
         $vars = serialize(c_ws_plugin__s2member_utils_arrays::ksort_deep($vars));
         /**/
         ($time = $sigs[1][$i = count($sigs[1]) - 1]) . ($sig = $sigs[2][$i]) . ($valid_sig = md5($key . $time . $vars));
         /**/
         if ($check_time) {
             return $sig === $valid_sig && $time >= strtotime("-" . $exp_secs . " seconds");
         } else {
             /* Ignoring time? Just need to compare signatures in this case. */
             return $sig === $valid_sig;
         }
     } else {
         /* Return false. No ``$query``, or no ``$sigs``. */
         return false;
     }
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:45,代码来源:utils-urls.inc.php

示例2: custom_field_gen

 /**
  * Generates all Custom Fields.
  *
  * @package s2Member\Custom_Reg_Fields
  * @since 3.5
  *
  * @param string $_function Function calling upon this routine.
  * @param array $_field The Field array of configuration options.
  * @param string $_name_prefix The `name=""` attribute prefix.
  * @param string $_id_prefix The `id=""` attribute prefix.
  * @param string $_classes Optional. String of space separated classes that will go inside the Field's `class=""` attribute.
  * @param string $_styles Optional. String of CSS styles that will go inside the Field's `style=""` attribute.
  * @param string|int $_tabindex. Optional numeric tabindex for the `tabindex=""` attribute.
  * @param string $_attrs Optional. Some additional Field attributes and values.
  * @param array $_submission Optional. But should be passed in with any submission data related to this Field. For instance, you might pass in ``$_POST``.
  * @param string|array $_value Optional. The value of this Field, either by default, or from the ``$_submission`` array.
  * @param string $_editable_context Optional. One of `profile|profile-view|registration`.
  * @return string The resulting Custom Field, in HTML format.
  */
 public static function custom_field_gen($_function = FALSE, $_field = FALSE, $_name_prefix = FALSE, $_id_prefix = FALSE, $_classes = FALSE, $_styles = FALSE, $_tabindex = FALSE, $_attrs = FALSE, $_submission = FALSE, $_value = FALSE, $_editable_context = FALSE)
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_custom_field_gen", get_defined_vars());
     unset($__refs, $__v);
     if (!($gen = "") && $_function && is_array($field = $_field) && !empty($field["type"]) && !empty($field["id"]) && $_name_prefix && $_id_prefix) {
         foreach (array_keys(get_defined_vars()) as $__v) {
             $__refs[$__v] =& ${$__v};
         }
         do_action("ws_plugin__s2member_during_custom_field_gen_before", get_defined_vars());
         unset($__refs, $__v);
         $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
         $field_id_class = preg_replace("/_/", "-", $field_var);
         $name_suffix = preg_match("/\\[\$/", $_name_prefix) ? ']' : '';
         $field_name = trim($_name_prefix . $field_var . $name_suffix);
         if (in_array($field["type"], array("text", "textarea", "select"), TRUE)) {
             $_classes = trim($_classes . " form-control");
         }
         // Bootstrap.
         $common = '';
         $common .= ' name="' . esc_attr($field_name) . '"';
         $common .= ' id="' . esc_attr($_id_prefix . $field_id_class) . '"';
         $common .= !empty($field["required"]) && $field["required"] === "yes" ? ' aria-required="true"' : '';
         $common .= strlen($_tabindex) ? ' tabindex="' . esc_attr($_tabindex) . '"' : '';
         $common .= !empty($field["expected"]) ? ' data-expected="' . esc_attr($field["expected"]) . '"' : '';
         $common .= $_editable_context === "profile-view" || $_editable_context === "profile" && !empty($field["editable"]) && strpos($field["editable"], "no") === 0 ? ' disabled="disabled"' : '';
         $common .= $_classes || !empty($field["classes"]) ? ' class="' . esc_attr(trim($_classes . (!empty($field["classes"]) ? ' ' . $field["classes"] : ''))) . '"' : '';
         $common .= $_styles || !empty($field["styles"]) ? ' style="' . esc_attr(trim($_styles . (!empty($field["styles"]) ? ' ' . $field["styles"] : ''))) . '"' : '';
         $common .= $_attrs || !empty($field["attrs"]) ? ' ' . trim($_attrs . (!empty($field["attrs"]) ? ' ' . $field["attrs"] : '')) : '';
         if ($field["type"] === "text") {
             if ($_editable_context === "profile-view") {
                 $gen = esc_html((string) $_value);
             } else {
                 $gen = '<input type="text" maxlength="100" autocomplete="off"';
                 $gen .= ' value="' . format_to_edit(!$_submission && isset($field["deflt"]) && strlen((string) $field["deflt"]) ? (string) $field["deflt"] : (string) $_value) . '"';
                 $gen .= $common . ' />';
             }
         } else {
             if ($field["type"] === "textarea") {
                 if ($_editable_context === "profile-view") {
                     $gen = nl2br(esc_html((string) $_value));
                 } else {
                     $gen = '<textarea rows="3"' . $common . '>';
                     $gen .= format_to_edit(!$_submission && isset($field["deflt"]) && strlen((string) $field["deflt"]) ? (string) $field["deflt"] : (string) $_value);
                     $gen .= '</textarea>';
                 }
             } else {
                 if ($field["type"] === "select" && !empty($field["options"])) {
                     if ($_editable_context === "profile-view") {
                         foreach (preg_split("/[\r\n\t]+/", $field["options"]) as $option_line) {
                             $option_value = $option_label = $option_default = "";
                             @(list($option_value, $option_label, $option_default) = c_ws_plugin__s2member_utils_strings::trim_deep(preg_split("/\\|/", trim($option_line))));
                             if ($option_value === (string) $_value) {
                                 $gen = $option_label;
                                 break;
                             }
                         }
                     } else {
                         $gen = '<select' . $common . '>';
                         $selected_default_option = false;
                         foreach (preg_split("/[\r\n\t]+/", $field["options"]) as $option_line) {
                             $option_value = $option_label = $option_default = "";
                             @(list($option_value, $option_label, $option_default) = c_ws_plugin__s2member_utils_strings::trim_deep(preg_split("/\\|/", trim($option_line))));
                             $gen .= '<option value="' . esc_attr($option_value) . '"' . (($option_default && !$_submission || $option_value === (string) $_value && !$selected_default_option) && ($selected_default_option = true) ? ' selected="selected"' : '') . '>' . $option_label . '</option>';
                         }
                         $gen .= '</select>';
                     }
                 } else {
                     if ($field["type"] === "selects" && !empty($field["options"])) {
                         if ($_editable_context === "profile-view") {
                             foreach (preg_split("/[\r\n\t]+/", $field["options"]) as $option_line) {
                                 $option_value = $option_label = $option_default = "";
                                 @(list($option_value, $option_label, $option_default) = c_ws_plugin__s2member_utils_strings::trim_deep(preg_split("/\\|/", trim($option_line))));
                                 if (in_array($option_value, (array) $_value)) {
                                     $gen .= $option_label . ", ";
                                 }
                             }
                             $gen = c_ws_plugin__s2member_utils_strings::trim($gen, 0, ",");
                         } else {
//.........这里部分代码省略.........
开发者ID:codeforest,项目名称:s2member,代码行数:101,代码来源:custom-reg-fields.inc.php

示例3: s2member_sig_ok

 /**
  * Verifies an s2Member-generated signature; in a full URL, a partial URI, or in just a query string.
  *
  * @package s2Member\Utilities
  * @since 111106
  *
  * @param string $url_uri_query A full URL, a partial URI, or just a query string. Must have an s2Member-generated signature to validate.
  * @param bool $check_time Optional. Defaults to false. If true, s2Member will also check if the signature has expired, based on ``$exp_secs``.
  * @param string|int $exp_secs Optional. Defaults to (int)10. If ``$check_time`` is true, s2Member will check if the signature has expired, based on ``$exp_secs``.
  * @param string $sig_var Optional. The name of the s2Member-generated signature variable. Defaults to `_s2member_sig`.
  * @return bool True if the s2Member-generated signature is OK, else false.
  */
 public static function s2member_sig_ok($url_uri_query = FALSE, $check_time = FALSE, $exp_secs = FALSE, $sig_var = FALSE)
 {
     $url_uri_query = $query = c_ws_plugin__s2member_utils_strings::trim((string) $url_uri_query, false, '?&=');
     if (preg_match('/^(?:[a-z]+\\:\\/\\/|\\/)/i', $url_uri_query)) {
         // Is this a full URL or a partial URI?
         $query = trim(c_ws_plugin__s2member_utils_urls::parse_url($url_uri_query, PHP_URL_QUERY), '?&=');
     }
     $check_time = (bool) $check_time;
     // Check time?
     $exp_secs = is_numeric($exp_secs) ? (int) $exp_secs : 10;
     $sig_var = $sig_var && is_string($sig_var) ? $sig_var : '_s2member_sig';
     $key = c_ws_plugin__s2member_utils_encryption::key();
     // Obtain key.
     if (preg_match_all('/' . preg_quote($sig_var, '/') . '\\=([0-9]+)-([^&$]+)/', $query, $sigs)) {
         $query = c_ws_plugin__s2member_utils_urls::remove_s2member_sigs($query, $sig_var);
         wp_parse_str($query, $vars);
         // Parse the query string into an array of ``$vars``.
         $vars = c_ws_plugin__s2member_utils_arrays::remove_0b_strings(c_ws_plugin__s2member_utils_strings::trim_deep($vars));
         $vars = serialize(c_ws_plugin__s2member_utils_arrays::ksort_deep($vars));
         $i = count($sigs[1]) - 1;
         // Last one.
         $time = $sigs[1][$i];
         // Timestamp.
         $sig = $sigs[2][$i];
         // Signature.
         $valid_sig = md5($key . $time . $vars);
         if ($check_time) {
             // This must NOT be older than ``$exp_secs`` seconds ago.
             return $sig === $valid_sig && $time >= strtotime('-' . $exp_secs . ' seconds');
         }
         return $sig === $valid_sig;
     }
     return false;
     // False, it's NOT ok.
 }
开发者ID:codeforest,项目名称:s2member,代码行数:47,代码来源:utils-urls.inc.php

示例4: sc_get_stream

 /**
  * Handles the Shortcode for: `[s2Stream /]`.
  *
  * @package s2Member\s2File
  * @since 130119
  *
  * @attaches-to ``add_shortcode('s2Stream');``
  *
  * @param array  $attr An array of Attributes.
  * @param string $content Content inside the Shortcode.
  * @param string $shortcode The actual Shortcode name itself.
  *
  * @return string HTML markup that produces an audio/video stream for a specific player.
  */
 public static function sc_get_stream($attr = array(), $content = '', $shortcode = '')
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_sc_get_stream', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $attr = shortcode_atts(array('download' => '', 'file_download' => '', 'download_key' => '', 'stream' => 'yes', 'inline' => 'yes', 'storage' => '', 'remote' => '', 'ssl' => '', 'rewrite' => 'yes', 'rewrite_base' => '', 'skip_confirmation' => '', 'url_to_storage_source' => 'yes', 'count_against_user' => 'yes', 'check_user' => 'yes', 'player' => 'jwplayer-v6-rtmp', 'player_id' => 's2-stream-' . md5(uniqid('', TRUE)), 'player_path' => '/jwplayer/jwplayer.js', 'player_key' => '', 'player_title' => '', 'player_image' => '', 'player_mediaid' => '', 'player_description' => '', 'player_captions' => '', 'player_resolutions' => '', 'player_controls' => 'yes', 'player_skin' => '', 'player_stretching' => 'uniform', 'player_width' => '480', 'player_height' => '270', 'player_aspectratio' => '', 'player_autostart' => 'no', 'player_fallback' => 'yes', 'player_mute' => 'no', 'player_primary' => $attr['player'] === 'jw-player-v6' ? 'html5' : 'flash', 'player_repeat' => 'no', 'player_startparam' => '', 'player_option_blocks' => ''), $attr);
     $attr['download'] = !empty($attr['file_download']) ? $attr['file_download'] : $attr['download'];
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action('ws_plugin__s2member_before_sc_get_stream_after_shortcode_atts', get_defined_vars());
     unset($__refs, $__v);
     // Housekeeping.
     foreach ($attr as $key => $value) {
         // Now we need to go through and a `file_` prefix  to certain Attribute keys, for compatibility.
         if (strlen($value) && in_array($key, array('download', 'download_key', 'stream', 'inline', 'storage', 'remote', 'ssl', 'rewrite', 'rewrite_base'))) {
             $config['file_' . $key] = $value;
         } else {
             if (strlen($value) && !in_array($key, array('file_download', 'player')) && strpos($key, 'player_') !== 0) {
                 $config[$key] = $value;
             }
         }
     }
     unset($key, $value);
     // Ditch these now. We don't want these bleeding into Hooks/Filters anyway.
     if (!empty($config) && isset($config['file_download'])) {
         if ($attr['player_resolutions'] && c_ws_plugin__s2member_utils_conds::pro_is_installed()) {
             $file_download_extension = strtolower(ltrim((string) strrchr(basename($config['file_download']), '.'), '.'));
             $file_download_resolution_wo_extension = substr($config['file_download'], 0, -(strlen($file_download_extension) + 1));
             $file_download_wo_resolution_extension = preg_replace('/\\-r[0-9]+([^.]*)$/i', '', $file_download_resolution_wo_extension);
             // e.g., `r720p-HD` is removed here.
             $file_download_resolutions = array();
             // Initialize the array of resolutions.
             foreach (preg_split('/[,;\\s]+/', $attr['player_resolutions'], NULL, PREG_SPLIT_NO_EMPTY) as $_player_resolution) {
                 $_player_resolution = ltrim($_player_resolution, 'Rr');
                 // Remove R|r prefix.
                 $file_download_resolutions[$_player_resolution] = $file_download_wo_resolution_extension . '-r' . $_player_resolution . '.' . $file_download_extension;
             }
             unset($_player_resolution);
             // Housekeeping.
             $file_download_urls = array();
             // Initialize array of all file download urls.
             foreach ($file_download_resolutions as $_player_resolution => $_file_download_resolution) {
                 $_file_download_config = array_merge($config, array('file_download' => $_file_download_resolution));
                 if ($file_download_urls) {
                     // If this is a ANOTHER resolution, don't count it against the user.
                     $_file_download_config = array_merge($_file_download_config, array('check_user' => FALSE, 'count_against_user' => FALSE));
                 }
                 if (!($file_download_urls[str_replace(array('_', '-'), ' ', $_player_resolution)] = c_ws_plugin__s2member_files::create_file_download_url($_file_download_config, TRUE))) {
                     return apply_filters('ws_plugin__s2member_sc_get_stream', NULL, get_defined_vars());
                 }
                 // Failure.
             }
             unset($_player_resolution, $_file_download_resolution, $_file_download_config);
             // Housekeeping.
         } else {
             $file_download_urls = array(c_ws_plugin__s2member_files::create_file_download_url($config, TRUE));
         }
         // Default behavior.
         if ($file_download_urls && $attr['player'] && is_file($template = dirname(dirname(__FILE__)) . '/templates/players/' . $attr['player'] . '.php') && $attr['player_id'] && $attr['player_path']) {
             $template = is_file(TEMPLATEPATH . '/' . basename($template)) ? TEMPLATEPATH . '/' . basename($template) : $template;
             $template = is_file(get_stylesheet_directory() . '/' . basename($template)) ? get_stylesheet_directory() . '/' . basename($template) : $template;
             $template = is_file(WP_CONTENT_DIR . '/' . basename($template)) ? WP_CONTENT_DIR . '/' . basename($template) : $template;
             if (strpos($attr['player'], 'jwplayer-v6') === 0) {
                 $player = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($template)));
                 $_first_file_download_url = array();
                 // Holds the first one.
                 $_last_file_download_url = array();
                 // Holds the last one.
                 $_uses_rtmp_streamers = FALSE;
                 // Streamers use RTMP?
                 $_total_player_sources = count($file_download_urls);
                 // Total sources.
                 $_player_sources_counter = 1;
                 // Player sources counter; needed by the loop below.
                 $player_resolution_aspect_ratio_w = 16;
                 // Default aspect ratio width.
                 $player_resolution_aspect_ratio_h = 9;
                 // Default aspect ratio in height.
                 if ($attr['player_aspectratio'] && preg_match('/^[0-9]+\\:[0-9]+$/', $attr['player_aspectratio'])) {
                     list($player_resolution_aspect_ratio_w, $player_resolution_aspect_ratio_h) = explode(':', $attr['player_aspectratio']);
                 }
//.........这里部分代码省略.........
开发者ID:codeforest,项目名称:s2member,代码行数:101,代码来源:sc-files-in.inc.php

示例5: sc_get_stream

 /**
  * Handles the Shortcode for: `[s2Stream /]`.
  *
  * @package s2Member\s2File
  * @since 130119
  *
  * @attaches-to ``add_shortcode("s2Stream");``
  *
  * @param array $attr An array of Attributes.
  * @param str $content Content inside the Shortcode.
  * @param str $shortcode The actual Shortcode name itself.
  * @return str HTML markup that produces an audio/video stream for a specific player.
  */
 public static function sc_get_stream($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_stream", get_defined_vars());
     unset($__refs, $__v);
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     $attr = shortcode_atts(array("download" => "", "download_key" => "", "stream" => "yes", "inline" => "yes", "storage" => "", "remote" => "", "ssl" => "", "rewrite" => "yes", "rewrite_base" => "", "skip_confirmation" => "", "url_to_storage_source" => "yes", "count_against_user" => "yes", "check_user" => "yes", "file_download" => "", "player" => "jwplayer-v6-rtmp", "player_id" => "s2-stream-" . md5(uniqid("", TRUE)), "player_path" => "/jwplayer/jwplayer.js", "player_key" => "", "player_title" => "", "player_image" => "", "player_mediaid" => "", "player_description" => "", "player_captions" => "", "player_controls" => "yes", "player_skin" => "", "player_stretching" => "uniform", "player_width" => "480", "player_height" => "270", "player_aspectratio" => "", "player_autostart" => "no", "player_fallback" => "yes", "player_mute" => "no", "player_primary" => $attr["player"] === "jw-player-v6" ? "html5" : "flash", "player_repeat" => "no", "player_startparam" => "", "player_option_blocks" => ""), $attr);
     $attr["download"] = !empty($attr["file_download"]) ? $attr["file_download"] : $attr["download"];
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_sc_get_stream_after_shortcode_atts", get_defined_vars());
     unset($__refs, $__v);
     foreach ($attr as $key => $value) {
         if (strlen($value) && in_array($key, array("download", "download_key", "stream", "inline", "storage", "remote", "ssl", "rewrite", "rewrite_base"))) {
             $config["file_" . $key] = $value;
         } else {
             if (strlen($value) && !in_array($key, array("file_download", "player")) && strpos($key, "player_") !== 0) {
                 $config[$key] = $value;
             }
         }
     }
     unset($key, $value);
     if (!empty($config) && isset($config["file_download"])) {
         $_get = c_ws_plugin__s2member_files::create_file_download_url($config, TRUE);
         if (is_array($_get) && !empty($_get) && $attr["player"] && file_exists($template = dirname(dirname(__FILE__)) . "/templates/players/" . $attr["player"] . ".php") && $attr["player_id"] && $attr["player_path"]) {
             $template = file_exists(TEMPLATEPATH . "/" . basename($template)) ? TEMPLATEPATH . "/" . basename($template) : $template;
             $template = file_exists(WP_CONTENT_DIR . "/" . basename($template)) ? WP_CONTENT_DIR . "/" . basename($template) : $template;
             if (strpos($attr["player"], "jwplayer-v6") === 0) {
                 $get = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($template)));
                 $get = preg_replace("/%%streamer%%/", $_get["streamer"], $get);
                 $get = preg_replace("/%%prefix%%/", $_get["prefix"], $get);
                 $get = preg_replace("/%%file%%/", $_get["file"], $get);
                 $get = preg_replace("/%%url%%/", $_get["url"], $get);
                 $get = preg_replace("/%%player_id%%/", $attr["player_id"], $get);
                 $get = preg_replace("/%%player_path%%/", $attr["player_path"], $get);
                 $get = preg_replace("/%%player_key%%/", $attr["player_key"], $get);
                 $get = preg_replace("/%%player_title%%/", $attr["player_title"], $get);
                 $get = preg_replace("/%%player_image%%/", $attr["player_image"], $get);
                 $get = preg_replace("/%%player_mediaid%%/", $attr["player_mediaid"], $get);
                 $get = preg_replace("/%%player_description%%/", $attr["player_description"], $get);
                 if ($attr["player_captions"] = c_ws_plugin__s2member_utils_strings::trim($attr["player_captions"], null, "[]")) {
                     $get = preg_replace("/%%player_captions%%/", "[" . (strpos($attr["player_captions"], ":") !== false ? $attr["player_captions"] : base64_decode($attr["player_captions"])) . "]", $get);
                 } else {
                     $get = preg_replace("/%%player_captions%%/", "[]", $get);
                 }
                 $get = preg_replace("/%%player_controls%%/", filter_var($attr["player_controls"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_width%%/", strpos($attr["player_width"], "%") !== FALSE ? "'" . $attr["player_width"] . "'" : (int) $attr["player_width"], $get);
                 $get = preg_replace("/%%player_height%%/", $attr["player_aspectratio"] ? "''" : (strpos($attr["player_height"], "%") !== FALSE ? "'" . $attr["player_height"] . "'" : (int) $attr["player_height"]), $get);
                 $get = preg_replace("/%%player_aspectratio%%/", $attr["player_aspectratio"], $get);
                 $get = preg_replace("/%%player_skin%%/", $attr["player_skin"], $get);
                 $get = preg_replace("/%%player_stretching%%/", $attr["player_stretching"], $get);
                 $get = preg_replace("/%%player_autostart%%/", filter_var($attr["player_autostart"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_fallback%%/", filter_var($attr["player_fallback"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_mute%%/", filter_var($attr["player_mute"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_primary%%/", $attr["player_primary"], $get);
                 $get = preg_replace("/%%player_repeat%%/", filter_var($attr["player_repeat"], FILTER_VALIDATE_BOOLEAN) ? "true" : "false", $get);
                 $get = preg_replace("/%%player_startparam%%/", $attr["player_startparam"], $get);
                 $get = preg_replace("/%%player_option_blocks%%/", strpos($attr["player_option_blocks"], ":") !== false ? $attr["player_option_blocks"] : base64_decode($attr["player_option_blocks"]), $get);
             }
         }
     }
     return apply_filters("ws_plugin__s2member_sc_get_stream", isset($get) ? $get : null, get_defined_vars());
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:79,代码来源:sc-files-in.inc.php


注:本文中的c_ws_plugin__s2member_utils_strings::trim方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。