本文整理匯總了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()) : "") . '"}';
}
}
?>
];