新增一个destoon7.0中sitemap.xml把archiver地址输出到里面,这样有利于蜘蛛到抓取,添加到小功能,给自己做个笔记,希望也能帮助到大家!
首先找到 /module/extend/sitemaps.htm.php文件,在
$today = timetodate($DT_TIME, 3); $mods = explode(',', $MOD['sitemaps_module']); $nums = intval($MOD['sitemaps_items']/count($mods)); $data = '<?xml version="1.0" encoding="UTF-8"?>'; $data .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $data .= '<url>'; $data .= '<loc>'.DT_PATH.'</loc>'; $data .= '<lastmod>'.$today.'</lastmod>'; $data .= '<changefreq>always</changefreq>'; $data .= '<priority>1.0</priority>'; $data .= '<data><display></display></data>'; $data .= '</url>';
这代码下面加入这个代码:
//archiver输出 $archiver=$CFG['url'].'archiver/'; $data .= '<url>'; $data .= '<loc>'.$archiver.'</loc>'; $data .= '<lastmod>'.$today.'</lastmod>'; $data .= '<changefreq>always</changefreq>'; $data .= '<priority>'.$MOD['sitemaps_priority'].'</priority>'; $data .= '<data><display></display></data>'; $data .= '</url>'; foreach($mods as $mid) { $indexhtm='index-htm-mid-'; $htm='.html'; $midurl=$archiver.$indexhtm.$mid.$htm; $data .= '<url>'; $data .= '<loc>'.$midurl.'</loc>'; $data .= '<lastmod>'.$today.'</lastmod>'; $data .= '<changefreq>always</changefreq>'; $data .= '<priority>'.$MOD['sitemaps_priority'].'</priority>'; $data .= '<data><display></display></data>'; $data .= '</url>'; } //archiver输出end
这样就修改好了,输出到结果就有archiver地址了