📄 admin_art.asp
字号:
<input type="text" name="page" class="textarea" size="4">
<input type="submit" name="Submit" value="Go" class="button">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<%
end if
if request.Form("action")="newart" then
sql="select * from art"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim poster,artfrom,title,keyword,content,artisbest,catid
catid=cint(request.form("cat_id"))
title=trim(replace(request.form("art_title"),"'",""))
keyword=trim(replace(request.form("art_keyword"),"'",""))
artisbest=request.form("isbest")
content=rtrim(replace(request.form("art_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 keyword="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须选择文章的类型!');history.back(1);</script>")
else
rs("art_keyword")=keyword
end if
if content="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
else
rs("art_content")=content
end if
if cint(artisbest)=1 then
rs("isbest")=cint(artisbest)
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
sql="update allcount set articlecount = articlecount + 1"
conn.execute(sql)
response.redirect "admin_art.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 diserror()
response.End
end if
sql="select * from art where art_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"),"'",""))
keyword=trim(replace(request.form("art_keyword"),"'",""))
artisbest=request.form("isbest")
content=rtrim(replace(request.form("art_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 keyword="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须选择文章的类型!');history.back(1);</script>")
else
rs("art_keyword")=keyword
end if
if content="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
else
rs("art_content")=content
end if
rs("isbest")=cint(artisbest)
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_art.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 diserror()
response.End
end if
sql="select * from art where art_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_art.asp?action=cat"
end if
if request.QueryString("action")="newart" then%>
<table width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<form name="addart" method="post" action="">
<tr>
<td class=lanyuss>新增文章</td>
</tr>
<tr>
<td class=lanyuds>标题
<input type="text" name="art_title" size="60" class="textarea">
</td>
</tr>
<tr>
<td class=lanyuds>所属分类
<select name="cat_id">
<%
sql="select * from a_cat"
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>
类型
<select name="art_keyword">
<option value="ASP">ASP</option>
<option value="技巧">技巧</option>
<option value="特效">特效</option>
<option value="新闻">新闻</option>
<option value="系统">系统</option>
<option value="黑客">黑客</option>
<option value="其它">其它</option>
</select>
</td>
</tr>
<tr>
<td class=lanyuqs>
<%call ubbshow()%>
</td>
</tr>
<tr>
<td class=lanyuds>
<textarea cols="85" name="art_content" rows="20" class="textarea"></textarea>
</td>
</tr>
<tr>
<td bgcolor="#E8E8E8" 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="清空重写" class="button">
<input type="button" value="返回" onClick="location.href='admin_art.asp?action=cat'" class="button"></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("art_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("art_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
response.end
end if
end if
if request.querystring("cat_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("cat_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from art where art_id="&cint(request.querystring("art_id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<form name="addart" method="post" action="">
<tr>
<td class=lanyuss>修改文章</td>
</tr>
<tr>
<td class=lanyuds>标题
<input name="art_title" type="text" class="textarea" id="art_title" size="60" value="<%=rs("art_title")%>">
</td>
</tr>
<tr>
<td class=lanyuds>所属分类
<select name="cat_id" id="cat_id">
<%
sql="select * from a_cat"
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> 类型
<select name="art_keyword">
<option value="ASP"<%if rs("art_keyword")="ASP" then response.write "selected"%>>ASP</option>
<option value="技巧"<%if rs("art_keyword")="技巧" then response.Write " selected"%>>技巧</option>
<option value="特效"<%if rs("art_keyword")="特效" then response.Write " selected"%>>特效</option>
<option value="新闻"<%if rs("art_keyword")="新闻" then response.Write " selected"%>>新闻</option>
<option value="系统"<%if rs("art_keyword")="系统" then response.Write " selected"%>>系统</option>
<option value="黑客"<%if rs("art_keyword")="黑客" then response.Write " selected"%>>黑客</option>
<option value="其它"<%if rs("art_keyword")="其它" then response.Write " selected"%>>其它</option>
</select></td>
</tr>
<tr>
<td class=lanyuqs>
<%call ubbshow()%>
</td>
</tr>
<tr>
<td class=lanyuds> <textarea name="art_content" cols="85" rows="20" class="textarea" id="art_content"><%=rs("art_content")%></textarea>
</td>
</tr>
<tr>
<td class=lanyuqs 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_art.asp?action=cat'" class="button"></td>
</tr>
<input type="hidden" name="id" value="<%=rs("art_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("art_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("art_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
response.end
end if
end if
if request.querystring("cat_id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("cat_id")) then
Response.Write("<script language=javascript>alert('非法的新闻ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from art where art_id="&cint(request.querystring("art_id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<form name="addart" method="post" action="">
<tr>
<td class=lanyuss>删除文章</td>
</tr>
<tr>
<td class=lanyuds>标题- <%=rs("art_title")%>
</td>
</tr>
<tr>
<td class=lanyuds>所属分类
<%
sql="select * from a_cat where cat_id="&cint(request.querystring("cat_id"))
set rs2=conn.execute(sql)
%>
<%=rs2("cat_name")%>
<%
rs2.close
set rs2=nothing%> 类型 <%=rs("art_keyword")%>
</td>
</tr>
<tr>
<td class=lanyuds><%=ubb2html(formatStr(autourl(rs("art_content"))), true, true)%>
</td>
</tr>
<tr>
<td class=lanyuqs height="30" align="center"> <input name="Submit" type="submit" class="button" id="Submit" value="确定删除">
<input type="button" value="返回" onClick="location.href='admin_art.asp?action=cat'" class="button"></td>
</tr>
<input type="hidden" name="id" value="<%=rs("art_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%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -