📄 admin_art.asp
字号:
if getPopedom("artAdmin")=false then
popedomMsg
exit sub
end if
elseif operate="add" then
if getPopedom("isAddArt")=false then
popedomMsg
exit sub
end if
end if
id=request.form("id")
title=Request.form("title")
titlecolor=Request.form("titlecolor")
authors=Request.form("authors")
from=Request.form("artfrom")
imgurl=Request.form("imgurl")
artclass=Request.form("artclass")
keyword=Request.form("keyword")
content=Request.form("content")
showpage=Request.form("showpage")
popedom=Request.form("popedom")
jifen=Request.form("jifen")
money=Request.form("money")
sendOutPoint=Request.form("sendOutPoint")
if Request.form("isgood")="" then
isgood=false
else
isgood=Request.form("isgood")
end if
if Request.form("istop")="" then
istop=false
else
istop=true
end if
if Request.form("allowPl")="" then
allowpl=false
else
allowpl=true
end if
if Request.form("picart")="" then
picart=0
else
picart=1
end if
if Request.form("pass")="" then
pass=false
else
pass=true
end if
dim errmsg
if chkIsOut=false then
showmsg "<font color=""#ff0000"">茂盛系统返回如下信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
exit sub
end if
if trim(title)="" then
errmsg="<li>请您输入文章标题</li>"
end if
if trim(authors)="" then
errmsg=errmsg&"<li>请您输入文章作者</li>"
end if
if artclass="" then
errmsg=errmsg&"<li>请您选择文章所属分类</li>"
else
dim clStr,catid,classid
clStr=split(artclass,",")
if ubound(clStr)=1 then
catid=clStr(0)
classId=clStr(1)
else
errmsg=errmsg&"<li>您输入的分类ID不正确</li>"
end if
end if
if trim(content)="" then
errmsg=errmsg&"<li>请您输入文章内容</li>"
end if
if picart=1 then
if trim(imgurl)="" then
errmsg=errmsg&"<li>如果您设为图片文章,请您输入图片地址</li>"
end if
end if
if not isNumeric(jifen) then
errmsg=errmsg&"<li>您输入的"&pointName&"值不正确,"&pointName&"值应为数字型整数</li>"
end if
if not isNumeric(money) then
errmsg=errmsg&"<li>您输入的"&moneyName&"值不正确,"&moneyName&"值应为数字型整数</li>"
end if
if errmsg<>"" then
adminShowMsg "出错信息","<font color=""#ff0000"">系统发生如下错误:</font><br>"&errmsg
errmsg=""
exit sub
end if
dim sql,urs
if operate=lcase("maosin_mdf") and isInteger(id)=true then
if not isNumeric(sendOutPoint) then
adminShowMsg "出错信息","奖励"&pointName&"应为数字型参数"
exit sub
end if
if pass=true then
sendOutPoint=csng(sendOutPoint)
else
sendOutPoint=0
end if
sql="select * from ms_art where id="&id
else
sql="select * from ms_art where (id is null)"
sendOutPoint=0
end if
Set urs=Server.CreateObject("ADODB.RecordSet")
urs.open sql,connstr,1,3
if operate<>lcase("maosin_mdf") then
urs.AddNew
end if
urs("catID")=catID
urs("classID")=classID
urs("art_title")=chkFormStr(title)
urs("titlecolor")=chkColor(titlecolor)
urs("art_keyword")=chkFormStr(replace(keyword,"|",","))
if operate<>lcase("maosin_mdf") then
urs("art_date")=now()
urs("post_member")=adminInfo(1)
end if
urs("art_content")=content
urs("art_imgurl")=ChkFormStr(imgurl)
urs("art_authors")=ChkFormStr(authors)
urs("art_from")=ChkFormStr(from)
urs("pass")=pass
urs("art_good")=isgood
urs("art_istop")=istop
urs("allow_pl")=allowpl
urs("picart")=picart
urs("popedom")=popedom
urs("jifen")=jifen
urs("money")=money
urs("showpage")=showpage
urs("sendOutPoint")=urs("sendOutPoint")+sendOutPoint
postMember=urs("post_member")
urs.Update
urs.close
set urs=nothing
if operate=lcase("maosin_mdf") then
if pass=true then
conn.execute("update ms_user set user_point=user_point+"&sendOutPoint&" where user_name='"&postMember&"'")
end if
adminShowMsg "操作成功信息","<li>恭喜恭喜,您已成功修改完成一篇文章</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回文章管理页......</b><meta http-equiv=refresh content=3;url=admin_art.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
else
adminShowMsg "操作成功信息","<li>恭喜您,已成功添加一篇文章</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回文章管理页......</b><meta http-equiv=refresh content=3;url=admin_art.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
end if
exit sub
End Sub
Sub addArticle()
if getPopedom("isAddArt")=false then
popedomMsg
exit sub
end if
dim editpath:editpath="../editor/"
%>
<script language="javascript">
function mych(){
submits();
if(document.form.artclass.options[document.form.artclass.selectedIndex].value==""){
alert("请选择所属分类");
return false;
document.form.classes.focus();
}
if(document.form.authors.value==""){
alert("文章作者不能为空!");
document.form.authors.focus();
return false;}
if(document.form.keyword.value==""){
alert("文章关键词不能为空!");
document.form.keyword.focus();
return false;
}
if(document.form.title.value==""){
alert("文章标题不能为空");
document.form.title.focus();
return false;}
if(document.form.content.value==""){
alert("文章内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
var editorpath="../editor/";
</Script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
<tr>
<td height="25" colspan="2" valign="middle" class="td_titleT"> 添加文章</td>
</tr>
<form action="?action=maosin_saveArticle&operate=add" name="form" Method="post" onSubmit="return mych()">
<tr class="td_bgcolor">
<td width="80" height="25" align="right" valign="middle">文章标题:</td>
<td width="*" valign="middle">
<input name="title" type="text" class="wenbenkang" id="title" size="40" ondrop="document.form.keyword.value=document.form.title.value;" onpaste="document.form.keyword.value=document.form.title.value;" onkeyup="document.form.keyword.value=document.form.title.value;">
标题颜色:<input name="titlecolor" type="text" class="wenbenkang" value="#000000" id="titlecolor" size="10" readonly>
<select name="colorrs" onChange="titlecolor.value=this.value;">
<option value="#000000">选择颜色</option>
<%
colorStr=split(colorRS,",")
for i=0 to ubound(colorStr)
Response.Write ("<option style=""background-color:"& colorStr(i) &";color: "& colorStr(i) &""" value="""&colorStr(i)&""">"&colorStr(i)&"</option>")
next
%>
</select>
</td>
</tr>
<tr class="td_bgcolor">
<td height="25" align="right" valign="middle">关 键 词:</td>
<td valign="middle"><input name="keyword" type="text" class="wenbenkang" id="keyword" size="40"> <font color="#3d3d3d">*多个关键词请用“|”分隔</font></td>
</tr>
<tr class="td_bgcolor">
<td height="25" align="right" valign="middle">文章作者:</td>
<td valign="middle"><input name="authors" type="text" class="wenbenkang" id="authors"> <select name="name1" onChange="authors.value=this.value;"><option value="">选择作者</option><option value="佚名">佚名</option><option value="不详">不详</option><option value="网络">网络</option><option value="<%=webboss%>"><%=webboss%></option><option value="<%=webname%>"><%=webname%></option></select></td>
</tr>
<tr class="td_bgcolor">
<td height="25" align="right" valign="middle">文章来源:</td>
<td valign="middle"><input name="artfrom" type="text" class="wenbenkang" id="artfrom"> <select name="from1" onChange="artfrom.value=this.value;"><option value="">选择来源</option><option value="转载">转载</option><option value="不详">不详</option><option value="网络">网络</option><option value="原创">原创</option><option value="整理">整理</option><option value="<%=webname%>"><%=webname%></option></select></td>
</tr>
<tr class="td_bgcolor">
<td height="25" align="right" valign="middle">文章分类:</td>
<td valign="middle"><select name="artclass" id="artclass">
<%sql="select * from ms_art_cat"
Set rs1=Server.CreateObject("ADODB.RecordSet")
rs1.Open sql,connstr,1,1
If Not rs1.Bof And Not rs1.Eof Then
Do While Not rs1.Eof
sql="select * from ms_art_class where catID="&rs1("catID")
Set rs2=Server.CreateObject("ADODB.RecordSet")
rs2.Open sql,connstr,1,1
If Not rs2.Eof And Not rs2.Bof Then%>
<option style="color:#ff0000;font-weight:bold;">----<%=rs1("catName")%>----</option>
<%Do While Not rs2.Eof%>
<option value="<%=rs1("catId")&","&rs2("classID")%>">├<%=rs2("class")%></option>
<%rs2.MoveNext
Loop
rs2.close
Set rs2=Nothing
Else%>
<option>请添加子分类</option>
<%rs2.close
Set rs2=Nothing
End If
rs1.MoveNext
Loop
rs1.close
Set rs1=Nothing
Else%>
<option style="color:#ff0000;font-weight:bold;">----请添加大分类----</option>
<%rs1.close
Set rs1=Nothing
End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -