📄 txfiles.asp
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
' TXSite / 通用网站系统
'
' 版本 :v1.8.20
'
' 制作人 :milp(milp@21cn.com)
'
' 版权所有:源码之家(http://www.21tx.com)
'
' 主页地址:http://www.21tx.com
' http://www.bestnets.net
' http://www.soucn.com
'
' 技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
'程序创建时间:16:23 2001-8-14
'程序完成时间:19:38 2001-8-18
'最后修改时间:23:26 2001-9-10
if session("adminflag")="" then Response.Redirect "default.asp"
const thisprog="txfiles.asp"
%>
<!--#include file=base.asp-->
<!--#include file=subs1.asp-->
<%
if session("adminflag")<>1 then Call PrintMsg(NotAdmin)
dim filesArr,action
rSub.open "select content from sitefiles where name='txfiles'",conn,1,1
filesArr=split(rSub("content"),"~")
rSub.close
action=request("action")
if action="" then action="head"
%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="3%"> </td>
<td width="97%">
<p><br><a href=<%=thisprog%>?action=head>页面头部文件和CSS编辑</a> <a href=<%=thisprog%>?action=top>页面顶部文件编辑</a> <a href=<%=thisprog%>?action=menu2>自定义主菜单编辑</a> <a href=<%=thisprog%>?action=left>首页左边文件编辑</a>
<br><a href=<%=thisprog%>?action=bottom>页面底部文件编辑</a> <a href=<%=thisprog%>?action=modwelcome>编辑首页欢迎词</a> <a href=<%=thisprog%>?action=addadv>增加广告代码</a> <a href=<%=thisprog%>?action=modadv>修改删除已有广告代码</a>
<br>
<%if action="head" then%>
<font color=red>页面头部文件和CSS编辑:</font>公用页面<html>到<body>部分
<%elseif action="top" then%>
<font color=red>页面顶部文件编辑:</font>公用页面<body>到顶部广告部分,包括LOGO部分
<%elseif action="menu2" then%>
<font color=red>自定义主菜单编辑:</font>请注意控制宽度,自定义部分在数据库中的根栏目后面显示
<%elseif action="left" then%>
<font color=red>首页左边文件编辑:</font>首页左边部分,在左边的<td width=18%></td>中,注意HTML语法
<%elseif action="bottom" then%>
<font color=red>页面底部文件编辑:</font>必需保留"<b>版本:<a href="http://www.21tx.com" title="Power by 21TX.com">TXSite final</a></b>"部分
<%elseif action="modwelcome" then%>
<font color=red>编辑首页欢迎词:</font>不是数据库中的主栏目都有此信息,注意高度和背景色不要更改,否则与其他页面不配
<%elseif action="addadv" then%>
<font color=red>增加广告代码:</font>
<%elseif action="modadv" then%>
<font color=red>修改删除已有广告代码:</font>
<%end if%>
</p>
</td>
</tr>
</table>
<%
Select Case action
Case "head" Call modfiles(filesArr(1))
Case "top" Call modfiles(filesArr(2))
Case "menu2" Call modfiles(filesArr(4))
Case "modwelcome" Call modfiles(filesArr(6))
Case "left" Call modfiles(filesArr(7))
Case "bottom" Call modfiles(filesArr(8))
Case "addadv" Call addadv()
Case "saveaddadv" Call saveaddadv()
Case "modadv" Call modadv()
Case "savemodadv" Call savemodadv()
Case "deladv" Call deladv()
Case Else Call savefiles()
End Select
%>
<!--#include file=end.asp-->
<%Sub modfiles(filesname)%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<form name=txForm method=post action=<%=thisprog%>?action=save<%=action%>&oldaction=<%=action%>>
<tr>
<td width="3%"> </td>
<td width="97%">
<textarea name="txfiles" cols="85" rows="20" title=可以使用Ctrl+Enter快速提交><%=filesname%></textarea>
</td>
</tr>
<tr>
<td width="3%"> </td>
<td width="97%">
<input type="submit" value="提交">
<input type="reset" value="重置"> <font color=red>[可以使用Ctrl+Enter快速提交]</font>
</td>
</tr>
</form></table>
<%End Sub
Sub addadv()%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<form name=txForm method=post action=<%=thisprog%>?action=save<%=action%>>
<tr>
<td width="3%"> </td>
<td width="97%">
<textarea name="txfiles" cols="85" rows="8" title=可以使用Ctrl+Enter快速提交></textarea>
</td>
</tr>
<tr>
<td width="3%"> </td>
<td width="97%">
<input type="submit" value="提交">
<input type="reset" value="重置"> <font color=red>[可以使用Ctrl+Enter快速提交]</font>
</td>
</tr></form>
</table>
<%End Sub
Sub modadv()
dim i
rSub.open "select content from sitefiles where name='advs'",conn,1,1
if rSub.bof and rSub.eof then PrintMsg("请先添加广告代码!")
%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<form name=txForm method=post action=<%=thisprog%>?action=save<%=action%>>
<%
if rSub("content")<>"" then
if instr(rSub("content"),"|")>0 then
filesArr=split(rSub("content"),"|")
for i = 0 to ubound(filesarr)
%>
<tr>
<td width="3%">广告<%=i%></td>
<td width="97%">
<textarea name="txfiles<%=i%>" cols="70" rows="4" title=可以使用Ctrl+Enter快速提交><%=filesArr(i)%></textarea> <a href=<%=thisprog%>?action=deladv&advid=<%=i%>>删除广告<%=i%></a>
</td>
</tr>
<%
next
else
%>
<tr>
<td width="3%">广告0</td>
<td width="97%">
<textarea name="txfiles" cols="70" rows="4"><%=rSub("content")%></textarea> <a href=<%=thisprog%>?action=deladv&advid=<%=i%>>删除广告0</a>
</td>
</tr>
<%
end if
end if
rSub.close
%>
<tr>
<td width="3%"> </td>
<td width="97%">
<input type="submit" value="提交">
<input type="reset" value="重置"> <font color=red>[可以使用Ctrl+Enter快速提交]</font>
</td>
</tr></form>
</table>
<%End Sub
Sub savefiles()
dim txfiles
txfiles=request.form("txfiles")
if txfiles="" then PrintMsg("修改内容不能为空!")
if instr(txfiles,"~")>0 then PrintMsg("<li>错误提示:您输入的内容中包含非常字符 '~' ")
Select Case action
Case "savehead" filesArr(1)=txfiles
Case "savetop" filesArr(2)=txfiles
Case "savemenu2" filesArr(4)=txfiles
Case "savemodwelcome" filesArr(6)=txfiles
Case "saveleft" filesArr(7)=txfiles
Case "savebottom" filesArr(8)=txfiles
Case Else Call modfiles(headfiles)
End Select
rSub.open "select content from sitefiles where name='txfiles'",conn,1,3
rSub("content")=filesArr(0)+"~"+filesArr(1)+"~"+filesArr(2)+"~"+filesArr(3)+"~"+filesArr(4)+"~"+filesArr(5)+"~"+filesArr(6)+"~"+filesArr(7)+"~"+filesArr(8)
rSub.update
rSub.close
response.redirect ""&thisprog&"?action="&request("oldaction")&""
End Sub
Sub saveaddadv()
dim txfiles
txfiles=request.form("txfiles")
if txfiles="" then PrintMsg("广告内容不能为空!")
if instr(txfiles,"~")>0 then PrintMsg("<li>错误提示:您输入的广告内容中包含非常字符 '|' ")
rSub.open "select * from sitefiles where name='advs'",conn,1,3
if rSub.bof and rSub.eof then
rSub.close
rSub.open "select * from sitefiles",conn,1,3
rSub.addnew
rSub("name")="advs"
rSub("content")=txfiles
else
rSub("content")=rSub("content")+"|"+txfiles
end if
rSub.update
rSub.close
response.redirect ""&thisprog&"?action=modadv"
End Sub
Sub savemodadv()
rSub.open "select * from sitefiles where name='advs'",conn,1,3
if instr(rSub("content"),"|")>0 then
filesArr=split(rSub("content"),"|")
rSub("content")=""
dim i,txfiles(20)
for i = 0 to ubound(filesarr)
txfiles(i)=request.form("txfiles"&i&"")
if txfiles(i)="" then PrintMsg("广告内容不能为空!")
if instr(txfiles(i),"|")>0 then PrintMsg("<li>错误提示:您输入的广告内容中包含非常字符 '|' ")
rSub("content")=rSub("content")&txfiles(i)&"|"
next
rSub("content")=rSub("content")&"|"
rSub("content")=replace(rSub("content"),"||","")
else
dim txfiles1
txfiles1=request.form("txfiles")
rSub("content")=txfiles1
end if
rSub.update
rSub.close
response.redirect ""&thisprog&"?action=modadv"
End Sub
Sub deladv()
dim advid
advid=trim(request("advid"))
rSub.open "select * from sitefiles where name='advs'",conn,1,3
if instr(rSub("content"),"|")>0 then
filesArr=split(rSub("content"),"|")
if advid=0 then
rSub("content")=replace(rSub("content"),filesArr(advid)&"|","")
else
rSub("content")=replace(rSub("content"),"|"&filesArr(advid),"")
end if
rSub.update
else
rSub.delete
end if
rSub.close
response.redirect ""&thisprog&"?action=modadv"
End sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -