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


PHP GoogleSitemapGenerator::SendPingAll方法代碼示例

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


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

示例1: HtmlShowOptionsPage


//.........這裏部分代碼省略.........
                            if (!current_user_can("administrator")) {
                                echo '<p>Please log in as admin</p>';
                                return;
                            }
                            echo <<<HTML
<html>
\t<head>
\t\t<style type="text/css">
\t\thtml {
\t\t\tbackground: #f1f1f1;
\t\t}

\t\tbody {
\t\t\tcolor: #444;
\t\t\tfont-family: "Open Sans", sans-serif;
\t\t\tfont-size: 13px;
\t\t\tline-height: 1.4em;
\t\t\tmin-width: 600px;
\t\t}

\t\th2 {
\t\t\tfont-size: 23px;
\t\t\tfont-weight: 400;
\t\t\tpadding: 9px 10px 4px 0;
\t\t\tline-height: 29px;
\t\t}
\t\t</style>
\t</head>
\t<body>
HTML;
                            echo "<h2>" . __('Notify Search Engines about all sitemaps', 'sitemap') . "</h2>";
                            echo "<p>" . __('The plugin is notifying the selected search engines about your main sitemap and all sub-sitemaps. This might take a minute or two.', 'sitemaps') . "</p>";
                            flush();
                            $results = $this->sg->SendPingAll();
                            echo "<ul>";
                            foreach ($results as $result) {
                                $sitemapUrl = $result["sitemap"];
                                /** @var $status GoogleSitemapGeneratorStatus */
                                $status = $result["status"];
                                echo "<li><a href=\"" . esc_url($sitemapUrl) . "\">" . $sitemapUrl . "</a><ul>";
                                $services = $status->GetUsedPingServices();
                                foreach ($services as $serviceId) {
                                    echo "<li>";
                                    echo $status->GetServiceName($serviceId) . ": " . ($status->GetPingResult($serviceId) == true ? "OK" : "ERROR");
                                    echo "</li>";
                                }
                                echo "</ul></li>";
                            }
                            echo "</ul>";
                            echo "<p>" . __('All done!', 'sitemap') . "</p>";
                            echo <<<HTML

\t</body>
HTML;
                            exit;
                        } else {
                            if (!empty($_GET["sm_ping_main"])) {
                                check_admin_referer('sitemap');
                                //Check again, just for the case that something went wrong before
                                if (!current_user_can("administrator")) {
                                    echo '<p>Please log in as admin</p>';
                                    return;
                                }
                                $this->sg->SendPing();
                                $message = __("Ping was executed, please see below for the result.", "sitemap");
                            }
開發者ID:popovdenis,項目名稱:kmst,代碼行數:67,代碼來源:sitemap-ui.php


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