📄 cnbbr_admintemplate.asp
字号:
<!-- #include file="SysConfig.asp" -->
<!-- #include file="CheckAdmin.asp" -->
<!-- #include file="../Inc/DataUpdate_Application.asp" -->
<script src="js/CheckAll.js"></script>
<script src="js/DelTrue.js"></script>
<%
Dim TemplateID:TemplateID=CheckStr(Trim(Rst("Tid")))
if not isNum(TemplateID) then TemplateID=0
Dim TemplateAct:TemplateAct=CheckStr(Trim(Request.Form("Act")))
if not isNum(TemplateAct) then TemplateAct=0
Dim TemplatePart,TemplatePartName
TemplatePart=CheckStr(Trim(Rst("Part")))
if not isNum(TemplatePart) then TemplatePart=0
Select Case TemplatePart
Case 0: TemplatePartName="BBR_TemplateTop"
Case 1: TemplatePartName="BBR_TemplateBottom"
Case else: TemplatePartName="BBR_TemplateTop"
End Select
With ReSponse
.Write"<table width=98% border=0 align=center cellpadding=0 cellspacing=0>"& vbcrlf
.Write" <tr> "& vbcrlf
.Write" <td colspan=2 width=100% align=center height=2 class=menutdbg_1></td> "& vbcrlf
.Write" </tr> "& vbcrlf
.Write" <tr height=32> "& vbcrlf
.Write" <td width=100% colspan=2 background=""../Skins/"& SKINS_FOLDER &"/GrayBg.gif""> <img src=""../Skins/"& Skins_Folder &"/Go.gif"" border=""0""><a href=""help.asp"" class=menuColor_1><b>后台管理</b></a>>>> <a href=""Cnbbr_AdminTemplate.asp"" class=menuColor_1><b>系统模板管理</b></a> </td>"& vbcrlf
.Write" </tr>"& vbcrlf
.Write"</table>" & Vbcrlf
if TemplateID=0 then
.Write"<table width=98% border=0 align=center cellpadding=0 cellspacing=0>"& vbcrlf
.Write" <tr> "& vbcrlf
.Write" <td width=100% class=td><input name=deltrue type=button value=""确定删除"" OnClick=""return DelTrue(document.searchform,'del.asp')""> <input name=deltrue type=button value=""添加系统模板"" OnClick=""location.href='Cnbbr_AddTemplate.asp';""></td> "& vbcrlf
.Write" </tr> "& vbcrlf
.Write"</table>" & Vbcrlf
Sql="select * from Cnbbr_Template"
Set Rs=Conn.Execute(Sql)
if Rs.Eof or Rs.Bof then
HelpTitle="出错了!"
HelpInfo="对不起,没有找到任何的系统模板,请先添加!"
HelpList="<Ul>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""Cnbbr_AddTemplate.asp"">添加系统模板</a></LI>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""javascript: history.back(-1);"">返回上页</a></LI>" & Vbcrlf
HelpList=HelpList & "</Ul>" & Vbcrlf
Cnbbr_Helper HelpTitle,HelpInfo,HelpList,368
else
.Write"<table width=98% border=0 align=center cellpadding=0 cellspacing=1 class=tablebg>"& vbcrlf
.Write"<form name=searchform method=post action="""">"& Vbcrlf
.Write" <tr class=titletd> "& vbcrlf
.Write" <td width=3% align=center><input type=""checkbox"" name=""chkAll"" value=""on"" onClick=""CheckAll(this.form)""></td> "& vbcrlf
.Write" <td width=40% align=center>模板名称</td>"& Vbcrlf
.Write" <td width=20% align=center>模板目录</td>"& Vbcrlf
.Write" <td width=20% align=center>模板CSS</td>"& Vbcrlf
.Write" <td width=17% align=center>更新子模块操作</td>"& Vbcrlf
.Write" </tr> "& vbcrlf
Do While not Rs.Eof
.Write" <tr class=td> "& vbcrlf
.Write" <td width=3% align=center><input name=id type=checkbox value="& rs("BBR_TemplateID") &"></td> "& vbcrlf
.Write" <td width=40% align=center><a href=""Cnbbr_EditTemplate.asp?TID="& Rs("BBR_TemplateID") &""">"& Rs("BBR_TemplateName") &"</a></td>"& Vbcrlf
.Write" <td width=20% align=center>"& Rs("BBR_TemplatePath") &"</td>"& Vbcrlf
.Write" <td width=17% align=center><a href=""Cnbbr_AdminTemplateCss.asp?TID="& Rs("BBR_TemplateID") &"&Part=0"">更新模板CSS</a></td>"& Vbcrlf
.Write" <td width=17% align=center><a href=""Cnbbr_AdminTemplate.asp?TID="& Rs("BBR_TemplateID") &"&Part=0"">顶部</a> <a href=""Cnbbr_AdminTemplate.asp?TID="& Rs("BBR_TemplateID") &"&Part=1"">底部</a></td>"& Vbcrlf
.Write" </tr> "& vbcrlf
Rs.MoveNext
Loop
.Write"<input name=act type=hidden value=template>"
.Write"</form>"& Vbcrlf
.Write"</table>" & Vbcrlf
end if
else
Call CheckAdminFlag(TempAdminFlag,3)
Dim Tempii,TempPart,Tempii2,TempPart2
Sql="select * from Cnbbr_Template where BBR_TemplateID="& TemplateID
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open Sql,conn,1,3
if Rs.Eof or Rs.Bof then
HelpTitle="出错了!"
HelpInfo="对不起,没有找到此系统模板,请先添加!"
HelpList="<Ul>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""Cnbbr_AddTemplate.asp"">添加系统模板</a></LI>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""Cnbbr_AdminTemplate.asp"">查看所有系统模板</a></LI>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""javascript: history.back(-1);"">返回上页</a></LI>" & Vbcrlf
HelpList=HelpList & "</Ul>" & Vbcrlf
Cnbbr_Helper HelpTitle,HelpInfo,HelpList,368
else
if TemplateAct=1 then
Dim TempContent,TempUbound,TempSign
TempPart=Rs(TemplatePartName)
TempPart=Split(TempPart,"|||")
TempUbound=ubound(TempPart)
for tempii=0 to TempUbound
tempPart2=tempPart(tempii)
TempPart2=Split(TempPart2,"|@|")
if Tempii<>0 then TempSign="|||"
Dim TempValue
TempValue=CheckStr(Trim(Request.Form("Temp"&Tempii)))
TempValue=Replace(TempValue,"''","'")
if Tempvalue<>"del" then TempContent=TempContent & TempSign & TempPart2(0) & "|@|" & TempValue
next
Dim Tempx
Tempx=CheckStr(Trim(Request.Form("Tempx")))
if inStr(Tempx,"|@|")=0 then Call AlertInfo("模板扩展位置格式有误!请返回重新尝试!","",0)
if lcase(Left(Tempx,13))<>"${bbr_update}" then TempContent=TempContent & "|||" & Vbcrlf & Tempx
Rs(TemplatePartName)=TempContent
Rs.Update
if Err then
Call AlertInfo("模板更新失败!请返回重新尝试!","",0)
else
if TemplatePart=0 then
Application.Lock
Application("Cnbbr_Head")=Cnbbr_Head_Function
Application.UnLock
end if
if TemplatePart=1 then
Application.Lock
Application("Cnbbr_Bottom")=Cnbbr_Bottom_Function
Application.UnLock
end if
HelpTitle="成功了!"
HelpInfo="恭喜你,系统模板信息更新成功!"
HelpList="<Ul>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""Cnbbr_AdminTemplate.asp?Tid="& TemplateID &"&Part="& TemplatePart &""">查看更新后的系统模板</a></LI>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""Cnbbr_AddTemplate.asp"">添加系统模板</a></LI>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""Cnbbr_AdminTemplate.asp"">查看所有系统模板</a></LI>" & Vbcrlf
HelpList=HelpList & "<LI><a href=""javascript: history.back(-1);"">返回上页</a></LI>" & Vbcrlf
HelpList=HelpList & "</Ul>" & Vbcrlf
Cnbbr_Helper HelpTitle,HelpInfo,HelpList,368
end if
else
.Write"<table width=98% border=0 align=center cellpadding=0 cellspacing=1 class=tablebg>"& vbcrlf
.Write"<form name=templateform method=post action="""">"& Vbcrlf
.Write" <tr class=titletd> "& vbcrlf
.Write" <td colspan=2 width=100% align=center>更新系统模板( "& Rs("BBR_TemplateName") &" )</td>"& vbcrlf
.Write" </tr>"& Vbcrlf
.Write" <tr class=td> "& vbcrlf
.Write" <td colspan=2 width=100% height=88 align=left> 操作提醒:<BR>"& Vbcrlf
.Write" 1. 模板顶部位置必须只有两个非子模块${BBR_HeadDef}和${BBR_TopBody}<BR>"& Vbcrlf
.Write" 2. 模板底部位置必须只有一个非子模块${BBR_Bottom}<BR>"& Vbcrlf
.Write" 3. 所有子模块必须在调用该模块的模块之后出现<BR>"& Vbcrlf
.Write" 4. ${BBR_Update}子模块为系统模板扩展模块,当你需要添加子模块时就可以填写在这里,注意,必须保持原默认的格式正确!当添加子模块成功后,系统会自动产生新的扩展子模块,以便继续添加!<BR>"& Vbcrlf
.Write" </td>"& vbcrlf
.Write" </tr>"& Vbcrlf
TempPart=Rs(TemplatePartName)
TempPart=Split(TempPart,"|||")
for tempii=0 to ubound(TempPart)
tempPart2=tempPart(tempii)
TempPart2=Split(TempPart2,"|@|")
for tempii2=1 to ubound(TempPart2) step 2
.Write" <tr class=td> "& vbcrlf
.Write" <td width=30% align=center>模块Template("& Tempii &")<BR><BR>"& TempPart2(Tempii2-1) &"</td>"& vbcrlf
.Write" <td width=70% align=center><textarea name=temp"& Tempii &" cols=60 rows=6>"& TempPart2(Tempii2) &"</textarea></td>"& vbcrlf
.Write" </tr>"& Vbcrlf
next
next
.Write" <tr class=td> "& vbcrlf
.Write" <td width=30% align=center>模板扩展位置Template(x)<BR><BR>默认变量${BBR_Update}</td>"& vbcrlf
.Write" <td width=70% align=center>"& Vbcrlf
.Write" <textarea name=tempx cols=60 rows=6>"& Vbcrlf
.Write"${BBR_Update}|@|"& Vbcrlf
.Write Vbcrlf
.Write" <!-- 模板扩展位置 -->"& Vbcrlf
.Write" <!-- 注意:格式必须正确,BBR_Update为子模块变量名 -->"& Vbcrlf
.Write" <!-- 注意:BBR_Update必须更改为其它名称才能生效! -->"& Vbcrlf
.Write" </textarea>"& Vbcrlf
.Write" </td>"& vbcrlf
.Write" </tr>"& Vbcrlf
.Write" <tr class=titletd> "& vbcrlf
.Write" <td colspan=2 width=100% align=center><input name=tid type=hidden value="& TemplateID &"><input name=Part type=hidden value="& TemplatePart &"><input name=act type=hidden value=1><input name=submit type=submit value=""更新系统模板信息""> <input name=back type=button value=""返回模板列表"" onclick=""location.href='Cnbbr_AdminTemplate.asp';""></td>"& vbcrlf
.Write" </tr>"& Vbcrlf
.Write"</form>"& Vbcrlf
.Write"</table>" & Vbcrlf
end if
End if
end if
End With
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -