• destoon7.0为sitemap模块添加archiver输出到地图上


       新增一个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地址了

       演示地址:http://www.sdfymj.com/sitemaps.xml

  • 相关阅读:
    安卓渗透测试环境搭建笔记
    spring boot Thymeleaf 模板注入 测试实践
    分析activity安全检测实践
    xposed的使用实践
    android组件安全测试实践
    Apache Dubbo Provider默认反序列漏洞复现实践(CVE-2020-1948)
    java设计模式--策略模式
    spring 发送email
    简单介绍
    有意义的礼物——英语小短文
  • 原文地址:https://www.cnblogs.com/68xi/p/12259598.html
Copyright © 2020-2023  润新知