本文整理汇总了PHP中GoogleSitemapGenerator::GetFreqNames方法的典型用法代码示例。如果您正苦于以下问题:PHP GoogleSitemapGenerator::GetFreqNames方法的具体用法?PHP GoogleSitemapGenerator::GetFreqNames怎么用?PHP GoogleSitemapGenerator::GetFreqNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoogleSitemapGenerator
的用法示例。
在下文中一共展示了GoogleSitemapGenerator::GetFreqNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HtmlShowOptionsPage
//.........这里部分代码省略.........
_e('Include sitemap in HTML format', 'sitemap');
?>
</label>
</li>
</ul>
<?php
$this->HtmlPrintBoxFooter();
?>
<?php
$this->HtmlPrintBoxHeader('sm_pages', __('Additional pages', 'sitemap'));
?>
<?php
_e('Here you can specify files or URLs which should be included in the sitemap, but do not belong to your Blog/WordPress.<br />For example, if your domain is www.foo.com and your blog is located on www.foo.com/blog you might want to include your homepage at www.foo.com', 'sitemap');
echo "<ul><li>";
echo "<strong>" . __('Note', 'sitemap') . "</strong>: ";
_e("If your blog is in a subdirectory and you want to add pages which are NOT in the blog directory or beneath, you MUST place your sitemap file in the root directory (Look at the "Location of your sitemap file" section on this page)!", 'sitemap');
echo "</li><li>";
echo "<strong>" . __('URL to the page', 'sitemap') . "</strong>: ";
_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()) : "") . '"}';
}
}
?>
];