<!--#include file="conn.asp"-->
<!--#include file="z_dgconn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/dv_loadcache.asp"-->
<%
If Not IsObject(Conn) Then ConnectionDatabase
dim sql,rs,founderr,i,errmsg
founderr=false
Dvbbs.LoadTemplates("")


'---------------------
' write by 绿水青山
' 本插件经由 cyp2 修改适应DVBBS7.0.0
'---------------------
'桀骜添加页面错误提示信息
Sub dvbbs_error()
	Response.Write"<br>"
	Response.Write"<table cellpadding=3 cellspacing=1 align=center class=""tableBorder"" style=""width:75%"">"
	Response.Write"<tr align=center>"
	Response.Write"<th width=""100%"" height=25 colspan=2>错误信息"
	Response.Write"</td>"
	Response.Write"</tr>"
	Response.Write"<tr>"
	Response.Write"<td width=""100%"" class=""Forumrow"" colspan=2>"
	Response.Write ErrMsg
	Response.Write"</td></tr>"
	Response.Write"<tr>"
	Response.Write"<td class=""Forumrow"" valign=middle colspan=2 align=center><a href=""javascript:history.go(-1)""><<返回上一页</a></td></tr>"
	Response.Write"</table>"
	Dvbbs.Footer()
	Response.End 
End Sub 
'桀骜添加页面错误提示信息
dim id,candeletedg
candeletedg=false	
if dvbbs.membername="" or (not dvbbs.founduser) then
	errmsg=errmsg+"<br>"+"<li>您还没有登陆论坛，请登陆后再来"
	dvbbs.FoundIsChallenge=true
end if	
if request("id")="" or (not isnumeric(request("id"))) then
	errmsg=errmsg+"<br>"+"<li>参数非法，请确认您是从有效连接进入"
	dvbbs.FoundIsChallenge=true
else
	id=clng(request("id"))
end if
'==========判断是否可以删除点歌 开始
if not dvbbs.FoundIsChallenge then
	set rs=connDG.execute("select sender,incept from [media] where id="&id)
	if rs.bof and rs.eof then
		errmsg=errmsg+"<br>"+"<li>参数非法，请确认您是从有效连接进入"
		dvbbs.FoundIsChallenge=true
	elseif rs(0)=dvbbs.membername or rs(1)=dvbbs.membername or dvbbs.master then
		candeletedg=true
	else
		errmsg=errmsg+"<br>"+"<li>您没有删除此点歌的权限"
		dvbbs.FoundIsChallenge=true
	end if	
end if		
'==========判断是否可以删除点歌 结束	
if dvbbs.FoundIsChallenge or (not candeletedg) then
	dvbbs.stats="点歌控制面板"
	dvbbs.nav()
	Dvbbs.Head_var 2,0,"",""
	call dvbbs_error()
	call CloseDB()
	call dvbbs.footer()
else	
	sql="delete * from [media] where id="&id
	connDG.Execute(sql)
	conn.close
	set conn=nothing
	call CloseDB()
	response.redirect Request.ServerVariables("HTTP_REFERER")
end if
%>