www.gusucode.com > cso中国seo优化html整站源码程序 > manage/feed/f_comment.asp

    <!--#include file="../include/head.asp"-->
<%
flagstr = "f_comment"
call checkflag(flagstr)
session("curpage") = "info/"&flagstr&".asp"
main_title = "评论管理"
%>
<table cellspacing="1">
	<thead><tr><th><%=main_title%>管理选项</th></tr></thead>
	<tbody><tr><td>
		<a class="man" href="?act=man">管理<%=main_title%></a>
	</td></tr></tbody>
</table>
<br />
<%
act = request.querystring("act")
page = int(request.querystring("page"))
nid = request.querystring("nid")
select case act
	case "all"
		call so_feed_all()
	case "edit"
		call so_feed_edit(nid)
	case "save"
		call so_feed_save(nid)
	case "delete"
		call so_feed_delete(nid)
	case else
		call so_feed_man(page)
end select

sub so_feed_save(nid)
sql = "select * from so_feed where id = "&nid
rs.open sql,conn,2,2

rs("title") = trim(request.form("title"))
rs("content") = request.form("content")
rs("admin_content") = request.form("admin_content")
rs("admin_datestr") = now()

rs.update
rs.close

call redir("?act=manage")
end sub

'编辑表单
sub so_feed_edit(nid)
actstr = "编辑"
sql = "select * from so_feed where id = "&nid
rs.open sql,conn,1,1
	title = rs("title")
	username = rs("username")
	phone = rs("phone")
	email = rs("email")
	content = rs("content")
	admin_content = rs("admin_content")
rs.close
%>
<table cellspacing="1">
	<thead><tr><th colspan="2"><%=main_title%>——<%=actstr%></th></tr></thead>
	<form method="post" name="add" action="?act=save&nid=<%=nid%>">
	<tbody><tr>
		<td><b>联系方式:</b></td>
		<td>姓名:<%=username%></td>
	</tr></tbody>
	<tbody><tr>
		<td><b>留言内容:</b></td>
		<td><textarea name="contentx" style="display:none;"><%=content%></textarea>
<script type="text/javascript">
	var sBasePath = "/editor/";
	var oFCKeditor = new FCKeditor("FCKeditor1") ;
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + "custom.config.js" ;
	oFCKeditor.ToolbarSet = "review" ;
	oFCKeditor.InstanceName = "content" ;
	oFCKeditor.Width = 600;
	oFCKeditor.Height = 150;
	oFCKeditor.Value = document.add.contentx.value ;
	oFCKeditor.Create() ;
</script></td>
	</tr></tbody>
	<tbody><tr>
		<td><b>回复内容:</b></td>
		<td><textarea name="admin_contentx" style="display:none;"><%=admin_content%></textarea>
<script type="text/javascript">
	var sBasePath = "/editor/";
	var oFCKeditor = new FCKeditor("FCKeditor1") ;
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.Config['CustomConfigurationsPath'] = sBasePath + "custom.config.js" ;
	oFCKeditor.ToolbarSet = "review" ;
	oFCKeditor.InstanceName = "admin_content" ;
	oFCKeditor.Width = 600;
	oFCKeditor.Height = 150;
	oFCKeditor.Value = document.add.admin_contentx.value ;
	oFCKeditor.Create() ;
</script></td>
	</tr></tbody>
	<tbody><tr>
		<td width="20%"></td>
		<td width="80%"><input type="submit" value="确认提交" /></td>
	</tr></tbody>
	</form>
</table>
<%
end sub

'管理列表
sub so_feed_man(page)
%>
<table cellspacing="1">
	<thead><tr>
		<th width="5%">选择</th>
		<th width="5%">标记</th>
		<th width="25%">评论文章</th>
		<th width="9%">姓名</th>
		<th width="13%">时间</th>
		<th width="13%">最后回复</th>
		<th width="20%">操作</th>
	</tr></thead>
	<form action="?act=all" method="post" id="allc">
<%
sql = "select * from so_feed where aid > 0 order by id desc"
rs.open sql,conn,1,1
if rs.eof then
%>
	<tbody><tr><td align="center" colspan="15">暂无内容!</td></tr></tbody>
<%
else
rs.pagesize = 30
if page = 0 then page = 1
if page = "" then page = 1

for i = 1 to rs.pagesize
if rs("reg") = 0 then
	regstr = "未读"
elseif rs("reg") = 1 then
	regstr = "<strong class=""add"">已读</strong>"
elseif rs("reg") = 2 then
	regstr = "<strong class=""del"">[×]</strong>"
end if
%>
	<tbody><tr>
		<td align="center"><input type="checkbox" value="<%=rs("id")%>" name="allid" /></td>
		<td align="center"><%=regstr%></td>
		<td><a href="<%=id2formstr(rs("aid"),"so_article","url_html")%>" class="add" target="_blank"><%=id2formstr(rs("aid"),"so_article","title")%></a></td>
		<td><%=rs("username")%></td>
		<td><%=rs("datestr")%></td>
		<td><%=rs("admin_datestr")%></td>
		<td align="center">
			<a class="mod" href="?act=edit&nid=<%=rs("id")%>">回复/编辑留言</a>
			<a class="del" href="?act=delete&nid=<%=rs("id")%>" onclick="return del()">删除该纪录</a>
		</td>
	</tr></tbody>
<%
rs.movenext
if rs.eof then exit for
next
%>
	<tbody><tr><td align="center" colspan="15"><div id="dispartpage"><%=ps%></div></td></tr></tbody>
<%
end if
rs.close
%>
	<tbody><tr><td colspan="20">
		<input type="button" value="全选" name="allid" id="allbtn" />
		<select name="opt">
			<option value="reg">标记已读—前台显示</option>
			<option value="reg_no">标记已读—前台不显示</option>
			<option value="delete">删除</option>
		</select>
		<input type="submit" value="批量操作" />
	</td></tr></tbody>
	</form>
</table>
<%
end sub

sub so_feed_all()
opt = request.form("opt")
allid = request.form("allid")
select case opt
	case "delete"
		conn.execute "delete * from so_feed where id in ("&allid&")"
	case "reg"
		conn.execute "update so_feed set reg = 1 where id in ("&allid&")"
	case "reg_no"
		conn.execute "update so_feed set reg = 2 where id in ("&allid&")"
end select
call redir("?act=manage")
end sub

sub so_feed_delete(nid)
conn.execute "delete * from so_feed where id = "&nid
call redir("?act=manage")
end sub
%>
<!--#include file="../include/foot.asp"-->