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


PHP GoogleSitemapGenerator::GetPages方法代碼示例

本文整理匯總了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 
開發者ID:songsanren,項目名稱:My-blog,代碼行數:67,代碼來源:sitemap-ui.php


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