📄 ad_layout.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=0
Const PurviewLevel_Others="Layout"
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/ubbcode.asp"-->
<%
dim rs, sql
dim Action,LayoutID,LayoutType,FoundErr,ErrMsg
Action=trim(request("Action"))
LayoutID=trim(request("LayoutID"))
LayoutType=trim(request("LayoutType"))
if LayoutType="" then
LayoutType=session("LayoutType")
end if
if LayoutType="" then
LayoutType=2
else
LayoutType=CLng(LayoutType)
end if
session("LayoutType")=LayoutType
%>
<html>
<head>
<title>版面设计模板管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="ad_Style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="topbg">
<td height="22" colspan="2" align="center"><strong>版 面 设 计 模 板 管 理</strong></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td><a href="ad_Layout.asp?Action=Add">添加版面设计模板</a> | <a href="ad_Layout.asp?LayoutType=2">文章栏目模板</a>
| <a href="ad_Layout.asp?LayoutType=3">文章内容页模板</a> | <a href="ad_Layout.asp?LayoutType=4">专题文章模板</a>
| <a href="ad_Layout.asp?LayoutType=5">软件栏目模板</a> | <a href="ad_Layout.asp?LayoutType=6">图片栏目模板</a></td>
</tr>
</table>
<%
select case Action
case "Add","Modify"
call ShowLayoutSet()
case "SaveAdd"
call SaveAdd()
case "SaveModify"
call SaveModify()
case "Set"
call SetDefault()
case "Del"
call DelLayout()
case else
call main()
end select
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
sql="select * from Layout where LayoutType=" & LayoutType
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,1
%>
<form name="form1" method="post" action="">
<%
response.write "您现在的位置:版面设计模板管理 >> <font color=red>"
select case LayoutType
case 2
response.write "文章栏目模板"
case 3
response.write "文章内容页模板"
case 4
response.write "专题文章模板"
case 5
response.write "软件栏目模板"
case 6
response.write "图片栏目模板"
case else
response.write "错误的参数"
end select
response.write "</font><br>"
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr class="title">
<td width="30" align="center"><strong>选择</strong></td>
<td width="30" align="center"><strong>ID</strong></td>
<td height="22" align="center"><strong> 模板名称</strong></td>
<td width="100" align="center"><strong>模板文件名</strong></td>
<td width="150" align="center"><strong>效果图</strong></td>
<td width="60" align="center"><strong>设计者</strong></td>
<td width="60" align="center"><strong>模板类型</strong></td>
<td width="150" height="22" align="center"><strong> 操作</strong></td>
</tr>
<%if not(rs.bof and rs.eof) then
do while not rs.EOF %>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width="30" align="center"><input type="radio" value="<%=rs("LayoutID")%>" <%if rs("IsDefault")=true then response.write " checked"%> name="LayoutID"></td>
<td width="30" align="center"><%=rs("LayoutID")%></td>
<td align="center"><%=rs("LayoutName")%></td>
<td width="100" align="center"><%=rs("LayoutFileName")%></td>
<td width="150" align="center"><%response.write "<a href='ad_Layout.asp?Action=Prview&LayoutID=" & rs("LayoutID") & "' title='点此查看原始效果图'><img src='" & rs("PicUrl") & "' width=100 height=30 border=0></a>"%></td>
<td width="60" align="center"><%response.write "<a href='mailto:" & rs("DesignerEmail") & "' title='设计者信箱:" & rs("DesignerEmail") & vbcrlf & "设计者主页:" & rs("DesignerHomepage") & "'>" & rs("DesignerName") & "</a>"%></td>
<td width="60" align="center"><%if rs("DesignType")=1 then response.write "用户自定义" else response.write "系统提供"%></td>
<td width="150" align="center"><%
response.write "<a href='ad_Layout.asp?Action=Modify&LayoutID=" & rs("LayoutID") & "'>修改模板设置</a> "
if rs("DesignType")=1 and rs("IsDefault")=False then
response.write "<a href='ad_Layout.asp?Action=Del&LayoutID=" & rs("LayoutID") & "' onClick=""return confirm('确定要删除此版面设计模板吗?删除此版面设计模板后原使用此版面设计模板的文章将改为使用系统默认版面设计模板。');"">删除模板</a>"
else
response.write " "
end if
%> </td>
</tr>
<%
rs.MoveNext
loop
%>
<tr class="tdbg">
<td colspan="8" align="center"><input name="LayoutType" type="hidden" id="LayoutType" value="<%=LayoutType%>">
<input name="Action" type="hidden" id="Action" value="Set"> <input type="submit" name="Submit" value="将选中的模板设为默认模板"></td>
</tr>
<%end if%>
</table>
</form>
<%
rs.close
set rs=nothing
end sub
sub ShowLayoutSet()
if Action="Add" then
sql="select * from Layout where IsDefault=True and LayoutType=" & LayoutType
elseif Action="Modify" then
if LayoutID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定LayoutID</li>"
exit sub
else
LayoutID=Clng(LayoutID)
end if
sql="select * from Layout where LayoutID=" & LayoutID
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,1
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>数据库出现错误!</li>"
rs.close
set rs=nothing
exit sub
end if
%>
<form name="form1" method="post" action="ad_Layout.asp">
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="border">
<tr align="center" class="title">
<td height="22" colspan="2"><strong>
<%if Action="Add" then%>
添加新版面设计模板
<%else%>
修改模板设置
<%end if%>
</strong></td>
</tr>
<tr class="topbg">
<td height="20" colspan="2"><strong>版面设计模板基本信息</strong></td>
</tr>
<tr class="tdbg">
<td width="40%"><strong>模板类型:</strong></td>
<td><%if Action="Modify" then%>
<input name="LayoutType" type="hidden" id="LayoutType" value="<%=rs("LayoutType")%>">
<%end if%> <select name="LayoutType" id="LayoutType" <%if Action="Modify" then response.write "disabled"%>>
<option value="2" <%if rs("LayoutType")=2 then response.write " selected"%>>文章栏目模板</option>
<option value="3" <%if rs("LayoutType")=3 then response.write " selected"%>>文章内容页模板</option>
<option value="4" <%if rs("LayoutType")=4 then response.write " selected"%>>专题文章模板</option>
<option value="5" <%if rs("LayoutType")=5 then response.write " selected"%>>软件栏目模板</option>
<option value="6" <%if rs("LayoutType")=6 then response.write " selected"%>>图片栏目模板</option>
</select></td>
</tr>
<tr class="tdbg">
<td width="40%"><strong>版面设计模板名称:</strong></td>
<td><%if Action="Modify" and rs("DesignType")=0 then%>
<input name="LayoutName" type="hidden" id="LayoutName" value="<%=rs("LayoutName")%>">
<%=rs("LayoutName")%>
<%else%>
<input name="LayoutName" type="text" id="LayoutName" value="<%if Action="Modify" then response.write rs("LayoutName")%>" size="50" maxlength="50">
<%end if%> </td>
</tr>
<tr class="tdbg">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -