当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
12 Star 43 Fork 18

foru / ForU CMS
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sitemap.php 967 Bytes
一键复制 编辑 原始数据 按行查看 历史
石榴木 提交于 2020-02-21 16:52 . update sitemap.php.
<?php
include './library/inc.php';
header('Content-type: application/xml; charset="UTF-8"', true);
//"always", "hourly", "daily", "weekly", "monthly", "yearly" and "never"
$changefreq = "weekly";
$str = '<?xml version="1.0" encoding="UTF-8"?>'.PHP_EOL;
$str .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'.PHP_EOL;
$res = $db->getAll("SELECT * FROM detail ORDER BY d_order ASC,id DESC LIMIT 0,5000");
foreach ($res as $val) {
$str .= ' <url>' . PHP_EOL . ' <loc>' . $cms['s_domain'] . '/' . htmlspecialchars(d_url($val['id'])) . '</loc>' . PHP_EOL . ' <lastmod>' . local_date("Y-m-d H:i:s",$val['d_date']) . '</lastmod>' . PHP_EOL . ' <changefreq>' . $changefreq . '</changefreq>' . PHP_EOL . ' <priority>0.8</priority>' . PHP_EOL . ' </url>' . PHP_EOL;
}
$str .= '</urlset>';
if ($act == 'xml') {
$fp = fopen("sitemap.xml", "w+");
fwrite($fp, $str);
fclose($fp);
header('Location: ./sitemap.xml');
} else {
echo $str;
}
PHP
1
https://gitee.com/sw1981/ForU-CMS.git
git@gitee.com:sw1981/ForU-CMS.git
sw1981
ForU-CMS
ForU CMS
dev

搜索帮助