本文整理汇总了PHP中GoogleSitemapGenerator::GetVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP GoogleSitemapGenerator::GetVersion方法的具体用法?PHP GoogleSitemapGenerator::GetVersion怎么用?PHP GoogleSitemapGenerator::GetVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoogleSitemapGenerator
的用法示例。
在下文中一共展示了GoogleSitemapGenerator::GetVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HtmlShowOptionsPage
//.........这里部分代码省略.........
$diffMsg = __('Your sitemap is being refreshed at the moment. Depending on your blog size this might take some time!', 'sitemap');
} else {
$diffMsg = str_replace("%s", $diff, __('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!', 'sitemap'));
}
?>
<div class="updated">
<strong><p><?php
echo $diffMsg;
?>
</p></strong>
<div style="clear:right;"></div>
</div>
<?php
}
}
if (!empty($_REQUEST["sm_rebuild"]) || !empty($_REQUEST["sm_rebuild"])) {
//Clear any outstanding build cron jobs
if (function_exists('wp_clear_scheduled_hook')) {
wp_clear_scheduled_hook('sm_build_cron');
}
}
if (!empty($_REQUEST["sm_rebuild"])) {
//Pressed Button: Rebuild Sitemap
check_admin_referer('sitemap');
if (isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"] == "true") {
//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;
}
$oldErr = error_reporting(E_ALL);
$oldIni = ini_set("display_errors", 1);
echo '<div class="wrap">';
echo '<h2>' . __('XML Sitemap Generator for WordPress', 'sitemap') . " " . $this->sg->GetVersion() . '</h2>';
echo '<p>This is the debug mode of the XML Sitemap Generator. It will show all PHP notices and warnings as well as the internal logs, messages and configuration.</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 "<h3>WordPress and PHP Information</h3>";
echo '<p>WordPress ' . $GLOBALS['wp_version'] . ' with ' . ' DB ' . $GLOBALS['wp_db_version'] . ' on PHP ' . phpversion() . '</p>';
echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->_svnVersion . ')';
echo '<h4>Environment</h4>';
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);
示例2: HtmlShowOptionsPage
/**
* Displays the option page
*
* @since 3.0
* @access public
* @author Arne Brachhold
*/
public function HtmlShowOptionsPage()
{
global $wp_version;
//Hopefully this fixes the caching issues after upgrade. Redirect incl. the versions, but only if no POST data.
if (count($_POST) == 0 && count($_GET) == 1 && isset($_GET["page"])) {
$redirURL = $this->sg->GetBackLink() . '&sm_fromidx=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;
}
$snl = false;
//SNL
$this->sg->Initate();
$message = "";
$is_ms = $this->sg->IsMultiSite();
if (!empty($_REQUEST["sm_rebuild"])) {
//Pressed Button: Rebuild Sitemap
check_admin_referer('sitemap');
if (isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"] == "true") {
//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;
}
$oldErr = error_reporting(E_ALL);
$oldIni = ini_set("display_errors", 1);
echo '<div class="wrap">';
echo '<h2>' . __('XML Sitemap Generator for WordPress', 'sitemap') . " " . $this->sg->GetVersion() . '</h2>';
echo '<p>This is the debug mode of the XML Sitemap Generator. It will show all PHP notices and warnings as well as the internal logs, messages and configuration.</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 "<h3>WordPress and PHP Information</h3>";
echo '<p>WordPress ' . $GLOBALS['wp_version'] . ' with ' . ' DB ' . $GLOBALS['wp_db_version'] . ' on PHP ' . phpversion() . '</p>';
echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->GetSvnVersion() . ')';
echo '<h4>Environment</h4>';
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|key|auth|token/si", $k)) {
continue;
}
$popts[$k] = htmlspecialchars($v);
}
print_r($popts);
echo "</pre>";
echo '<h4>Sitemap Config</h4>';
echo "<pre>";
print_r($this->sg->GetOptions());
echo "</pre>";
echo '<h3>Sitemap Content and Errors, Warnings, Notices</h3>';
echo '<div>';
$sitemaps = $this->sg->SimulateIndex();
foreach ($sitemaps as $sitemap) {
echo "<h4>Sitemap: <a href=\"" . $sitemap["data"]->GetUrl() . "\">" . $sitemap["type"] . "/" . ($sitemap["params"] ? $sitemap["params"] : "(No parameters)") . "</a> by " . $sitemap["caller"]["class"] . "</h4>";
$res = $this->sg->SimulateSitemap($sitemap["type"], $sitemap["params"]);
echo "<ul style='padding-left:10px;'>";
foreach ($res as $s) {
echo "<li>" . $s["data"]->GetUrl() . "</li>";
}
echo "</ul>";
}
$status = GoogleSitemapGeneratorStatus::Load();
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>';
//.........这里部分代码省略.........