<!DOCTYPE html> <html lang="en"> <?php include_once './funcs.php'; session_start(); handleAction(); if (!isset($_SESSION['id'])) { $pessoa = getJSON(); } ?> <head> <meta charset="utf-8"> <title>SafeGuard</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- Le styles --> <link href="./css/bootstrap.css" rel="stylesheet"> <link href="./css/bootstrap-responsive.css" rel="stylesheet"> <style type="text/css"> body { padding-top: 60px; padding-bottom: 40px; #map-canvas { height: 100% } } </style>
function saveSiteMap() { $isWebRunHtml = ''; //是否为html方式显示网站 $changefreg = ''; //更新频率 $priority = ''; //优先级 $s = ''; $c = ''; $url = ''; handlePower('修改生成SiteMap'); //管理权限处理 $changefreg = @$_REQUEST['changefreg']; $priority = @$_REQUEST['priority']; loadWebConfig(); //加载配置 //call eerr("cfg_flags",cfg_flags) if (inStr($GLOBALS['cfg_flags'], '|htmlrun|') > 0) { $isWebRunHtml = true; } else { $isWebRunHtml = false; } $c = $c . '<?xml version="1.0" encoding="UTF-8"?>' . vbCrlf(); $c = $c . vbTab() . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . vbCrlf(); //栏目 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn where isonhtml<>0 order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/nav' . $rsx['id']); $url = handleAction($url); } else { $url = escape('?act=nav&columnName=' . $rsx['columnname']); } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //call echo(cfg_webSiteUrl,url) $c = $c . copyStr(vbTab(), 3) . '<loc>' . $url . '</loc>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<lastmod>' . Format_Time($rsx['updatetime'], 2) . '</lastmod>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<changefreq>' . $changefreg . '</changefreq>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<priority>' . $priority . '</priority>' . vbCrlf(); $c = $c . copyStr(vbTab(), 2) . '</url>' . vbCrlf(); aspEcho('栏目', '<a href="' . $url . '" target=\'_blank\'>' . $url . '</a>'); } } //文章 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where isonhtml<>0 order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/detail/detail' . $rsx['id']); $url = handleAction($url); } else { $url = '?act=detail&id=' . $rsx['id']; } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //call echo(cfg_webSiteUrl,url) $c = $c . copyStr(vbTab(), 3) . '<loc>' . $url . '</loc>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<lastmod>' . Format_Time($rsx['updatetime'], 2) . '</lastmod>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<changefreq>' . $changefreg . '</changefreq>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<priority>' . $priority . '</priority>' . vbCrlf(); $c = $c . copyStr(vbTab(), 2) . '</url>' . vbCrlf(); aspEcho('文章', '<a href="' . $url . '">' . $url . '</a>'); } } //单页 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage where isonhtml<>0 order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/page/detail' . $rsx['id']); $url = handleAction($url); } else { $url = '?act=onepage&id=' . $rsx['id']; } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //call echo(cfg_webSiteUrl,url) $c = $c . copyStr(vbTab(), 3) . '<loc>' . $url . '</loc>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<lastmod>' . Format_Time($rsx['updatetime'], 2) . '</lastmod>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<changefreq>' . $changefreg . '</changefreq>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<priority>' . $priority . '</priority>' . vbCrlf(); $c = $c . copyStr(vbTab(), 2) . '</url>' . vbCrlf(); aspEcho('单页', '<a href="' . $url . '">' . $url . '</a>'); } } $c = $c . vbTab() . '</urlset>' . vbCrlf(); loadWebConfig(); createFile('sitemap.xml', $c); aspEcho('生成sitemap.xml文件成功', '<a href=\'/sitemap.xml\' target=\'_blank\'>点击预览sitemap.xml</a>'); //判断是否生成sitemap.html if (@$_REQUEST['issitemaphtml'] == '1') { $c = ''; //第二种 //栏目 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/nav' . $rsx['id']); $url = handleAction($url); } else { $url = escape('?act=nav&columnName=' . $rsx['columnname']); } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //判断是否生成html if ($rsx['isonhtml'] == true) { $s = '<a href="' . $url . '">' . $rsx['columnname'] . '</a>'; } else { $s = '<span>' . $rsx['columnname'] . '</span>'; } $c = $c . '<li style="width:20%;">' . $s . vbCrlf() . '<ul>' . vbCrlf(); //文章 $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where parentId=' . $rsx['id'] . ' order by sortrank asc'); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { if ($rss['nofollow'] == false) { if ($isWebRunHtml == true) { $url = getRsUrl($rss['filename'], $rss['customaurl'], '/detail/detail' . $rss['id']); $url = handleAction($url); } else { $url = '?act=detail&id=' . $rss['id']; } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //判断是否生成html if ($rss['isonhtml'] == true) { $s = '<a href="' . $url . '">' . $rss['title'] . '</a>'; } else { $s = '<span>' . $rss['title'] . '</span>'; } $c = $c . '<li style="width:20%;">' . $s . '</li>' . vbCrlf(); } } $c = $c . '</ul>' . vbCrlf() . '</li>' . vbCrlf(); } } //单面 $c = $c . '<li style="width:20%;"><a href="javascript:;">单面列表</a>' . vbCrlf() . '<ul>' . vbCrlf(); $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/page/detail' . $rsx['id']); $url = handleAction($url); } else { $url = '?act=onepage&id=' . $rsx['id']; } //判断是否生成html if ($rsx['isonhtml'] == true) { $s = '<a href="' . $url . '">' . $rsx['title'] . '</a>'; } else { $s = '<span>' . $rsx['title'] . '</span>'; } $c = $c . '<li style="width:20%;">' . $s . '</li>' . vbCrlf(); // target=""_blank"" 去掉 } } $c = $c . '</ul>' . vbCrlf() . '</li>' . vbCrlf(); $templateContent = ''; $templateContent = getFText($GLOBALS['adminDir'] . '/template_SiteMap.html'); $templateContent = replace($templateContent, '{$content$}', $c); $templateContent = replace($templateContent, '{$Web_Title$}', $GLOBALS['cfg_webTitle']); createFile('sitemap.html', $templateContent); aspEcho('生成sitemap.html文件成功', '<a href=\'/sitemap.html\' target=\'_blank\'>点击预览sitemap.html</a>'); } writeSystemLog('', '保存sitemap.xml'); //系统日志 }