<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->

<!--#include file="conn.asp"-->

<%
'---------------------
' write by 绿水青山 for 动网6.0
' 本插件经由 gafc 修改适应leadbbs3.14
'---------------------
DEF_BBS_HomeUrl = "../../"

dim name
name=htmlencode(Request.QueryString("medianame"))

%>
<html>
<head>
<title>正在播放...<%=name%></title>
</head>
<body topmargin=0 leftmargin=0 bgcolor=#000000>

<%
dim Errmsg
Errmsg=""

dim rs,sql,founderr
founderr=false

        set rs=server.createobject("adodb.recordset")
        sql="select * from media where id="&request("id")
        rs.open sql,connDG,1,3


if GBL_CHK_User="" then
   errmsg=errmsg&"<li>客人不可以听歌。</li>"
   errmsg=errmsg&"<li>请先<a href="&DEF_BBS_HomeUrl&"user/userjoin.asp>注册</a>或<a href="&DEF_BBS_HomeUrl&"user/login.asp>登录</a>。</li>"
   founderr=true
end if
 
if trim(rs("incept"))<>"全体会员" then
   if trim(rs("incept"))=GBL_CHK_User or trim(rs("sender"))=GBL_CHK_User then
      founderr=false
   else
      Errmsg=Errmsg&"<li>对不起，无人为您点播此歌！</li>"
      founderr=true
   end if
else
   founderr=false
end if

if founderr=true then
   call Errormsg()	
else	
        if rs.eof or rs.bof then
           Errmsg=Errmsg&"<li>未找到该歌曲，该歌曲可能已被删除。</li>"
           call Errormsg()
        else
         
           if trim(rs("incept")) = "全体会员" then
              if instr(rs("acceptuser"),GBL_CHK_User&"|") = 0 or instr(rs("acceptuser"),GBL_CHK_User&"|") = null then
                 rs("acceptuser")=rs("acceptuser")&GBL_CHK_User&"|"
              end if
           else
              if trim(rs("incept")) = GBL_CHK_User then
                 rs("isaccept")=1
              end if
           end if
             
           rs.update
           rs.close
           set rs=nothing
         end if
 
          call CloseDB()     

 
	dim lurl
	lurl=Request.QueryString("url")

	select case Lcase(right(lurl,4))
		case ".swf"
%>		
			<p align=center>
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="270">
  				<param name="movie" value="<%=lurl%>">
  				<param name="quality" value="high">
  				<embed src="<%=lurl%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="270"></embed>
  			</object>
<%	
		CASE ".wmv",".mpg",".avi"	
%>
			<p align=center>
			<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=400 height=270 >
				<param name=ShowStatusBar value=-1>
				<param name=Filename value=<%=replace(lurl,chr(32),"%20",1)%>>
				<embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=<%=replace(lurl,chr(32),"%20",1)%>  width=500 height=100></embed>
			</object>
<%	
		CASE ".mp3",".mid"	
%>
			<p align=center>
			<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=400 height=270 >
				<param name=ShowStatusBar value=-1>
				<param name=Filename value=<%=replace(lurl,chr(32),"%20",1)%>>
				<embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=<%=replace(lurl,chr(32),"%20",1)%>  width=400 height=270></embed>
			</object>
<%
		case else

			select case Lcase(right(lurl,3))
			  case ".rm","ram"
%>			
				<p align=center>
				<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=400 height=270>
					<PARAM NAME=SRC VALUE=<%=lurl%>><PARAM NAME=CONSOLE VALUE=Clip1>
					<PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=true>
				</OBJECT>
				<br>
				<OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=400>
					<PARAM NAME=SRC VALUE=<%=lurl%>><PARAM NAME=AUTOSTART VALUE=-1>
					<PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1>
				</OBJECT>
<%	
			 case ".ra"
%>			
				<p align=center>
				<OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=270 id=video2 width=400>
					<PARAM NAME=SRC VALUE=<%=lurl%>><PARAM NAME=AUTOSTART VALUE=-1>
					<PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1>
				</OBJECT>
<%			 	
			 case else 
%>
				<p align=center>
				<embed name=player src=<%=lurl%> type=audio/x-pn-realaudio-plugin width=410 height=270 border=0 autostart=1>  
<%  
			end select   
	end select  
end if

%>
</body>
</html>
