提交 df698871 编写于 作者: xiyueta's avatar xiyueta

submit 2023-08-24

上级 6b6d9167
<!--#include file="../../../inc/Config.asp"--><!--#Include File = "../../admin_function.asp"--><!--#Include File = "../../admin_safe.Asp"--><%
'网站模板处理核心文件 xiyueta202308'
call openconn()
dim num,page,stemp,sql1,sql,mysql,currentPage,perpage,page_count,i,n,sS,sHr,totalrec,id,title,isDebug,s,tplname,url,thisV
thisV=1 '当前页版本号'
isDebug=false '调试为假,则不显示信息'
'获得当前版本号与账号,与服务器端匹配'
dim serverUrl,webinfo
webinfo=request.serverVariables("SERVER_NAME")
rs.open "select username,version,resurl,tplname from " & db_PREFIX & "website" ,conn,1,1
if not rs.eof then
webinfo=webinfo&"@"&rs("username")&"@"&rs("version")
'服务器地址'
serverUrl=rs("resurl") '资源服务器地址'
tplname=rs("tplname") '当前使用模板名'
end if:rs.close
if serverUrl="" then serverUrl=getServerUrl()
' call echo("webinfo",webinfo)
' call echo("serverUrl",serverUrl)
' call die("end")
webinfo=escape(webinfo)'转码'
'获得服务器地址,并更新'
function getServerUrl()
dim c,url
c="{resurl:'http://res/'}"
c=gethttpurl("http://xiyueta.com/api/cms/?act=resurl&info="&webinfo,"utf-8") '获得服务器对应资源地址'
if instr(c,"{resurl:'")>0 then
url=strcut(c,"{resurl:'","'}",0)
if url<>"" then
conn.execute("update " & db_PREFIX & "website set resurl='"& url &"'") '更新资源地址'
end if
end if
getServerUrl=url
end function
function updateTemplatePage()
dim updatePath
updatePath="userlist.asp"
call deleteFile(updatePath) '先删除'
if checkfile(updatePath)=false then
url=serverUrl & "/api/tpl/update/?act=userlistasp"
' call echo("url",url)
call saveRemoteFile(url,updatePath)
end if
call die("{""info"": ""更新模板完成update.asp"",""status"": ""y""}")
end function
call updateTemplatePage()
%>
\ No newline at end of file
<!--#include file="../../../inc/Config.asp"--><!--#Include File = "../../admin_function.asp"--><!--#Include File = "../../admin_safe.Asp"--><%
'网站模板处理核心文件'
<!--#include file="../../../inc/Config.asp"--><!--#Include File = "../../admin_function.asp"--><!--#Include File = "../../admin_safe.Asp"--><%
'网站模板处理核心文件 xiyueta2023'
call openconn()
dim num,page,stemp,sql1,sql,mysql,currentPage,perpage,page_count,i,n,sS,sHr,totalrec,id,title,isDebug,s,tplname,url
dim num,page,stemp,sql1,sql,mysql,currentPage,perpage,page_count,i,n,sS,sHr,totalrec,id,title,isDebug,s,tplname,url,thisV
thisV=2 '当前页版本号'
isDebug=false '调试为假则不显示信息'
'获得当前版本号与账号与服务器端匹配'
......@@ -253,7 +254,7 @@ end function
If Request("act") = "list" Then
dim updateusername,sListStr,splVersion
' call eerr("url",serverUrl & "/api/tpl/list/?info="&webinfo)
sListStr=gethttpurl(serverUrl & "/api/tpl/list/?info="&webinfo&"&tplname="&tplname&"&key="&escape(request("key"))&"&order="&escape(request("orderBy"))&"&page="&request("page"),"utf-8")
sListStr=gethttpurl(serverUrl & "/api/tpl/list/?info="&webinfo&"&tplname="&tplname&"&thisv="& thisV &"&key="&escape(request("key"))&"&order="&escape(request("orderBy"))&"&page="&request("page"),"utf-8")
'服务器地址错误时,重复获得地址,并更新资源地址'
if instr(sListStr,"count"":")=false then
......@@ -299,8 +300,25 @@ elseIf Request("act") = "editusername" Then '获得用户信息20230819'
call die("{""info"": ""修改失败,域名对应的账号不正确"",""status"": ""n""}")
end if
elseIf Request("act") = "update" Then '更新模板程序20230823
call updateTemplatePage()
End If
function updateTemplatePage()
dim updatePath
updatePath="update.asp"
if checkfile(updatePath)=false then
url=serverUrl & "/api/tpl/update/?act=updatepage"
' call echo("url",url)
call saveRemoteFile(url,updatePath)
end if
if checkfile(updatePath) then
response.redirect("update.asp")
end if
call die("{""info"": ""更新模板完成"",""status"": ""y""}")
end function
%>
......@@ -413,8 +431,31 @@ layui.use(['form','table'],function(){
page: true,
limit: 20,
done: function(res, curr, count) {
console.log(res)
// console.log(res)
$("#myuser",).text("积分:"+res.money)
if(res.isUpdateTemplatePage!=undefined){
layer.confirm('已经有新版模板更新程序,是否更新?', function(index) {
layer.close(index);
var layerIndex = layer.msg('正在处理更新模板程序,请等待!', { icon: 16, time: false, shade: 0.8 });
$.ajax({
type: "POST",
cache: true,
dataType: "json",
url: "?act=update",
data: { },
success: function(data) {
switch (data.status) {
case "y":
layer.msg(data.info);
location.reload();
break;
}
}
});
});
}
// alert("加载完成")
// 表格加载完成后执行其他动作
// res 为接口返回的数据
......
......@@ -40,7 +40,7 @@ totalUser=conn.execute("select count(*) from["&db_PREFIX&"member]")(0)
<head>
<meta charset="utf-8">
<title>layuiAdmin 主页示例模板二</title>
<title>主页</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
......@@ -168,7 +168,7 @@ for each folderName in splstr
<span class="flow">
<a href="<%=" https://www.xiyueta.com/tpl/" & folderName & "/" %>" target="_blank" class="layui-btn layui-btn-xs ">
<a href="<%="/tpl/" & folderName & "/" %>" target="_blank" class="layui-btn layui-btn-xs ">
查看
</a>
</span>
......
......@@ -10,7 +10,7 @@
call openconn()
dim nav,i,j,webtitle,webkeywords,webdescription,weblogo,webbiglogo,webqrcode,id,aboutcontent,bodycontent,parentid,webcopyright,webfoot,pageUrl,columnType,thisUrlFileName,navId,title,createTime,author,n,idList,columnName,columnEnName,bigimage,smallImage,views,webqq,webphone,webtel,webfax,webweixin,webemail,webaddress,webFileName,pageType,ennav,cssName,resurl,webcompany,webcompanyen,weburl,websql
dim addSql,bannerimage,asporhtml,onAutoAddDataToAccess,fabulous,tags,detailPagingTypeList
dim addSql,bannerimage,asporhtml,onAutoAddDataToAccess,fabulous,tags,detailPagingTypeList,sUrl
asporhtml=true '静态网页为真'0为asp 1为html
onAutoAddDataToAccess=true '开启自动添加数组到数据库里(主要是对onepage操作)20220602'
......@@ -279,19 +279,17 @@ function getNavUrl(navid,navtype)
end if
if navtype="home" then
url="./"
url=urlAddDiQu("./")
elseif navtype="text" then '这个是自定义,系统已经设置好了
if asporhtml=true then
url="about_" & id & ".html"
url=urlAddDiQu("about_" & id & ".html")
else
url="about.asp?id="&id
url=urlAddDiQu("about.asp?id="&id)
end if
elseif asporhtml=true then
url=navtype & "_" & id & ".html"
url=urlAddDiQu(navtype & "_" & id & ".html")
else
url=navtype & ".asp?id="&id
url=urlAddDiQu(navtype & ".asp?id="&id)
end if
getNavUrl=urlWanZhen(url)
end function
......@@ -307,11 +305,11 @@ function getNavGoToUrl(navid,navtype)
end if
if navtype="home" then
url="./"
url=urlWanZhen("./")
elseif navtype="text" then
url="about.asp?id="&navid
url=urlWanZhen("about.asp?id="&navid)
else
url=navtype & ".asp?id="&navid
url=urlWanZhen(navtype & ".asp?id="&navid)
end if
getNavGoToUrl=url
end function
......@@ -372,11 +370,11 @@ function getArticleUrl(id)
'为动态网站时,直接显示㚃'
if asporhtml=false then
getArticleUrl=urlWanZhen(columntype & "detail.asp?id="&id)
getArticleUrl=urlWanZhen( urlAddDiQu(columntype & "detail.asp?id="&id) )
exit function
end if
' call echo(parentid,columntype)
getArticleUrl=urlWanZhen(dirName & columntype & "detail_"& id &".html")
getArticleUrl=urlWanZhen( urlAddDiQu(dirName & columntype & "detail_"& id &".html") )
end function
......
......@@ -120,14 +120,12 @@ end function
'排除指定域名 '
' if webDoMain()="http://demo.xiyueta.com" then
' if instr(webDoMain(),"xiyueta.com")>0 then
' '不同IP显示不同内容'
' if getIP()<>"127.0.0.1" then
' MDBPath = "/data/data_" & getIP() &".mdb"
' if checkFile(MDBPath)=false then
' call copyFile("/data/data.mdb",MDBPath)
' end if
' end if
' end if
'指定域名做不同IP显示不同网站'
if instr(webDoMain(),"xiyueta.com")>0 then
'不同IP显示不同内容'
MDBPath = "/data/data_" & getIP() &".mdb"
if checkFile(MDBPath)=false then
call copyFile("/data/data.mdb",MDBPath)
end if
end if
%>
\ No newline at end of file
<%
dim uDomain,uTitle,dataPrefix,myDomain,splDiQu,cDiQu,nI,diqu
'以域名来区分 如 beijin.xiyueta.com'
myDomain="" '网站域名 最好是手动设置一个名称:如 test.net
if myDomain="" then myDomain=getHnaldeMyDomain() '获得处理后的当前域名' 如果没有设置一个域名,则提取当前域名
dim isDomainOrUrlSuffix:isDomainOrUrlSuffix="suffix" 'domain suffix'
uDomain=request.serverVariables("SERVER_NAME")
dataPrefix=replace(uDomain,myDomain,"")
if isDomainOrUrlSuffix="domain" then
'以域名来区分 如 beijin.xiyueta.com'
'网站域名 最好是手动设置一个名称:如 test.net
if myDomain="" then myDomain=getHnaldeMyDomain() '获得处理后的当前域名' 如果没有设置一个域名,则提取当前域名
if dataPrefix<>"" then
uTitle=getSheShiToCn(mid(dataPrefix,1,len(dataPrefix)-1)) '获得省市拼音对应的中文
end if
if uTitle="" then
if dataPrefix="test.com.cn.net" or 1=1 then
dataPrefix=""
else
call die(uDomain & "网站正在制作中。。。" & dataPrefix)
uDomain=request.serverVariables("SERVER_NAME")
dataPrefix=replace(uDomain,myDomain,"")
if dataPrefix<>"" then
uTitle=getSheShiToCn(mid(dataPrefix,1,len(dataPrefix)-1)) '获得省市拼音对应的中文
end if
if uTitle="" then
if dataPrefix="test.com.cn.net" or 1=1 then
dataPrefix=""
else
call die(uDomain & "网站正在制作中。。。" & dataPrefix)
end if
end if
else
diqu=request("diqu")
if diqu<>"" then
uTitle=getSheShiToCn(diqu)
end if
' call echo("diqu",diqu)
' call echo("uTitle",uTitle)
end if
diqu=request("diqu")
if diqu<>"" then
uTitle=getSheShiToCn(diqu)
end if
'处理URL里加上地区 20230824'
function urlAddDiQu(url)
if diqu<>"" and url<>"" then
if asporhtml=true then
if left(url,2)="./" then
url=mid(url,3)
end if
url=diqu & "-" & url
else
if instr(url,"?")>0 then
url=url & "&diqu=" & diqu
else
url=url & "?diqu=" & diqu
end if
end if
end if
urlAddDiQu=url
end function
'获得省市链接的网址'
function SheShiUrl(s)
......@@ -43,7 +70,7 @@ function getSheShiToCn(s)
getSheShiToCn=rs("columnName")
end if:rs.close
end function
'获得处理后的域名'
'获得处理后的域名 如 aaa.xiyueta.com 获得 xiyueta.com'
function getHnaldeMyDomain()
dim url,splxx
url=getUrl()
......
......@@ -19,122 +19,102 @@
<rule name="tags2">
<match url="^tags_([a-zA-Z0-9-\u4e00-\u9fa5]*).html$" />
<action type="Rewrite" url="/tags.asp?tag={R:1}" />
</rule>
</rule>
<rule name="tagspage">
<match url="^tags_([a-zA-Z0-9-\u4e00-\u9fa5]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tags.asp?tag={R:1}&amp;page={R:2}" />
</rule>
</rule>
<rule name="search2">
<match url="^search_([a-zA-Z0-9-\u4e00-\u9fa5]*).html$" />
<action type="Rewrite" url="/search.asp?keyboard={R:1}" />
</rule>
</rule>
<rule name="searchpage">
<match url="^search_([a-zA-Z0-9-\u4e00-\u9fa5]*)_([0-9]*).html$" />
<action type="Rewrite" url="/search.asp?keyboard={R:1}&amp;page={R:2}" />
</rule>
<rule name="column1">
<match url="^about_([0-9]*).html$" />
<action type="Rewrite" url="/about.asp?id={R:1}" />
</rule>
<rule name="defaultpage">
<match url="^page_([0-9]*).html$" /> <!--首页翻页-->
<action type="Rewrite" url="/default.asp?page={R:1}" />
</rule>
<!-- 地区首页 /sichuan-./ 也可以 -->
<rule name="diqudefaultpage">
<match url="^([a-zA-Z]*)-$" />
<action type="Rewrite" url="/default.asp?diqu={R:1}" />
</rule>
<!-- 大类页 -->
<rule name="column2">
<match url="^news_([0-9]*).html$" />
<action type="Rewrite" url="/news.asp?id={R:1}" />
<match url="^([a-zA-Z]*)_([0-9]*).html$" />
<action type="Rewrite" url="/{R:1}.asp?id={R:2}" />
</rule>
<rule name="column3">
<match url="^product_([0-9]*).html$" />
<action type="Rewrite" url="/product.asp?id={R:1}" />
<!-- 地区大类页-->
<rule name="diqucolumn2">
<match url="^([a-zA-Z]*)-([a-zA-Z]*)_([0-9]*).html$" />
<action type="Rewrite" url="/{R:2}.asp?diqu={R:1}&amp;id={R:3}" />
</rule>
<rule name="column4">
<match url="^case_([0-9]*).html$" />
<action type="Rewrite" url="/case.asp?id={R:1}" />
</rule>
<rule name="column5">
<match url="^guestbook_([0-9]*).html$" />
<action type="Rewrite" url="guestbook.asp?id={R:1}" />
</rule>
<!-- 大类列表翻页 -->
<rule name="column2page">
<match url="^news_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/news.asp?id={R:1}&amp;page={R:2}" />
</rule>
<rule name="column3page">
<match url="^product_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/product.asp?id={R:1}&amp;page={R:2}" />
</rule>
<rule name="column4page">
<match url="^case_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/case.asp?id={R:1}&amp;page={R:2}" />
</rule>
<rule name="case_detail">
<match url="^case_detail_([0-9]*).html$" />
<action type="Rewrite" url="/case_detail.asp?id={R:1}" />
</rule>
<rule name="news_detail">
<match url="^news_detail_([0-9]*).html$" />
<action type="Rewrite" url="/news_detail.asp?id={R:1}" />
</rule>
<rule name="product_detail">
<match url="^product_detail_([0-9]*).html$" />
<action type="Rewrite" url="/product_detail.asp?id={R:1}" />
<match url="^([a-zA-Z]*)_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/{R:1}.asp?id={R:2}&amp;page={R:3}" />
</rule>
<!-- 地区大类列表翻页 -->
<rule name="diqucolumn2page">
<match url="^([a-zA-Z]*)-([a-zA-Z]*)_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/{R:2}.asp?id={R:3}&amp;page={R:4}&amp;diqu={R:1}" />
</rule>
<!-- 文章详细页 -->
<rule name="detail1">
<match url="^detail_([0-9]*).html$" />
<action type="Rewrite" url="/detail.asp?id={R:1}" />
</rule>
<!-- 地区文章详细页 -->
<rule name="diqudetail1">
<match url="^([a-zA-Z]*)-detail_([0-9]*).html$" />
<action type="Rewrite" url="/{R:1}-detail.asp?id={R:2}" />
</rule>
<rule name="testcolumn1">
<match url="^tpl/([a-zA-Z0-9]*)/about_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/about.asp?id={R:2}" />
</rule>
<rule name="testcolumn2">
<match url="^tpl/([a-zA-Z0-9]*)/news_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/news.asp?id={R:2}" />
</rule>
<rule name="testcolumn3">
<match url="^tpl/([a-zA-Z0-9]*)/product_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/product.asp?id={R:2}" />
</rule>
<rule name="testcolumn4">
<match url="^tpl/([a-zA-Z0-9]*)/case_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/case.asp?id={R:2}" />
<!-- TPL地区首页 /sichuan-./ 也可以 -->
<rule name="tpldiqudefaultpage">
<match url="^tpl/([a-zA-Z0-9]*)/([a-zA-Z]*)-$" />
<action type="Rewrite" url="/tpl/{R:1}/default.asp?diqu={R:2}" />
</rule>
<!-- TPL大类页 -->
<rule name="tplcolumn2">
<match url="^tpl/([a-zA-Z0-9]*)/([a-zA-Z]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/{R:2}.asp?id={R:3}" />
</rule>
<!-- TPL地区大类页-->
<rule name="tpldiqucolumn2">
<match url="^tpl/([a-zA-Z0-9]*)/([a-zA-Z]*)-([a-zA-Z]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/{R:3}.asp?diqu={R:2}&amp;id={R:4}" />
</rule>
<!-- TPL大类列表翻页 -->
<rule name="tplcolumn2page">
<match url="^tpl/([a-zA-Z0-9]*)/([a-zA-Z]*)_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/{R:2}.asp?id={R:3}&amp;page={R:4}" />
</rule>
<rule name="testcolumn5">
<match url="^tpl/([a-zA-Z0-9]*)/guestbook_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/guestbook.asp?id={R:2}" />
</rule>
<rule name="testcolumn2page">
<match url="^tpl/([a-zA-Z0-9]*)/news_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/news.asp?id={R:2}&amp;page={R:3}" />
</rule>
<rule name="testcolumn3page">
<match url="^tpl/([a-zA-Z0-9]*)/product_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/product.asp?id={R:2}&amp;page={R:3}" />
</rule>
<rule name="testcolumn4page">
<match url="^tpl/([a-zA-Z0-9]*)/case_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/case.asp?id={R:2}&amp;page={R:3}" />
<!-- TPL地区大类列表翻页 -->
<rule name="tpldiqucolumn2page">
<match url="^tpl/([a-zA-Z0-9]*)/([a-zA-Z]*)-([a-zA-Z]*)_([0-9]*)_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/{R:3}.asp?id={R:4}&amp;page={R:5}&amp;diqu={R:2}" />
</rule>
<rule name="testdetail1">
<!-- TPL文章详细页 -->
<rule name="tpldetail1">
<match url="^tpl/([a-zA-Z0-9]*)/detail_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/detail.asp?id={R:2}" />
</rule>
<!-- TPL地区文章详细页 -->
<rule name="tpldiqudetail1">
<match url="^tpl/([a-zA-Z0-9]*)/([a-zA-Z]*)-detail_([0-9]*).html$" />
<action type="Rewrite" url="/tpl/{R:1}/{R:2}-detail.asp?id={R:3}" />
</rule>
</rules>
</rewrite>
<defaultDocument>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册