function displayTemplatesList($content) { $templatesFolder = ''; $templatePath = ''; $templatePath2 = ''; $templateName = ''; $defaultList = ''; $folderList = ''; $splStr = ''; $s = ''; $c = ''; $s1 = ''; $s2 = ''; $s3 = ''; $splTemplatesFolder = ''; //加载网址配置 loadWebConfig(); $defaultList = getStrCut($content, '[list]', '[/list]', 2); $splTemplatesFolder = aspSplit('/Templates/|/Templates2015/|/Templates2016/', '|'); foreach ($splTemplatesFolder as $key => $templatesFolder) { if ($templatesFolder != '') { $folderList = getDirFolderNameList($templatesFolder); $splStr = aspSplit($folderList, vbCrlf()); foreach ($splStr as $key => $templateName) { if ($templateName != '' && inStr('#_', left($templateName, 1)) == false) { $templatePath = $templatesFolder . $templateName; $templatePath2 = $templatePath; $s = $defaultList; $s1 = getStrCut($content, '<!--启用 start-->', '<!--启用 end-->', 2); $s2 = getStrCut($content, '<!--恢复数据 start-->', '<!--恢复数据 end-->', 2); $s3 = getStrCut($content, '<!--删除模板 start-->', '<!--删除模板 end-->', 2); if (lCase($GLOBALS['cfg_webtemplate']) == lCase($templatePath)) { $templateName = '<font color=red>' . $templateName . '</font>'; $templatePath2 = '<font color=red>' . $templatePath2 . '</font>'; $s = replace(replace($s, $s1, ''), $s3, ''); } else { $s = replace($s, $s2, ''); } $s = replaceValueParam($s, 'templatename', $templateName); $s = replaceValueParam($s, 'templatepath', $templatePath); $s = replaceValueParam($s, 'templatepath2', $templatePath2); $c = $c . $s . vbCrlf(); } } } } $content = replace($content, '[list]' . $defaultList . '[/list]', $c); $displayTemplatesList = $content; return @$displayTemplatesList; }
function adminIndex() { $c = ''; loadWebConfig(); $c = getTemplateContent('adminIndex.html'); $c = replace($c, '[$adminonemenulist$]', getAdminOneMenuList()); $c = replace($c, '[$adminmenulist$]', getAdminMenuList()); $c = replace($c, '[$officialwebsite$]', getOfficialWebsite()); //获得官方信息 $c = replaceValueParam($c, 'title', ''); //给手机端用的20160330 $c = handleDisplayLanguage($c, 'loginok'); Rw($c); }
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'); //系统日志 }