📄 admin_article.asp
字号:
<%end if
if request.Form("action")="newart" then
sql="select * from Gq_article"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim poster,artfrom,title,writer,copyright,content,artisbest,catid
catid=cint(request.form("cat_id"))
title=trim(replace(request.form("art_title"),"'",""))
writer=trim(replace(request.form("writer"),"'",""))
copyright=trim(replace(request.form("copyright"),"'",""))
artisbest=request.form("isbest")
content=trim(replace(request.form("content"),"'",""))
if catid<1 then
founderr=true
Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
else
rs("cat_id")=catid
end if
if title="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
else
rs("art_title")=title
end if
if content="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
else
rs("content")=content
end if
if writer="" then
founderr=true
Response.Write("<script language=javascript>alert('文章的作者不会没有吧?');history.back(1);</script>")
else
rs("writer")=writer
end if
if copyright="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章来源');history.back(1);</script>")
else
rs("copyright")=copyright
end if
if cint(artisbest)=1 then
rs("isbest")=cint(artisbest)
end if
if founderr then
call closeconn()
response.end
else
rs.update
rs.close
set rs=nothing
sql="update allcount set articlecount = articlecount + 1"
conn.execute(sql)
response.redirect "admin_article.asp?action=cat"
end if
end if
if request.Form("action")="editart" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
end if
end if
if founderr then
call closeconn()
response.End
end if
sql="select * from Gq_article where id="&cint(request.Form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
catid=cint(request.form("cat_id"))
title=trim(replace(request.form("art_title"),"'",""))
artisbest=request.form("isbest")
content=rtrim(replace(request.form("content"),"",""))
content=trim(replace(content," "," "))
if catid<1 then
founderr=true
Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
else
rs("cat_id")=catid
end if
if title="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
else
rs("art_title")=title
end if
if content="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
else
rs("content")=content
end if
rs("isbest")=cint(artisbest)
if founderr then
call closeconn()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_article.asp?action=cat"
end if
end if
if request.Form("action")="delart" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
end if
end if
if founderr then
call closeconn()
response.End
end if
sql="select * from Gq_article where id="&cint(request.Form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
sql="update allcount set articlecount = articlecount - 1"
conn.execute(sql)
response.redirect "admin_article.asp?action=cat"
call closeconn()
end if
if request.QueryString("action")="newart" then%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form action="" method="post" name="╲、衡少゛form" onSubmit="return CheckForm(this);">
<input name="content" type="hidden" value='<%=Server.HtmlEncode(rs("content"))%>'>
<tr>
<th colspan="3">文章管理--添加文章</th>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">文章标题:</td>
<td class="TableRow1"><input type="text" name="art_title" size="60" class="textarea"></td>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">文章作者:</td>
<td class="TableRow1"><input type="text" name="writer" size="40" class="textarea"></td>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">文章来源:</td>
<td class="TableRow1"><input type="text" name="copyright" size="40" class="textarea"></td>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">所属分类:</td>
<td class="TableRow1"><select name="cat_id">
<%
sql="select * from Gq_newsclass"
set rs=conn.execute(sql)
do while not rs.eof%>
<option value="<%=rs("cat_id")%>"><%=rs("cat_name")%></option>
<%rs.movenext
loop
rs.close
set rs=nothing%>
</select></td>
</tr>
<tr>
<td class="TableRow1" colspan="3">
<table border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="750" height="350" align="center"><SCRIPT src="inc/post.js"></SCRIPT></td>
</tr></table></td>
</tr>
<tr>
<td class="TableRow1" colspan="3" height="30" align="center">
<input type="checkbox" name="isbest" value="1">推荐
<input type="submit" name="Submit" value=" 发 布 " class="button">
<input type="reset" name="Reset" value=" 重 写 " onclick="ClearReset()">
</td>
</tr>
<input type="hidden" name="action" value="newart">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.QueryString("action")="editart" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
call closeconn()
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
call closeconn()
response.end
end if
end if
if request.querystring("cat_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
call closeconn()
response.end
else
if not isinteger(request.querystring("cat_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
call closeconn()
response.end
end if
end if
sql="select * from Gq_article where id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form action="" method="post" name="╲、衡少゛form" onSubmit="return CheckForm(this);">
<input name="content" type="hidden" value='<%=Server.HtmlEncode(rs("content"))%>'>
<tr>
<th colspan="3">文章管理--修改文章</th>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">文章标题:</td>
<td class="TableRow1"><input name="art_title" type="text" class="textarea" id="art_title" size="60" value="<%=rs("art_title")%>"></td>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">文章作者:</td>
<td class="TableRow1"><input name="writer" type="text" class="textarea" id="writer" size="40" value="<%=rs("writer")%>"></td>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">文章来源:</td>
<td class="TableRow1"><input name="copyright" type="text" class="textarea" id="copyright" size="40" value="<%=rs("copyright")%>"></td>
</tr>
<tr>
<td width="12%" align="right" class="TableRow1">所属分类:</td>
<td class="TableRow1">
<select name="cat_id" id="cat_id">
<%
sql="select * from Gq_newsclass"
set rs2=conn.execute(sql)
do while not rs2.eof%>
<option value="<%=rs2("cat_id")%>"<%if cint(rs2("cat_id"))=cint(request("cat_id")) then response.Write " selected"%>><%=rs2("cat_name")%></option>
<%rs2.movenext
loop
rs2.close
set rs2=nothing
%>
</select></td>
</tr>
<tr>
<td class="TableRow1" colspan="3">
<table border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="750" height="350" align="center"><SCRIPT src="inc/post.js"></SCRIPT></td>
</tr></table></td>
</tr>
<tr>
<td class="TableRow1" colspan="3" height="30" align="center">
<input type="checkbox" name="isbest" value="1" id="isbest" <%if rs("isbest")=1 then response.write "checked" end if%>>
<input name="Submit" type="submit" class="button" id="Submit" value=" 编 辑 ">
<input type="button" value=" 返 回 " onClick="location.href='admin_article.asp?action=cat'" class="button"></td>
</tr>
<input type="hidden" name="id" value="<%=rs("id")%>">
<input type="hidden" name="action" value="editart">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.QueryString("action")="delart" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
call closeconn()
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
call closeconn()
response.end
end if
end if
if request.querystring("cat_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
call closeconn()
response.end
else
if not isinteger(request.querystring("cat_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
call closeconn()
response.end
end if
end if
sql="select * from Gq_article where id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form name="addart" method="post" action="">
<tr>
<th colspan="3">文章管理--删除文章</th>
</tr>
<tr>
<td class="TableRow1">标题- <%=rs("art_title")%></td>
</tr>
<tr>
<td class="TableRow1">所属分类
<%
sql="select * from Gq_newsclass where cat_id="&cint(request.querystring("cat_id"))
set rs2=conn.execute(sql)
%>
<%=rs2("cat_name")%>
<%
rs2.close
set rs2=nothing%>
</td>
</tr>
<tr>
<td class="TableRow1"><%=ubb2html(formatStr(autourl(rs("content"))), true, true)%></td>
</tr>
<tr>
<td class="TableRow1" height="30" align="center">
<input name="Submit" type="submit" class="button" id="Submit" value=" 删 除 ">
<input type="button" value=" 返 回 " onClick="location.href='admin_article.asp?action=cat'" class="button"></td>
</tr>
<input type="hidden" name="id" value="<%=rs("id")%>">
<input type="hidden" name="action" value="delart">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%rs.close
set rs=nothing
end if
call CloseConn()%>
<table width=98% align="center" border="0" cellspacing="0" cellpadding="0">
<tr align="middle">
<td height="30" valign="bottom">Copyright (c) 2004-2006 <a target="_blank" href="http://www.xuncms.cn"><b><font color="#708796">XunCms</font><font color="#cc0000">.Cn</font></b></font></a>. All Rights Reserved .</td>
</tr>
<tr align="middle">
<td>Powered by:<a href="http://www.xuncms.cn" target="_blank"><b><font color="#708796">讯图</font><font color="#cc0000">设计</font></b></font> XunCms <%=Version%></a></td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -