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


PHP GoogleSitemapGenerator::BuildSitemap方法代码示例

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


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

示例1: HtmlShowOptionsPage


//.........这里部分代码省略.........
                echo "<pre>";
                $sc = $_SERVER;
                unset($sc["HTTP_COOKIE"]);
                print_r($sc);
                echo "</pre>";
                echo "<h4>WordPress Config</h4>";
                echo "<pre>";
                $opts = array();
                if (function_exists('wp_load_alloptions')) {
                    $opts = wp_load_alloptions();
                } else {
                    global $wpdb;
                    $os = $wpdb->get_results("SELECT option_name, option_value FROM {$wpdb->options}");
                    foreach ((array) $os as $o) {
                        $opts[$o->option_name] = $o->option_value;
                    }
                }
                $popts = array();
                foreach ($opts as $k => $v) {
                    //Try to filter out passwords etc...
                    if (preg_match("/(pass|login|pw|secret|user|usr)/si", $v)) {
                        continue;
                    }
                    $popts[$k] = htmlspecialchars($v);
                }
                print_r($popts);
                echo "</pre>";
                echo '<h4>Sitemap Config</h4>';
                echo "<pre>";
                print_r($this->sg->_options);
                echo "</pre>";
                echo '<h3>Errors, Warnings, Notices</h3>';
                echo '<div>';
                $status = $this->sg->BuildSitemap();
                echo '</div>';
                echo '<h3>MySQL Queries</h3>';
                if (defined('SAVEQUERIES') && SAVEQUERIES) {
                    echo '<pre>';
                    var_dump($GLOBALS['wpdb']->queries);
                    echo '</pre>';
                    $total = 0;
                    foreach ($GLOBALS['wpdb']->queries as $q) {
                        $total += $q[1];
                    }
                    echo '<h4>Total Query Time</h4>';
                    echo '<pre>' . count($GLOBALS['wpdb']->queries) . ' queries in ' . round($total, 2) . ' seconds.</pre>';
                } else {
                    echo '<p>Please edit wp-db.inc.php in wp-includes and set SAVEQUERIES to true if you want to see the queries.</p>';
                }
                echo "<h3>Build Process Results</h3>";
                echo "<pre>";
                print_r($status);
                echo "</pre>";
                echo '<p>Done. <a href="' . wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true", 'sitemap') . '">Rebuild</a> or <a href="' . $this->sg->GetBackLink() . '">Return</a></p>';
                echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
                echo '</div>';
                @error_reporting($oldErr);
                @ini_set("display_errors", $oldIni);
                return;
            } else {
                $this->sg->BuildSitemap();
                $redirURL = $this->sg->GetBackLink() . '&sm_fromrb=true';
                //Redirect so the sm_rebuild GET parameter no longer exists.
                @header("location: " . $redirURL);
                //If there was already any other output, the header redirect will fail
                echo '<script type="text/javascript">location.replace("' . $redirUrl . '");</script>';
开发者ID:SymbiSoft,项目名称:litprojects,代码行数:67,代码来源:sitemap-ui.php


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