⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_article.asp

📁 蓝色WAP建站系统,WAP源码,更多请登陆http://xywap.cn
💻 ASP
📖 第 1 页 / 共 4 页
字号:
		set rs=conn.execute(sql)
		do while not rs.eof
		%>
		<option value="<%=rs("cat_id")%>" <%if rs("cat_id")=cint(request.querystring("catid")) then response.write "selected" end if%>><%=rs("cat_name")%></option>
		<%
		rs.movenext
		loop
		if rs.eof and rs.bof then
		response.write"<option>暂无分类</option>"
		end if
		rs.close
		set rs=nothing
		%>
		</select></td>
	</tr>
	<tr class="tablebody">
		<td height="30" align="center" colspan="2">
		<input type="submit" name="Submit" value="确定修改">
		<input type="reset" name="Reset" value="取消重填">
		<input type="hidden" name="id" value="<%=request.querystring("id")%>">
		<input type="hidden" name="editclass" value="true">
		</td>
	</tr>
	</form>
</table>
<%end sub
'==================================
'=过 程 名:delclass()
'=功    能:删除子分类
'==================================
sub delclass()
if request.form("delclass")="true" then
	class_id=checksql("文章子类ID",request.form("id"),0,4)
	dim datainthiscat
	datainthiscat=conn.Execute("select count(*) from wapls_art where class_id="&class_id)(0)
	if datainthiscat<>0 then
		response.write "<script>window.alert('此分类下有"&datainthiscat&"条数据,不能删除此分类!如真要删除此分类,请先转移此分类下的数据,再进行删除分类操作!');window.location='javascript:history.go(-1);';</script>"
		response.End
	end if
	sql="select * from wapls_art_class where class_id="&class_id
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.delete
	rs.close
	set rs=nothing
	response.redirect "?action=catlist"
end if
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action="">
	<tr class="tablebody">
		<td class="td_title">删除子分类</td>
	</tr>
	<tr class="tablebody">
		<td height="50">
		子分类名称:<%=request.querystring("name")%><br>
		所属分类:
		<%
		sql="select * from wapls_art_cat where cat_id="&cint(request.querystring("catid"))
		set rs=server.createobject("adodb.recordset")
		rs.open sql,conn,1,1
		%>
		<%=rs("cat_name")%>
		</td>
	</tr>
	<tr class="tablebody">
		<td height="30" align="center"><input name="Submit" type="submit" id="Submit" value="确定删除" onclick="{if(confirm('您再次确定要删除『<%=request.querystring("name")%>』这个子分类吗?\n\n注意:删除后不可恢复!处于该分类下的文章需要重新进行归类操作!')){return true;}return false;}">
		<input type="hidden" name="id" value="<%=request.querystring("id")%>">
		<input type="hidden" name="delclass" value="true">
		</td>
	</tr>
	</form>
</table>
<%
rs.close
set rs=nothing
end sub
'==================================
'=过 程 名:addart()
'=功    能:添加文章
'==================================
sub addart()
if request.Form("addart")="true" then
	if request.form("istop")="" then
		istop=0
	elseif request.form("istop")=1 then
		istop=1
	else
		istop=0
	end if
	poster=checksql("文章作者",request.form("art_poster"),1,20)
	artfrom=checksql("文章来源",request.form("art_from"),1,20)
	title=checksql("文章标题",request.form("art_title"),1,100)
	if len(request.form("art_keyword"))>20 then
		keyword=checksql("文章关键词",left(request.form("art_keyword"),20),1,20)
	else
		keyword=checksql("文章关键词",request.form("art_keyword"),1,20)
	end if
	keyword=replace(keyword,"[","")
	userview=checksql("会员文章",request.form("userview"),0,1)
	moneypay=checksql("会员消费金币数",request.form("moneypay"),0,10)
	artgood=checksql("文章等级",request.form("art_good"),0,1)
	content=checksql("文章内容",request.form("content"),1,0)
	content=replace(content,replaceurl,"")
	sql="select * from wapls_art"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.addnew
	rs("art_poster")=poster
	rs("art_from")=artfrom
	rs("art_title")=title
	rs("art_keyword")=keyword
	if request("of")<>"" then
		set rsclass = server.createobject("adodb.recordset")
		sqlclass="select * from wapls_art_class where class_id="&request("of")
		rsclass.open sqlclass,Conn,1,1
		rs("class_id")=rsclass("class_id")
		rs("cat_id")=rsclass("cat_id")
		rsclass.close
		set rsclass=nothing
	else
		Response.Write " <script> window.alert('你必须选择所属分类,或者非法操作!'); history.back();</script>"
		Response.End
	end if
	if userview=0 then
		rs("moneypay")=0
	else
		rs("moneypay")=moneypay
	end if
	rs("user_view")=userview
	rs("istop")=istop
	rs("art_good")=artgood
	rs("art_content")=content
	rs.update
	rs.close
	set rs=nothing
	response.redirect "?action=list"
end if
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action=""  onsubmit="javascript:submits();">
	<tr class="tablebody">
		<td class="td_title" colspan="2">新增文章</td>
	</tr>
	<tr class="tablebody">
		<td width="13%" align="center">作 者</td>
		<td width="87%"><input name="art_poster" type="text" id="art_poster" size="20" maxlength="20">&nbsp;<button onClick="art_poster.value='<%=cur_nickname%>'" title="您的昵称"><%=cur_nickname%></button><button onClick="art_poster.value='<%=webboss%>'" title="网站站长"><%=webboss%></button><button onClick="art_poster.value='不祥'">不祥</button></td>
	</tr>
	<tr class="tablebody">
		<td align="center">来 源</td>
		<td><input name="art_from" type="text" id="art_from" size="20" maxlength="20">&nbsp;<button onClick="art_from.value='<%=webname%>'"><%=webname%></button><button onClick="art_from.value='http://gotf.cn'">http://gotf.cn</button><button onClick="art_from.value='不祥'">不祥</button></td>
	</tr>
	<tr class="tablebody">
		<td align="center">标 题</td>
		<td><input name="art_title" type="text" id="art_title" size="56" maxlength="100" onchange="art_keyword.value=art_title.value"></td>
	</tr>
	<tr class="tablebody">
		<td align="center">关键词</td>
		<td><input type="text" name="art_keyword" size="20" maxlength="20" value=''> <span class="disable_font">[≤20]</span></td>
	</tr>
	<tr class="tablebody">
		<td align="center">分 类</td>
		<td>
		<select name="of">
		<%
		set rs = server.createobject("adodb.recordset")
		sql="select * from wapls_art_cat"
		rs.open sql,conn,1,1
		if not (rs.eof and rs.bof) then
			rs.movefirst
			do while not rs.eof
			sql="select * from wapls_art_class where cat_id="&rs("cat_id")
			set rs2 = server.createobject("adodb.recordset")
			rs2.open sql,conn,1,1
			if not (rs2.eof and rs2.bof) then
				do while not rs2.eof
				catid=rs("cat_id")
				classid=rs2("class_id")
				catname=rs("cat_name")
				classname=rs2("class_name")
				%>
				<option value='<%=rs2("class_id")%>'><%=rs2("class_name")%>(<%=rs("cat_name")%>)</option>
				<%
				rs2.movenext
				loop
			else if rs2.eof and rs2.bof then
				response.write"<script>alert('请先添加子类');location.href='?action=catlist';</script>"
			end if
			end if
			rs.movenext
			rs2.close
			set rs2=nothing
			response.write"<option>- - - - - - - - - -</option>"
			loop
			else if rs.eof and rs.bof then
				response.write"<script>alert('请先添加分类');location.href='?action=addcat';</script>"
			end if
			rs.close
			set rs=nothing
		end if
		%>
		</select>
		</td>
	</tr>
	<tr class="tablebody">
		<td align="center">上传附件</td>
		<td>
		<iframe src="wapls_upload.asp" scrolling="no" frameborder="0" height="25" width="100%"></iframe></td>
	</tr>
	<tr class="tablebody">
		<td align="center">查看权限</td>
		<td>
		<input type="radio" name="userview" value="0" checked> 游客查看
		<input type="radio" name="userview" value="1"> 普通会员
		<input type="radio" name="userview" value="2"> VIP会员
		| 消费金币:<input type="text" name="moneypay" value="1" size="6" maxlength="10" title="阅读此会员文章所需金币量">
		</td>
	</tr>
	<tr class="tablebody">
		<td align="center">置&nbsp;&nbsp;顶</td>
		<td>
		<input type="checkbox" name="istop" value="1"> 文章置顶 <span class="disable_font">[总是显示于文章列表顶部]</span>
		</td>
	</tr>
	<tr class="tablebody">
		<td align="center">文章评级</td>
		<td>
		<input type="radio" name="art_good" value="0" checked> 普通文章
		<input type="radio" name="art_good" value="1"> 推荐文章
		<input type="radio" name="art_good" value="2"> 精品文章
		</td>
	</tr>
	<tr class="tablebody">
		<td align="center" valign="top">内 容</td>
		<td><textarea name="content" style="overflow:auto;width:96%;" rows="20"></textarea></td>
	</tr>
		<tr class="tablebody">
		<td colspan="2" height="30" align="center">
		<input type="submit" name="Submit" value="确定新增" onClick="if (Dvbbs_bTextMode!=1) {Dvbbs_setMode(1);}">
		<input type="hidden" name="addart" value="true">
		</td>
	</tr>
	</form>
</table>
<%end sub
'==================================
'=过 程 名:editart()
'=功    能:编辑文章
'==================================
sub editart()
if request.Form("editart")="true" then
	if request.querystring("page")<>"" then
		curpage=cint(request.querystring("page"))
	else
		curpage=1
	end if
		if request.form("istop")="" then
		istop=0
	elseif request.form("istop")=1 then
		istop=1
	else
		istop=0
	end if
	art_id=checksql("文章ID",request.form("id"),0,16)
	poster=checksql("文章作者",request.form("art_poster"),1,20)
	artfrom=checksql("文章来源",request.form("art_from"),1,20)
	title=checksql("文章标题",request.form("art_title"),1,100)
	keyword=checksql("文章关键词",request.form("art_keyword"),1,20)
	keyword=replace(keyword,"[","")
	userview=checksql("会员文章",request.form("userview"),0,1)
	moneypay=checksql("会员消费金币数",request.form("moneypay"),0,10)
	artgood=checksql("文章等级",request.form("art_good"),0,1)
	content=checksql("文章内容",request.form("content"),1,0)
	content=replace(content,replaceurl,"")
	sql="select * from wapls_art where art_id="&art_id
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs("art_poster")=poster
	rs("art_title")=title
	rs("art_keyword")=keyword
	if request("of")<>"" then
		Set rsclass = Server.CreateObject("ADODB.Recordset")
		sqlclass="SELECT * from wapls_art_class where class_id="&request("of")
		rsclass.OPEN sqlclass,Conn,1,1
		rs("class_id")=rsclass("class_id")
		rs("cat_id")=rsclass("cat_id")
		rsclass.close
		set rsclass=nothing
	else
		Response.Write " <script> window.alert('你必须选择所属分类,或者非法操作!'); history.back();</script>"
		Response.End
	end if
	if userview=0 then
		rs("moneypay")=0
	else
		rs("moneypay")=moneypay
	end if
	rs("user_view")=userview
	rs("istop")=istop
	rs("art_good")=artgood
	rs("art_content")=content
	rs.update
	rs.close
	set rs=nothing
	response.redirect "?action=list&page="&curpage&""
end if
art_id=checksql("文章ID",request.querystring("art_id"),0,16)
sql="select * from wapls_art where art_id="&art_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action="" onsubmit="javascript:submits();">
	<tr class="tablebody">
		<td colspan="2" class="td_title">修改文章</td>
	</tr>
	<tr class="tablebody">
		<td width="13%" align="center">作 者</td>
		<td width="87%"><input name="art_poster" type="text" id="art_poster" size="20" maxlength="20" value="<%=rs("art_poster")%>">&nbsp;<button onClick="art_poster.value='<%=cur_nickname%>'" title="您的昵称"><%=cur_nickname%></button><button onClick="art_poster.value='<%=webboss%>'" title="网站站长"><%=webboss%></button><button onClick="art_poster.value='不祥'">不祥</button></td>
	</tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -