當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GoogleSitemapGenerator::getDefaultStyle方法代碼示例

本文整理匯總了PHP中GoogleSitemapGenerator::getDefaultStyle方法的典型用法代碼示例。如果您正苦於以下問題:PHP GoogleSitemapGenerator::getDefaultStyle方法的具體用法?PHP GoogleSitemapGenerator::getDefaultStyle怎麽用?PHP GoogleSitemapGenerator::getDefaultStyle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GoogleSitemapGenerator的用法示例。


在下文中一共展示了GoogleSitemapGenerator::getDefaultStyle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: HtmlShowOptionsPage


//.........這裏部分代碼省略.........
                    $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>';
                echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
                exit;
            }
        } else {
            if (!empty($_POST['sm_update'])) {
                //Pressed Button: Update Config
                check_admin_referer('sitemap');
                if (isset($_POST['sm_b_style']) && $_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
                    $_POST['sm_b_style_default'] = true;
                    $_POST['sm_b_style'] = '';
                }
                foreach ($this->sg->_options as $k => $v) {
                    //Check vor values and convert them into their types, based on the category they are in
                    if (!isset($_POST[$k])) {
                        $_POST[$k] = "";
                    }
                    // Empty string will get false on 2bool and 0 on 2float
                    //Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
                    if (substr($k, 0, 5) == "sm_b_") {
                        if ($k == "sm_b_filename" || $k == "sm_b_fileurl_manual" || $k == "sm_b_filename_manual" || $k == "sm_b_prio_provider" || $k == "sm_b_manual_key" || $k == "sm_b_yahookey" || $k == "sm_b_style" || $k == "sm_b_memory") {
                            if ($k == "sm_b_filename_manual" && strpos($_POST[$k], "\\") !== false) {
                                $_POST[$k] = stripslashes($_POST[$k]);
                            }
                            $this->sg->_options[$k] = (string) $_POST[$k];
                        } else {
                            if ($k == "sm_b_location_mode") {
                                $tmp = (string) $_POST[$k];
                                $tmp = strtolower($tmp);
                                if ($tmp == "auto" || ($tmp = "manual")) {
                                    $this->sg->_options[$k] = $tmp;
                                } else {
                                    $this->sg->_options[$k] = "auto";
                                }
                            } else {
                                if ($k == "sm_b_time" || $k == "sm_b_max_posts") {
                                    if ($_POST[$k] == '') {
                                        $_POST[$k] = -1;
                                    }
                                    $this->sg->_options[$k] = intval($_POST[$k]);
                                } else {
開發者ID:SymbiSoft,項目名稱:litprojects,代碼行數:67,代碼來源:sitemap-ui.php

示例2: HtmlShowOptionsPage


//.........這裏部分代碼省略.........
                    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 {
                $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>';
                echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
                exit;
            }
        } else {
            if (!empty($_POST['sm_update'])) {
                //Pressed Button: Update Config
                check_admin_referer('sitemap');
                if (isset($_POST['sm_b_style']) && $_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
                    $_POST['sm_b_style_default'] = true;
                    $_POST['sm_b_style'] = '';
                }
                foreach ($this->sg->GetOptions() as $k => $v) {
                    //Check vor values and convert them into their types, based on the category they are in
                    if (!isset($_POST[$k])) {
                        $_POST[$k] = "";
                    }
                    // Empty string will get false on 2bool and 0 on 2float
                    //Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
                    if (substr($k, 0, 5) == "sm_b_") {
                        if ($k == "sm_b_prio_provider" || $k == "sm_b_yahookey" || $k == "sm_b_style" || $k == "sm_b_memory") {
                            if ($k == "sm_b_filename_manual" && strpos($_POST[$k], "\\") !== false) {
                                $_POST[$k] = stripslashes($_POST[$k]);
                            }
                            $this->sg->SetOption($k, (string) $_POST[$k]);
                        } else {
                            if ($k == "sm_b_time") {
                                if ($_POST[$k] == '') {
                                    $_POST[$k] = -1;
                                }
                                $this->sg->SetOption($k, intval($_POST[$k]));
                            } else {
                                if ($k == "sm_i_install_date") {
                                    if ($this->sg->GetOption('i_install_date') <= 0) {
                                        $this->sg->SetOption($k, time());
                                    }
                                } else {
                                    if ($k == "sm_b_exclude") {
                                        $IDss = array();
                                        $IDs = explode(",", $_POST[$k]);
                                        for ($x = 0; $x < count($IDs); $x++) {
開發者ID:songsanren,項目名稱:My-blog,代碼行數:67,代碼來源:sitemap-ui.php


注:本文中的GoogleSitemapGenerator::getDefaultStyle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。