• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP got_mod_rewrite函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中got_mod_rewrite函数的典型用法代码示例。如果您正苦于以下问题:PHP got_mod_rewrite函数的具体用法?PHP got_mod_rewrite怎么用?PHP got_mod_rewrite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: uncode_add_h5bp_htaccess

/**
 * Add HTML5 Boilerplate's .htaccess via WordPress
 */
function uncode_add_h5bp_htaccess()
{
    $options = get_option(ot_options_id());
    $theme_opt = $options['_uncode_htaccess'];
    $saved_opt = get_option("_uncode_htaccess_performace");
    if ($theme_opt === 'on' && $saved_opt !== 'on' || $theme_opt === 'off' && $saved_opt === 'on') {
        global $wp_rewrite;
        $home_path = function_exists('get_home_path') ? get_home_path() : ABSPATH;
        $htaccess_file = $home_path . '.htaccess';
        $mod_rewrite_enabled = function_exists('got_mod_rewrite') ? got_mod_rewrite() : false;
        if (!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() || is_writable($htaccess_file)) {
            if ($mod_rewrite_enabled) {
                $h5bp_rules = extract_from_markers($htaccess_file, 'HTML5 Boilerplate');
                if ($h5bp_rules === array()) {
                    $filename = dirname(__FILE__) . '/h5bp-htaccess';
                    update_option("_uncode_htaccess_performace", $theme_opt);
                    return insert_with_markers($htaccess_file, 'HTML5 Boilerplate', extract_from_markers($filename, 'HTML5 Boilerplate'));
                } else {
                    if ($theme_opt === 'off') {
                        update_option("_uncode_htaccess_performace", $theme_opt);
                        return insert_with_markers($htaccess_file, 'HTML5 Boilerplate', '');
                    }
                }
            }
        }
    }
}
开发者ID:b0123498765,项目名称:fithealthyandwealthy,代码行数:30,代码来源:performance.php


示例2: do_analyze_page

 public function do_analyze_page()
 {
     $rewrite_rules = $GLOBALS['wp_rewrite']->wp_rewrite_rules();
     $rewrite_rules_ui = array();
     $public_query_vars = apply_filters('query_vars', $GLOBALS['wp']->public_query_vars);
     $rewrite_patterns = array();
     // URL prefix
     $prefix = '';
     if (!got_mod_rewrite() && !iis7_supports_permalinks()) {
         $prefix = '/index.php';
     }
     $url_prefix = get_option('home') . $prefix . '/';
     $idx = 0;
     if ($rewrite_rules) {
         foreach ($rewrite_rules as $pattern => $substitution) {
             $idx++;
             $rewrite_patterns[$idx] = addslashes($pattern);
             $rewrite_rule_ui = array('pattern' => $pattern);
             try {
                 $regex_tree = Monkeyman_Regex::parse($pattern);
             } catch (Exception $e) {
                 $rewrite_rule_ui['error'] = $e;
             }
             $regex_groups = self::collect_groups($regex_tree);
             $rewrite_rule_ui['print'] = self::print_regex($regex_tree, $idx);
             $substitution_parts = self::parse_substitution($substitution);
             $substitution_parts_ui = array();
             foreach ($substitution_parts as $query_var => $query_value) {
                 $substitution_part_ui = array('query_var' => $query_var, 'query_value' => $query_value);
                 $query_value_ui = $query_value;
                 // Replace `$matches[DD]` with URL regex part
                 // This is so complicated to handle situations where `$query_value` contains multiple `$matches[DD]`
                 $query_value_replacements = array();
                 if (preg_match_all('/\\$matches\\[(\\d+)\\]/', $query_value, $matches, PREG_OFFSET_CAPTURE)) {
                     foreach ($matches[0] as $m_idx => $match) {
                         $regex_group_idx = $matches[1][$m_idx][0];
                         $query_value_replacements[$match[1]] = array('replacement' => self::print_regex($regex_groups[$regex_group_idx], $idx, true), 'length' => strlen($match[0]), 'offset' => $match[1]);
                     }
                 }
                 krsort($query_value_replacements);
                 foreach ($query_value_replacements as $query_value_replacement) {
                     $query_value_ui = substr_replace($query_value_ui, $query_value_replacement['replacement'], $query_value_replacement['offset'], $query_value_replacement['length']);
                 }
                 $substitution_part_ui['query_value_ui'] = $query_value_ui;
                 // Highlight non-public query vars
                 $substitution_part_ui['is_public'] = in_array($query_var, $public_query_vars);
                 $substitution_parts_ui[] = $substitution_part_ui;
             }
             $rewrite_rule_ui['substitution_parts'] = $substitution_parts_ui;
             $rewrite_rules_ui[$idx] = $rewrite_rule_ui;
         }
     }
     wp_localize_script($this->gettext_domain, 'Monkeyman_Rewrite_Analyzer_Regexes', $rewrite_patterns);
     $gettext_domain = $this->gettext_domain;
     include dirname($this->base_file) . '/ui/rewrite-analyzer.php';
 }
开发者ID:asha23,项目名称:sdt,代码行数:56,代码来源:class-monkeyman-rewrite-analyzer.php


示例3: structure

 /**
  * Update the permalink structure.
  *
  * ## DESCRIPTION
  *
  * Updates the post permalink structure.
  *
  * To regenerate a .htaccess file with WP-CLI, you'll need to add the mod_rewrite module
  * to your wp-cli.yml or config.yml. For example:
  *
  * apache_modules:
  *   - mod_rewrite
  *
  * ## OPTIONS
  *
  * <permastruct>
  * : The new permalink structure to apply.
  *
  * [--category-base=<base>]
  * : Set the base for category permalinks, i.e. '/category/'.
  *
  * [--tag-base=<base>]
  * : Set the base for tag permalinks, i.e. '/tag/'.
  *
  * [--hard]
  * : Perform a hard flush - update `.htaccess` rules as well as rewrite rules in database.
  *
  * ## EXAMPLES
  *
  *     wp rewrite structure '/%year%/%monthnum%/%postname%'
  */
 public function structure($args, $assoc_args)
 {
     global $wp_rewrite;
     // copypasta from /wp-admin/options-permalink.php
     $home_path = get_home_path();
     $iis7_permalinks = iis7_supports_permalinks();
     $prefix = $blog_prefix = '';
     if (!got_mod_rewrite() && !$iis7_permalinks) {
         $prefix = '/index.php';
     }
     if (is_multisite() && !is_subdomain_install() && is_main_site()) {
         $blog_prefix = '/blog';
     }
     $permalink_structure = $args[0] == 'default' ? '' : $args[0];
     if (!empty($permalink_structure)) {
         $permalink_structure = preg_replace('#/+#', '/', '/' . str_replace('#', '', $permalink_structure));
         if ($prefix && $blog_prefix) {
             $permalink_structure = $prefix . preg_replace('#^/?index\\.php#', '', $permalink_structure);
         } else {
             $permalink_structure = $blog_prefix . $permalink_structure;
         }
     }
     $wp_rewrite->set_permalink_structure($permalink_structure);
     // Update category or tag bases
     if (isset($assoc_args['category-base'])) {
         $category_base = $assoc_args['category-base'];
         if (!empty($category_base)) {
             $category_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace('#', '', $category_base));
         }
         $wp_rewrite->set_category_base($category_base);
     }
     if (isset($assoc_args['tag-base'])) {
         $tag_base = $assoc_args['tag-base'];
         if (!empty($tag_base)) {
             $tag_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace('#', '', $tag_base));
         }
         $wp_rewrite->set_tag_base($tag_base);
     }
     // make sure we detect mod_rewrite if configured in apache_modules in config
     self::apache_modules();
     // Launch a new process to flush rewrites because core expects flush
     // to happen after rewrites are set
     $new_assoc_args = array();
     if (\WP_CLI\Utils\get_flag_value($assoc_args, 'hard')) {
         $new_assoc_args['hard'] = true;
         if (!in_array('mod_rewrite', (array) WP_CLI::get_config('apache_modules'))) {
             WP_CLI::warning("Regenerating a .htaccess file requires special configuration. See usage docs.");
         }
     }
     $process_run = WP_CLI::launch_self('rewrite flush', array(), $new_assoc_args, true, true, array('apache_modules', WP_CLI::get_config('apache_modules')));
     if (!empty($process_run->stderr)) {
         // Strip "Warning: "
         WP_CLI::warning(substr($process_run->stderr, 9));
     }
     WP_CLI::success("Rewrite structure set.");
 }
开发者ID:rjagadishsingh,项目名称:wp-cli,代码行数:87,代码来源:rewrite.php


示例4: htaccess_add_rules

 /**
  * Adds extra goodness whenever WP writes to .htaccess
  * 
  * @global object $wp_rewrite
  * @param string $content
  * @return boolean
  */
 function htaccess_add_rules($content)
 {
     global $wp_rewrite;
     $home_path = function_exists('get_home_path') ? get_home_path() : ABSPATH;
     $htaccess_file = $home_path . '.htaccess';
     $mod_rewrite_enabled = function_exists('got_mod_rewrite') ? got_mod_rewrite() : false;
     $firewall_rules = extract_from_markers($htaccess_file, 'Tabula Rasa');
     if ($firewall_rules === array()) {
         $filename = dirname(__FILE__) . '/TR-htaccess';
         return $this->prepend_with_markers($htaccess_file, 'Tabula Rasa', extract_from_markers($filename, 'Tabula Rasa'));
     }
     return $content;
 }
开发者ID:renaissance-design,项目名称:tabularasa,代码行数:20,代码来源:htaccess.php


示例5: structure

 /**
  * Update the permalink structure.
  *
  * ## OPTIONS
  *
  * <permastruct>
  * : The new permalink structure to apply.
  *
  * [--category-base=<base>]
  * : Set the base for category permalinks, i.e. '/category/'.
  *
  * [--tag-base=<base>]
  * : Set the base for tag permalinks, i.e. '/tag/'.
  *
  * [--hard]
  * : Perform a hard flush - update `.htaccess` rules as well as rewrite rules in database.
  *
  * ## EXAMPLES
  *
  *     wp rewrite structure '/%year%/%monthnum%/%postname%'
  */
 public function structure($args, $assoc_args)
 {
     global $wp_rewrite;
     // copypasta from /wp-admin/options-permalink.php
     $home_path = get_home_path();
     $iis7_permalinks = iis7_supports_permalinks();
     $prefix = $blog_prefix = '';
     if (!got_mod_rewrite() && !$iis7_permalinks) {
         $prefix = '/index.php';
     }
     if (is_multisite() && !is_subdomain_install() && is_main_site()) {
         $blog_prefix = '/blog';
     }
     $permalink_structure = $args[0] == 'default' ? '' : $args[0];
     if (!empty($permalink_structure)) {
         $permalink_structure = preg_replace('#/+#', '/', '/' . str_replace('#', '', $permalink_structure));
         if ($prefix && $blog_prefix) {
             $permalink_structure = $prefix . preg_replace('#^/?index\\.php#', '', $permalink_structure);
         } else {
             $permalink_structure = $blog_prefix . $permalink_structure;
         }
     }
     $wp_rewrite->set_permalink_structure($permalink_structure);
     // Update category or tag bases
     if (isset($assoc_args['category-base'])) {
         $category_base = $assoc_args['category-base'];
         if (!empty($category_base)) {
             $category_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace('#', '', $category_base));
         }
         $wp_rewrite->set_category_base($category_base);
     }
     if (isset($assoc_args['tag-base'])) {
         $tag_base = $assoc_args['tag-base'];
         if (!empty($tag_base)) {
             $tag_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace('#', '', $tag_base));
         }
         $wp_rewrite->set_tag_base($tag_base);
     }
     // make sure we detect mod_rewrite if configured in apache_modules in config
     self::apache_modules();
     // Launch a new process to flush rewrites because core expects flush
     // to happen after rewrites are set
     $new_assoc_args = array();
     if (isset($assoc_args['hard'])) {
         $new_assoc_args['hard'] = true;
     }
     \WP_CLI::launch_self('rewrite flush', array(), $new_assoc_args);
     WP_CLI::success("Rewrite structure set.");
 }
开发者ID:nb,项目名称:wp-cli,代码行数:70,代码来源:rewrite.php


示例6: groundup_compression

 function groundup_compression($rewrites)
 {
     global $wp_rewrite;
     $mod_rewrite_enabled = function_exists('got_mod_rewrite') ? got_mod_rewrite() : false;
     $home_path = function_exists('get_home_path') ? get_home_path() : ABSPATH;
     $htaccess_file = $home_path . '.htaccess';
     if (!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() || is_writable($htaccess_file)) {
         if ($mod_rewrite_enabled) {
             $gzip = "<IfModule mod_headers.c>\n\t# Make sure proxies don't deliver the wrong content\n\tHeader append Vary User-Agent env=!dont-vary\n\t</IfModule>\n\t<IfModule mod_deflate.c>\n\t# Insert filters\n\tAddOutputFilterByType DEFLATE text/plain\n\tAddOutputFilterByType DEFLATE text/html\n\tAddOutputFilterByType DEFLATE text/xml\n\tAddOutputFilterByType DEFLATE text/css\n\tAddOutputFilterByType DEFLATE text/javascript\n\tAddOutputFilterByType DEFLATE application/xml\n\tAddOutputFilterByType DEFLATE application/xhtmlxml\n\tAddOutputFilterByType DEFLATE application/rssxml\n\tAddOutputFilterByType DEFLATE application/javascript\n\tAddOutputFilterByType DEFLATE application/x-javascript\n\tAddOutputFilterByType DEFLATE application/json\n\tAddOutputFilterByType DEFLATE application/x-json\n\tAddOutputFilterByType DEFLATE application/x-httpd-php\n\tAddOutputFilterByType DEFLATE application/x-httpd-fastphp\n\tAddOutputFilterByType DEFLATE image/svgxml\n\t# Drop problematic browsers\n\tBrowserMatch ^Mozilla/4 gzip-only-text/html\n\tBrowserMatch ^Mozilla/4\\.0[678] no-gzip\n\t# IE5.x and IE6 get no gzip, but 7 should\n\tBrowserMatch \\bMSIE\\s[789] !no-gzip !gzip-only-text/html\n\t# IE 6.0 after SP2 has no gzip bugs\n\tBrowserMatch \\bMSIE.SV !no-gzip\n\t# Opera occasionally pretends to be IE with Mozilla/4.0\n\tBrowserMatch \\bOpera !no-gzip\n\t</IfModule>";
             $gzip = explode("\n", $gzip);
             return insert_with_markers($htaccess_file, 'gzip', $gzip);
         }
     }
     return $rewrites;
 }
开发者ID:abacusadvertising,项目名称:groundup,代码行数:15,代码来源:cleanup.php


示例7: __construct

 function __construct()
 {
     register_activation_hook(__FILE__, array($this, 'install'));
     register_uninstall_hook(__FILE__, 'Email_For_Download::uninstall');
     if (got_mod_rewrite()) {
         //	Activate Plugin Features
         add_shortcode('e4d_get_url', array($this, 'get_url'));
         add_filter('attachment_fields_to_edit', array($this, 'add_attachment_fields'), 10, 2);
         add_filter('attachment_fields_to_save', array($this, 'save_attachment_fields'), 10, 2);
         add_action('pre_get_posts', array($this, 'pre_get_posts'));
         add_action('wp', array($this, 'serve_a_file'));
         add_action('wp_head', array($this, 'add_file_refresh'));
     } else {
         //	Display Warning and activate no features
     }
 }
开发者ID:amgxyz,项目名称:geo-mashup-trail-story-add-on,代码行数:16,代码来源:require-email-for-download.php


示例8: roots_add_h5bp_htaccess

 function roots_add_h5bp_htaccess($content)
 {
     global $wp_rewrite;
     $home_path = get_home_path();
     $htaccess_file = $home_path . '.htaccess';
     if (!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() || is_writable($htaccess_file)) {
         if (got_mod_rewrite()) {
             $h5bp_rules = extract_from_markers($htaccess_file, 'HTML5 Boilerplate');
             if ($h5bp_rules === array()) {
                 $filename = __DIR__ . '/h5bp-htaccess';
                 return insert_with_markers($htaccess_file, 'HTML5 Boilerplate', extract_from_markers($filename, 'HTML5 Boilerplate'));
             }
         }
     }
     return $content;
 }
开发者ID:regancarver,项目名称:TEDxYYC-Wordpress-Theme,代码行数:16,代码来源:roots-htaccess.php


示例9: structure

 /**
  * Set permalink structure
  *
  * @param array $args
  * @param array $assoc_args
  */
 public function structure($args, $assoc_args)
 {
     if (!count($args) && !count($assoc_args)) {
         WP_CLI::line("usage: wp rewrite structure <new-permalink-structure>");
         exit;
     }
     global $wp_rewrite;
     // copypasta from /wp-admin/options-permalink.php
     $home_path = get_home_path();
     $iis7_permalinks = iis7_supports_permalinks();
     $prefix = $blog_prefix = '';
     if (!got_mod_rewrite() && !$iis7_permalinks) {
         $prefix = '/index.php';
     }
     if (is_multisite() && !is_subdomain_install() && is_main_site()) {
         $blog_prefix = '/blog';
     }
     // Update base permastruct if argument is provided
     if (isset($args[0])) {
         $permalink_structure = $args[0] == 'default' ? '' : $args[0];
         if (!empty($permalink_structure)) {
             $permalink_structure = preg_replace('#/+#', '/', '/' . str_replace('#', '', $permalink_structure));
             if ($prefix && $blog_prefix) {
                 $permalink_structure = $prefix . preg_replace('#^/?index\\.php#', '', $permalink_structure);
             } else {
                 $permalink_structure = $blog_prefix . $permalink_structure;
             }
         }
         $wp_rewrite->set_permalink_structure($permalink_structure);
     }
     // Update category or tag bases
     if (isset($assoc_args['category-base'])) {
         $category_base = $assoc_args['category-base'];
         if (!empty($category_base)) {
             $category_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace('#', '', $category_base));
         }
         $wp_rewrite->set_category_base($category_base);
     }
     if (isset($assoc_args['tag-base'])) {
         $tag_base = $assoc_args['tag-base'];
         if (!empty($tag_base)) {
             $tag_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace('#', '', $tag_base));
         }
         $wp_rewrite->set_tag_base($tag_base);
     }
     flush_rewrite_rules($hard);
 }
开发者ID:rpeterson,项目名称:wp-cli,代码行数:53,代码来源:rewrite.php


示例10: roots_add_h5bp_htaccess

/**
 * Add HTML5 Boilerplate's .htaccess via WordPress
 */
function roots_add_h5bp_htaccess($content)
{
    global $wp_rewrite;
    $home_path = function_exists('get_home_path') ? get_home_path() : ABSPATH;
    $htaccess_file = $home_path . '.htaccess';
    $mod_rewrite_enabled = function_exists('got_mod_rewrite') ? got_mod_rewrite() : false;
    if (!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() || is_writable($htaccess_file)) {
        if ($mod_rewrite_enabled) {
            $h5bp_rules = extract_from_markers($htaccess_file, 'HTML5 Boilerplate');
            if ($h5bp_rules === array()) {
                $filename = dirname(__FILE__) . '/h5bp-htaccess';
                return insert_with_markers($htaccess_file, 'HTML5 Boilerplate', extract_from_markers($filename, 'HTML5 Boilerplate'));
            }
        }
    }
    return $content;
}
开发者ID:AndrGelmini,项目名称:ItalyStrap,代码行数:20,代码来源:wp-h5bp-htaccess.php


示例11: __construct

 protected function __construct()
 {
     require_once ABSPATH . '/wp-admin/includes/file.php';
     require_once ABSPATH . '/wp-admin/includes/misc.php';
     self::$mod_rewrite_enabled = got_mod_rewrite();
     self::$home_path = get_home_path();
     self::$wp_htaccess_file = self::$home_path . '.htaccess';
     self::$roots_htaccess_file = locate_template(['server_configs.conf', 'h5bp-htaccess.conf']);
     if (!self::$roots_htaccess_file) {
         self::$roots_htaccess_file = __DIR__ . '/h5bp-htaccess.conf';
     }
     if (!$this->verifySetup()) {
         $this->alerts();
     } else {
         self::setRulesFilters();
         $this->write();
     }
 }
开发者ID:webbab,项目名称:wp-h5bp-htaccess,代码行数:18,代码来源:wp-h5bp-htaccess.php


示例12: scoper_options


//.........这里部分代码省略.........
        $hint = __('For users who are not site-wide Editors, determines Media Library visibility of unattached files which were uploaded by another user.', 'scoper');
        $ret = $ui->option_checkbox('admin_others_unattached_files', $tab, $section, $hint, '');
        ?>

	</td>
	</tr>
<?php 
    }
    // any options accessable in this section
    $section = 'file_filtering';
    if (!empty($ui->form_options[$tab][$section])) {
        ?>

	<tr valign="top">
	<th scope="row"><?php 
        // --- ATTACHMENTS SECTION ---
        echo $ui->section_captions[$tab][$section];
        ?>
</th>
	<td>
	
	<?php 
        if (in_array('file_filtering', $ui->form_options[$tab][$section])) {
            $ui->all_options[] = 'file_filtering';
            $site_url = untrailingslashit(get_option('siteurl'));
            if (defined('DISABLE_ATTACHMENT_FILTERING')) {
                $content_dir_notice = __('<strong>Note</strong>: Direct access to uploaded file attachments will not be filtered because DISABLE_ATTACHMENT_FILTERING is defined, perhaps in wp-config.php or role-scoper.php', 'scoper');
            } elseif (MULTISITE && defined('SCOPER_NO_HTACCESS')) {
                $content_dir_notice = __('<strong>Note</strong>: Direct access to uploaded file attachments will not be filtered because SCOPER_NO_HTACCESS is defined, perhaps in wp-config.php or role-scoper.php', 'scoper');
            } else {
                require_once SCOPER_ABSPATH . '/rewrite-rules_rs.php';
                require_once SCOPER_ABSPATH . '/uploads_rs.php';
                $uploads = scoper_get_upload_info();
                if (!got_mod_rewrite()) {
                    $content_dir_notice = __('<strong>Note</strong>: Direct access to uploaded file attachments cannot be filtered because mod_rewrite is not enabled on your server.', 'scoper');
                } elseif (false === strpos($uploads['baseurl'], $site_url)) {
                    $content_dir_notice = __('<strong>Note</strong>: Direct access to uploaded file attachments cannot be filtered because your WP_CONTENT_DIR is not in the WordPress branch.', 'scoper');
                } elseif (!ScoperRewrite::site_config_supports_rewrite()) {
                    $content_dir_notice = __('<strong>Note</strong>: Direct access to uploaded file attachments will not be filtered due to your nonstandard UPLOADS path.', 'scoper');
                } else {
                    global $wp_rewrite;
                    if (empty($wp_rewrite->permalink_structure)) {
                        $content_dir_notice = __('<strong>Note</strong>: Direct access to uploaded file attachments cannot be filtered because WordPress permalinks are set to default.', 'scoper');
                    }
                }
            }
            $disabled = !empty($content_dir_notice);
            $attachment_filtering = !$disabled && scoper_get_option('file_filtering', $sitewide, $customize_defaults);
            ?>

		<label for="file_filtering">
		<input name="file_filtering" type="checkbox" id="file_filtering" <?php 
            echo $disabled;
            ?>
 value="1" <?php 
            checked(true, $attachment_filtering);
            ?>
 />
		<?php 
            echo $ui->option_captions['file_filtering'];
            ?>
</label>
		<br />
		<div class="rs-subtext">
		<?php 
            if ($ui->display_hints) {
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:67,代码来源:options.php


示例13: step_permalinks

    function step_permalinks()
    {
        if (!current_user_can('activate_plugins')) {
            return false;
        }
        $prefix = '';
        $permalink_structure = get_option('permalink_structure');
        $using_permalinks = !empty($permalink_structure) ? true : false;
        $structures = array('', $prefix . '/%year%/%monthnum%/%day%/%postname%/', $prefix . '/%year%/%monthnum%/%postname%/', $prefix . '/archives/%post_id%');
        // If we're using permalinks already, adjust text accordingly
        if ($permalink_structure) {
            $permalink_setup_text = __('Congratulations! You are already using pretty permalinks, which BuddyPress requires. If you\'d like to change your settings, you may do so now. If you\'re happy with your current settings, click Save &amp; Next to continue.', 'buddypress');
        } else {
            $permalink_setup_text = __('To make sure the pages created in the previous step work correctly, pretty permalinks must be active on your site.', 'buddypress');
        }
        if (!got_mod_rewrite() && !iis7_supports_permalinks()) {
            $prefix = '/index.php';
        }
        ?>

		<p><?php 
        echo $permalink_setup_text;
        ?>
</p>
		<p><?php 
        printf(__('Please select the permalink setting you would like to use. For more advanced options please visit the <a href="%s">permalink settings page</a> first, and complete this setup wizard later.', 'buddypress'), admin_url('options-permalink.php'));
        ?>

		<table class="form-table">
			<tr>
				<th><label><input name="permalink_structure" type="radio"<?php 
        if (empty($permalink_structure) || false != strpos($permalink_structure, $structures[1])) {
            ?>
 checked="checked" <?php 
        }
        ?>
value="<?php 
        echo esc_attr($structures[1]);
        ?>
" class="tog" <?php 
        checked($structures[1], $permalink_structure);
        ?>
 />&nbsp;<?php 
        _e('Day and name');
        ?>
</label></th>
				<td><code><?php 
        echo get_home_url() . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/sample-post/';
        ?>
</code></td>
			</tr>
			<tr>
				<th><label><input name="permalink_structure" type="radio"<?php 
        if (empty($permalink_structure) || false != strpos($permalink_structure, $structures[2])) {
            ?>
 checked="checked" <?php 
        }
        ?>
 value="<?php 
        echo esc_attr($structures[2]);
        ?>
" class="tog" <?php 
        checked($structures[2], $permalink_structure);
        ?>
 />&nbsp;<?php 
        _e('Month and name');
        ?>
</label></th>
				<td><code><?php 
        echo get_home_url() . $prefix . '/' . date('Y') . '/' . date('m') . '/sample-post/';
        ?>
</code></td>
			</tr>
			<tr>
				<th><label><input name="permalink_structure" type="radio"<?php 
        if (empty($permalink_structure) || false != strpos($permalink_structure, $structures[3])) {
            ?>
 checked="checked" <?php 
        }
        ?>
 value="<?php 
        echo esc_attr($structures[3]);
        ?>
" class="tog" <?php 
        checked($structures[3], $permalink_structure);
        ?>
 />&nbsp;<?php 
        _e('Numeric');
        ?>
</label></th>
				<td><code><?php 
        echo get_home_url() . $prefix;
        ?>
/archives/123</code></td>
			</tr>
		</table>

		<div class="submit clear">
			<input type="hidden" name="save" value="permalinks" />
			<input type="hidden" name="step" value="<?php 
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:101,代码来源:bp-core-update.php


示例14: save_mod_rewrite_rules

function save_mod_rewrite_rules()
{
    global $is_apache, $wp_rewrite;
    $home_path = get_home_path();
    if (!$wp_rewrite->using_mod_rewrite_permalinks()) {
        return;
    }
    if (!(!file_exists($home_path . '.htaccess') && is_writable($home_path) || is_writable($home_path . '.htaccess'))) {
        return;
    }
    if (!got_mod_rewrite()) {
        return;
    }
    $rules = explode("\n", $wp_rewrite->mod_rewrite_rules());
    insert_with_markers($home_path . '.htaccess', 'WordPress', $rules);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:16,代码来源:admin-functions.php


示例15: wp_cache_manager


//.........这里部分代码省略.........
			<p><?php 
                printf(__('Please see entry 16 in the <a href="%s">Troubleshooting section</a> of the readme.txt', 'wp-super-cache'), 'http://wordpress.org/extend/plugins/wp-super-cache/faq/');
                ?>
</p>
			</div>
			<?php 
            } else {
                wp_cache_replace_line('^ *\\$wp_cache_cron_check', "\$wp_cache_cron_check = 1;", $wp_cache_config_file);
            }
        } else {
            $cron_url = get_option('siteurl') . '/wp-cron.php?check=' . wp_hash('187425');
            $cron = wp_remote_get($cron_url, array('timeout' => 0.01, 'blocking' => true));
            if (is_array($cron)) {
                if ($cron['response']['code'] == '404') {
                    ?>
<h3>Warning! wp-cron.php not found!</h3>
				<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
				<p><?php 
                    _e('Unfortunately WordPress cannot find the file wp-cron.php. This script is required for the the correct operation of garbage collection by this plugin, WordPress scheduled posts as well as other critical activities.', 'wp-super-cache');
                    ?>
</p>
				<p><?php 
                    printf(__('Please see entry 16 in the <a href="%s">Troubleshooting section</a> of the readme.txt', 'wp-super-cache'), 'http://wordpress.org/extend/plugins/wp-super-cache/faq/');
                    ?>
</p>
				</div>
				<?php 
                } else {
                    wp_cache_replace_line('^ *\\$wp_cache_cron_check', "\$wp_cache_cron_check = 1;", $wp_cache_config_file);
                }
            }
        }
    }
    if ($cache_enabled == true && $super_cache_enabled == true && !got_mod_rewrite()) {
        ?>
<h4 style='color: #a00'><?php 
        _e('Mod rewrite may not be installed!', 'wp-super-cache');
        ?>
</h4>
		<p><?php 
        _e('It appears that mod_rewrite is not installed. Sometimes this check isn&#8217;t 100% reliable, especially if you are not using Apache. Please verify that the mod_rewrite module is loaded. It is required for serving Super Cache static files. You will still be able to use half-on mode.', 'wp-super-cache');
        ?>
</p><?php 
    }
    if (!is_writeable_ACLSafe($wp_cache_config_file)) {
        define("SUBMITDISABLED", 'disabled style="color: #aaa" ');
        ?>
<h4 style='text-align:center; color: #a00'><?php 
        _e('Read Only Mode. Configuration cannot be changed.', 'wp-super-cache');
        ?>
 <a href="javascript:toggleLayer('readonlywarning');" title="<?php 
        _e('Why your configuration may not be changed', 'wp-super-cache');
        ?>
"><?php 
        _e('Why', 'wp-super-cache');
        ?>
</a></h4>
		<div id='readonlywarning' style='border: 1px solid #aaa; margin: 2px; padding: 2px; display: none;'>
		<p><?php 
        printf(__('The WP Super Cache configuration file is <code>%s/wp-cache-config.php</code> and cannot be modified. That file must be writeable by the webserver to make any changes.', 'wp-super-cache'), WP_CONTENT_DIR);
        ?>
		<?php 
        _e('A simple way of doing that is by changing the permissions temporarily using the CHMOD command or through your ftp client. Make sure it&#8217;s globally writeable and it should be fine.', 'wp-super-cache');
        ?>
</p>
		<?php 
开发者ID:jeremylightsmith,项目名称:blog,代码行数:67,代码来源:wp-cache.php


示例16: wp_nonce_field

<form name="form" action="options-permalink.php" method="post">
<?php 
wp_nonce_field('update-permalink');
?>
<p class="submit"><input type="submit" name="submit" value="<?php 
_e('Update Permalink Structure &raquo;');
?>
" /></p>
  <p><?php 
_e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.');
?>
</p>

<?php 
$prefix = '';
if (!got_mod_rewrite()) {
    $prefix = '/index.php';
}
$structures = array('', $prefix . '/%year%/%monthnum%/%day%/%postname%/', $prefix . '/archives/%post_id%');
?>
<h3><?php 
_e('Common options:');
?>
</h3>
<p>
	<label>
<input name="selection" type="radio" value="" class="tog" <?php 
checked('', $permalink_structure);
?>
 />
<?php 
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:31,代码来源:options-permalink.php


示例17: shibboleth_remove_htaccess

/**
 * Remove directives from .htaccess file to enable Shibboleth Lazy Sessions.
 */
function shibboleth_remove_htaccess()
{
    if (got_mod_rewrite()) {
        $htaccess = get_home_path() . '.htaccess';
        insert_with_markers($htaccess, 'Shibboleth', array());
    }
}
开发者ID:HirotoKagotani,项目名称:mitcho-shibboleth,代码行数:10,代码来源:shibboleth.php


示例18: wp_cache_manager


//.........这里部分代码省略.........
				<div style='padding:0 8px;color:#9f6000;background-color:#feefb3;border:1px solid #9f6000;'>
				<p><?php 
                    _e('Unfortunately WordPress cannot find the file wp-cron.php. This script is required for the the correct operation of garbage collection by this plugin, WordPress scheduled posts as well as other critical activities.', 'wp-super-cache');
                    ?>
</p>
				<p><?php 
                    printf(__('Please see entry 16 in the <a href="%s">Troubleshooting section</a> of the readme.txt', 'wp-super-cache'), 'http://wordpress.org/extend/plugins/wp-super-cache/faq/');
                    ?>
</p>
				</div>
				<?php 
                } else {
                    wp_cache_replace_line('^ *\\$wp_cache_cron_check', "\$wp_cache_cron_check = 1;", $wp_cache_config_file);
                }
            }
        }
    }
    if (substr(get_option('permalink_structure'), -1) == '/') {
        wp_cache_replace_line('^ *\\$wp_cache_slash_check', "\$wp_cache_slash_check = 1;", $wp_cache_config_file);
    } else {
        wp_cache_replace_line('^ *\\$wp_cache_slash_check', "\$wp_cache_slash_check = 0;", $wp_cache_config_file);
    }
    if (1 == ini_get('zlib.output_compression') || "on" == strtolower(ini_get('zlib.output_compression'))) {
        ?>
<h4 style='color: #a00'><?php 
        _e('Zlib Output Compression Enabled!', 'wp-super-cache');
        ?>
</h4>
		<p><?php 
        _e('PHP is compressing the data sent to the visitors of your site. Disabling this is recommended as the plugin caches the compressed output once instead of compressing the same page over and over again. Also see #21 in the Troubleshooting section. See <a href="http://php.net/manual/en/zlib.configuration.php">this page</a> for instructions on modifying your php.ini.', 'wp-super-cache');
        ?>
</p><?php 
    }
    if ($cache_enabled == true && $super_cache_enabled == true && !got_mod_rewrite()) {
        ?>
<h4 style='color: #a00'><?php 
        _e('Mod rewrite may not be installed!', 'wp-super-cache');
        ?>
</h4>
		<p><?php 
        _e('It appears that mod_rewrite is not installed. Sometimes this check isn&#8217;t 100% reliable, especially if you are not using Apache. Please verify that the mod_rewrite module is loaded. It is required for serving Super Cache static files. You will still be able to use half-on mode.', 'wp-super-cache');
        ?>
</p><?php 
    }
    if (!is_writeable_ACLSafe($wp_cache_config_file)) {
        define("SUBMITDISABLED", 'disabled style="color: #aaa" ');
        ?>
<h4 style='text-align:center; color: #a00'><?php 
        _e('Read Only Mode. Configuration cannot be changed.', 'wp-super-cache');
        ?>
 <a href="javascript:toggleLayer('readonlywarning');" title="<?php 
        _e('Why your configuration may not be changed', 'wp-super-cache');
        ?>
"><?php 
        _e('Why', 'wp-super-cache');
        ?>
</a></h4>
		<div id='readonlywarning' style='border: 1px solid #aaa; margin: 2px; padding: 2px; display: none;'>
		<p><?php 
        printf(__('The WP Super Cache configuration file is <code>%s/wp-cache-config.php</code> and cannot be modified. That file must be writeable by the webserver to make any changes.', 'wp-super-cache'), WP_CONTENT_DIR);
        ?>
		<?php 
        _e('A simple way of doing that is by changing the permissions temporarily using the CHMOD command or through your ftp client. Make sure it&#8217;s globally writeable and it should be fine.', 'wp-super-cache');
        ?>
</p>
		<?php 
开发者ID:hoonio,项目名称:wordpress,代码行数:67,代码来源:wp-cache.php


示例19: wp_cache_manager

function wp_cache_manager()
{
    global $wp_cache_config_file, $valid_nonce, $supercachedir, $cache_path, $cache_enabled, $cache_compression, $super_cache_enabled, $wp_cache_hello_world, $wp_cache_clear_on_post_edit, $cache_rebuild_files;
    if (function_exists('is_site_admin')) {
        if (!is_site_admin()) {
            return;
        }
    }
    $supercachedir = $cache_path . 'supercache/' . preg_replace('/:.*$/', '', $_SERVER["HTTP_HOST"]);
    if (get_option('gzipcompression') == 1) {
        update_option('gzipcompression', 0);
    }
    if (!isset($cache_rebuild_files)) {
        $cache_rebuild_files = 0;
    }
    $valid_nonce = wp_verify_nonce($_REQUEST['_wpnonce'], 'wp-cache');
    /* http://www.netlobo.com/div_hiding.html */
    ?>
<script type='text/javascript'>
<!--
function toggleLayer( whichLayer ) {
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&& 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP got_url_rewrite函数代码示例发布时间:2022-05-15
下一篇:
PHP gopage函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap