本文整理汇总了PHP中GoogleSitemapGenerator::GetPages方法的典型用法代码示例。如果您正苦于以下问题:PHP GoogleSitemapGenerator::GetPages方法的具体用法?PHP GoogleSitemapGenerator::GetPages怎么用?PHP GoogleSitemapGenerator::GetPages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoogleSitemapGenerator
的用法示例。
在下文中一共展示了GoogleSitemapGenerator::GetPages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HtmlShowOptionsPage
//.........这里部分代码省略.........
_e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ", 'sitemap');
echo "</li><li>";
echo "<strong>" . __('Priority', 'sitemap') . "</strong>: ";
_e("Choose the priority of the page relative to the other pages. For example, your homepage might have a higher priority than your imprint.", 'sitemap');
echo "</li><li>";
echo "<strong>" . __('Last Changed', 'sitemap') . "</strong>: ";
_e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).", 'sitemap');
echo "</li></ul>";
?>
<script type="text/javascript">
//<![CDATA[
<?php
$freqVals = "'" . implode("','", array_keys($this->sg->GetFreqNames())) . "'";
$freqNames = "'" . implode("','", array_values($this->sg->GetFreqNames())) . "'";
?>
var changeFreqVals = new Array( <?php
echo $freqVals;
?>
);
var changeFreqNames= new Array( <?php
echo $freqNames;
?>
);
var priorities= new Array(0 <?php
for ($i = 0.1; $i < 1; $i += 0.1) {
echo "," . number_format($i, 1, ".", "");
}
?>
);
var pages = [ <?php
$pages = $this->sg->GetPages();
if (count($pages) > 0) {
for ($i = 0; $i < count($this->sg->GetPages()); $i++) {
$v = $pages[$i];
if ($i > 0) {
echo ",";
}
echo '{url:"' . esc_js($v->getUrl()) . '", priority:' . esc_js(number_format($v->getPriority(), 1, ".", "")) . ', changeFreq:"' . esc_js($v->getChangeFreq()) . '", lastChanged:"' . esc_js($v != null && $v->getLastMod() > 0 ? date("Y-m-d", $v->getLastMod()) : "") . '"}';
}
}
?>
];
//]]>
</script>
<script type="text/javascript" src="<?php
echo $this->sg->GetPluginUrl();
?>
img/sitemap.js"></script>
<table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
<tr>
<th scope="col"><?php
_e('URL to the page', 'sitemap');
?>
</th>
<th scope="col"><?php
_e('Priority', 'sitemap');
?>
</th>
<th scope="col"><?php
_e('Change Frequency', 'sitemap');
?>
</th>
<th scope="col"><?php