當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。