📄 admin_mb_add.asp
字号:
<!--#include file = admin_chk.asp -->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
<script src="Include/Common.js" type="text/javascript"></script>
</head>
<%
If Not ChkAdmin("Template") Then
Call ArtErr("","")
End If
Dim Action
Action = LCase(Request("action"))
Select Case Trim(Action)
Case "savemb"
Call savemb()
Case Else
Call mbmain()
End Select
Sub savemb()
title=trim(request("title"))
midd=trim(request("mid"))
id=trim(request("id"))
list=trim(request("list"))
so=trim(request("so"))
lx=trim(request("lx"))
listshu=trim(request("listshu"))
tb=trim(Request("tb"))
lmname=trim(request("lmname"))
newshit=trim(request("newshit"))
newstime=trim(request("newstime"))
open=trim(request("open"))
updown=trim(request("updown"))
icon=trim(request("icon"))
listtumb=trim(Request("listtumb"))
picw=trim(Request("picw"))
pich=trim(Request("pich"))
picx=trim(Request("picx"))
picy=trim(Request("picy"))
pictitle=trim(Request("pictitle"))
pictitlecolor=trim(Request("pictitlecolor"))
pictitlesize=trim(Request("pictitlesize"))
copen=trim(request("copen"))
ccount=trim(request("ccount"))
ccolor=trim(request("ccolor"))
csize=trim(request("csize"))
tbold=trim(request("tbold"))
tface=trim(request("tface"))
tcolor=trim(request("tcolor"))
tsize=trim(request("tsize"))
pl=trim(request("pl"))
moreline=trim(request("moreline"))
plfb=trim(request("plfb"))
if open="" then open=1
if lx="" then lx=2
if title<>"" or midd<>"" then
if id<>"" then
sql = "select top 1 * from newsmb where id="&id
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,2
else
sql = "select top 1 * from newsmb"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,2
rs.addnew
end if
rs("title")=title
rs("top")=" "
rs("mid")=midd
rs("down")=" "
rs("listmb")=list
rs("somb")=so
rs("list")=listshu
rs("lx")=lx
rs("tb")=tb
rs("lmname")=lmname
rs("newshit")=newshit
rs("newstime")=newstime
rs("openwindow")=open
rs("updown")=updown
rs("icon")=icon
rs("listtumb")=listtumb
rs("picw")=picw
rs("pich")=pich
rs("picx")=picx
rs("picy")=picy
rs("pictitle")=pictitle
rs("pictitlecolor")=pictitlecolor
rs("pictitlesize")=pictitlesize
rs("pl")=pl
rs("moreline")=moreline
rs("plfb")=plfb
rs("copen")=copen
if copen="1" then
rs("ccount")=ccount
rs("ccolor")=ccolor
rs("csize")=csize
rs("tbold")=tbold
rs("tface")=tface
rs("tcolor")=tcolor
rs("tsize")=tsize
end if
rs.update
rs.close:set rs=nothing
ShowErr=ShowErr & "<br><li>您提交的设置已保存。</li>"
'if id<>"" and config("listHtml")=0 then
'sql2="select * from lm where mb="&id&" order by id desc"
'set rs=server.createObject("ADODB.Recordset")
' rs.open sql2,conn,1,1
'do while not rs.eof
'lm_path=rs("lm_path")
'lmid =rs("id")
' Dim HtmlName2: HtmlName2=config("path")&"html/"&lm_path&"/index.html"
' Dim html_index_fileName :html_index_fileName=config("path")&"news_more.asp?lm="&lmid&""
'if SaveHtmlFile(HtmlName2,html_index_fileName) then
' ShowErr=ShowErr & "<br><li>更新"&HtmlName2&"文件成功!</li>"
' else
'ShowErr=ShowErr & "<br><li>更新"&HtmlName2&"文件失败!</li>"
'end if
'rs.movenext
'loop
' rs.close:set rs=nothing
'end if
end if
call Succeed (ShowErr,"admin_mb.asp")
end sub
Sub mbmain()
id=trim(request("id"))
lx=trim(request("lx"))
if lx="" then lx=1
if id<>"" then
sql = "select * from newsmb where id="&id
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
title=rs("title")
midd=rs("top")+rs("mid")+rs("down")
listmb=rs("listmb")
listshu=rs("list")
somb=rs("somb")
tb=rs("tb")
picw=rs("picw")
pich=rs("pich")
picx=rs("picx")
picy=rs("picy")
pictitle=rs("pictitle")
pictitlecolor=rs("pictitlecolor")
pictitlesize=rs("pictitlesize")
lmname=rs("lmname")
newshit=rs("newshit")
newstime=rs("newstime")
open=rs("openwindow")
updown=rs("updown")
icon=rs("icon")
listtumb=rs("listtumb")
copen=rs("copen")
ccount=rs("ccount")
ccolor=rs("ccolor")
csize=rs("csize")
tbold=rs("tbold")
tface=rs("tface")
tcolor=rs("tcolor")
tsize=rs("tsize")
pl=rs("pl")
moreline=rs("moreline")
plfb=rs("plfb")
rs.close:set rs=nothing
else
'属于新的情况时,则默认值
picw=100
pich=100
picx=4
picy=2
pictitle=18
pictitlecolor="#FFFFFF"
pictitlesize=9
listshu=10
tb=38
somb=""
moreline=10
end if
%>
<table cellpadding=2 cellspacing=1 border=0 width=98% class=tableBorder align=center>
<tr align=center>
<th height=25 align=center colspan="2"><strong>添加/编辑文章频道模版</strong></th>
</tr>
<tr>
<td width=12% height=30 class=forumRow> <strong>管理导航:</strong></td>
<td width=88% height=30 class=forumRow><a href='admin_mb_add.asp'>添加栏目模版</a> | <a href='admin_mb.asp'>网站模版列表</a> | <a href='admin_mb_topdown.asp'>通用页首/页尾模版</a> | <a href='admin_mb_fddh.asp'>进入浮动导航模版</a> | <a href="admin_zt.asp?Action=Addzt">专题模版</a></td>
</tr>
</TABLE>
<table cellpadding=2 cellspacing=1 border=0 width=98% class=tableBorder align=center>
<tr>
<td class="forumRow"><p><B>注意</B>:<BR>
①在这里,您可以修改模板,可以编辑风格,操作时请按照相关页面提示完整填写表单信息。<BR>
②执行删除时要慎重,任何的删除操作都是不可逆的。<br>
③通用页头页尾调用标签,在模板中可以使用包含文件,设置好“<span class="redtext">通用页首/页尾调用设置</span>”模板,在想要出现的地方插入<font color="#666666" class="redtext">$$通用页头$$ $$通用页尾$$</font>。<br> </td>
</td>
</tr>
</table>
<script Language="JavaScript" Type="text/javascript">
<!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.title.value == "")
{
alert("请在 标题 域中输入值。");
theForm.title.focus();
return (false);
}
if (theForm.title.value.length < 5)
{
alert("在 标题 域中,请至少输入 5 个字符。");
theForm.title.focus();
return (false);
}
if (theForm.title.value.length > 10)
{
alert("在 标题 域中,请最多输入 10 个字符。");
theForm.title.focus();
return (false);
}
if (theForm.mid.value == "")
{
alert("请在 模版 中部 域中输入值。");
theForm.mid.focus();
return (false);
}
if (theForm.mid.value.length < 10)
{
alert("在 模版 中部 域中,请至少输入 10 个字符。");
theForm.mid.focus();
return (false);
}
if (theForm.list.value == "")
{
alert("请在 列表代码 域中输入值。");
theForm.list.focus();
return (false);
}
if (theForm.list.value.length < 1)
{
alert("在 列表代码 域中,请至少输入 1 个字符。");
theForm.list.focus();
return (false);
}
if (theForm.listtumb.value == "")
{
alert("请在 列表代码 域中输入值。");
theForm.listtumb.focus();
return (false);
}
if (theForm.listtumb.value.length < 1)
{
alert("在 列表代码 域中,请至少输入 1 个字符。");
theForm.listtumb.focus();
return (false);
}
if (theForm.picw.value == "")
{
alert("请在 图片宽度 域中输入值。");
theForm.picw.focus();
return (false);
}
if (theForm.picw.value.length < 1)
{
alert("在 图片宽度 域中,请至少输入 1 个字符。");
theForm.picw.focus();
return (false);
}
if (theForm.picw.value.length > 3)
{
alert("在 图片宽度 域中,请最多输入 3 个字符。");
theForm.picw.focus();
return (false);
}
var checkOK = "0123456789-";
var checkStr = theForm.picw.value;
var allValid = true;
var validGroups = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
allNum += ch;
}
if (!allValid)
{
alert("在 图片宽度 域中,只能输入 数字 字符。");
theForm.picw.focus();
return (false);
}
if (theForm.pich.value == "")
{
alert("请在 图片高度 域中输入值。");
theForm.pich.focus();
return (false);
}
if (theForm.pich.value.length < 1)
{
alert("在 图片高度 域中,请至少输入 1 个字符。");
theForm.pich.focus();
return (false);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -