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

📄 manage.asp

📁 网页中的flash播放器
💻 ASP
📖 第 1 页 / 共 3 页
字号:
sql="select config from cmp_config"
set rs=conn.execute(sql)
if not rs.eof then
%>
<script language="JavaScript" type="text/javascript">
function check_config(){
	if(!confirm('确认修改吗?')) return false;
}
</script>
<table border="0" cellspacing="1" cellpadding="5" align=center class="tableBorder">
  <form name="form_config" method="post" id="form_config" action="?action=save_config" onSubmit="return check_config();">
    <tr>
      <th align="center">播放器配置 (<a href="images/cmp21config.gif" target="_blank">查看配置说明</a>)</th>
    </tr>
    <tr>
      <td class="cmsRow" align="center"><textarea name="config" id="config" style="width:100%;height:420px;"><%=rs("config")%></textarea></td>
    </tr>
    <tr>
      <td class="cmsRow" align="center"><input type="submit" class=button name="submit_config" value=" 修 改 "> 
        (修改前请做好备份,写html内容请使用: <span style="color: #0000FF">&lt;![CDATA[<span style="color: #000000">内容</span>]]&gt;</span> )</td>
    </tr>
  </form>
</table>
<%
end if
rs.close
set rs=nothing
end sub

sub save_config()
dim config
	config=request("config")
		if config="" then Errmsg=Errmsg&"<li>配置不能为空!请返回重新填写信息!"
	If ErrMsg<>"" Then 
		cenfun_error()
	else
		conn.execute("Update cmp_config Set config='"&config&"'")
		SucMsg=SucMsg&"<li>修改配置资料成功!"
		Cenfun_suc("?action=config")
	end if
end sub

Function Checkxml(Str)
	If Isnull(Str) Then
		Checkxml = ""
		Exit Function 
	End If
	Str = Replace(Str,"<","&lt;")
	Str = Replace(Str,">","&gt;")
	Str = Replace(Str,"&","&amp;")
	Str = Replace(Str,"'","&apos;")
	Str = Replace(Str,Chr(34),"&quot;")
	Checkxml = Str
End Function
Function iCheckxml(Str)
	If Isnull(Str) Then
		iCheckxml = ""
		Exit Function 
	End If
	Str = Replace(Str,"&lt;","<")
	Str = Replace(Str,"&gt;",">")
	Str = Replace(Str,"&amp;","&")
	Str = Replace(Str,"&apos;","'")
	'Str = Replace(Str,"&quot;",Chr(34))
	iCheckxml = Str
End Function

sub make_xml()
dim isnewlist,newlistname,listname
isnewlist=Checkxml(Request.Form("isnewlist"))
newlistname=Checkxml(Request.Form("newlistname"))
if isnewlist="1" and newlistname<>"" then
	listname=newlistname
else 
	listname="最近更新"
end if
%>
<table border="0" cellspacing="1" cellpadding="5" align="center" class="tableBorder">
  <tr>
    <th colspan="4" align="center">生成XML文件</th>
  </tr>
  <tr>
    <td align="right" class="cmsRow">注意:</td>
    <td class="cmsRow">所有的操作完成,最后请务必在这里生成xml文件方能更新信息!</td>
  </tr>
  <form name="makelistform" action="?action=make_xml&make_xml=make_list" method="post">
    <tr>
      <td align="right" nowrap="nowrap" class="cmsRow">生成所有XML文件:</td>
      <td class="cmsRow"><input type="submit" class="button" name="submit_config2" value="点击生成"  style="width:120px;height:40px;cursor:hand;" /></td>
    </tr>
  </form>
  <%if request("make_xml")="make_list" then%>
  <tr>
    <td align="right" nowrap="nowrap" class="cmsRow">&nbsp;</td>
    <td class="cmsRow"><%
dim rsclass,num
num=0
dim cflist_str,file_server,file_path,file_name
file_server="xml/"
file_path="../xml/"
file_name="list"
dim xml_head,xml_foot
xml_head="<?xml version=""1.0"" encoding=""gb2312""?>"&"<list>"
xml_foot="</list>"
'---------------------------------------------------------------------------------
set rsclass=conn.execute("select classid,classname from cmp_class order by sn")
do while not rsclass.eof
	cflist_str=xml_head
	set rs=conn.execute("select title,url,lrc,content,pic,t,fg,a,c,u,scene from cmp_list where classid="&rsclass("classid")&" order by sn")
	do while not rs.eof	
		cflist_str=cflist_str&make_cflist_music(rs("title"),rs("url"),rs("lrc"),rs("content"),rs("pic"),rs("t"),rs("fg"),rs("a"),rs("c"),rs("u"),rs("scene"))
	rs.movenext
	loop
	rs.close
	set rs=nothing
	cflist_str=cflist_str&xml_foot
	make_file cflist_str,file_path&file_name&num&".xml"
	response.write "生成 <a href='"&file_path&file_name&num&".xml' target='_blank' style='color:#ff0000;'>"&Checkxml(rsclass("classname"))&":"&file_path&file_name&num&".xml</a> 成功!<br>"
num=num+1
rsclass.movenext
loop
rsclass.close
set rsclass=nothing
'---------------------------------------------------------------------------------
'make config
dim config_str,file_path_name
file_path_name="../xml/config.xml"
sql="select config from cmp_config"
set rs=conn.execute(sql)
if not rs.eof then
	config_str=rs("config")	
	make_file config_str,file_path_name
	response.write "生成 <a href='"&file_path_name&"' target='_blank' style='color:#ff0000;'>配置文件:"&file_path_name&"</a> 成功!"		
else
	response.write "没有任何信息!生成文件失败!"
end if
rs.close
set rs=nothing
%>
    </td>
  </tr>
  <%end if%>
</table>
<%
end sub

function make_file(str,path)
    dim fs,fsowrite
	on error resume next
	Set fs=CreateObject("Scripting.fileSystemObject")
    	Set fsowrite = fs.CreateTextFile(server.MapPath(path),true)
        fsowrite.Write str
        fsowrite.close
		set fsowrite=nothing
	set fs=nothing
	if err.number<>0 then
		response.write "<center>"&Err.Description&",您的空间不支持FSO,请同您的空间商联系,或者查看相关权限设置。</center>"
	end if
end function

function make_cflist_music(title,url,lrc,content,pic,t,fg,a,c,u,scene)
	dim str
		str=str&"<m>"
			str=str&"<n>"&Checkxml(title)&"</n>"
			str=str&"<u"
			if t<>"" then str=str&" t="""&t&""""
			str=str&">"&Checkxml(url)&"</u>"
			str=str&"<c>"&Checkxml(content)&"</c>"
			str=str&"<p"
			if a<>"" then str=str&" a="""&a&""""
			if c<>"" then str=str&" c="""&c&""""
			if u<>"" then str=str&" u="""&u&""""
			str=str&">"&Checkxml(pic)&"</p>"
			str=str&"<l>"&Checkxml(lrc)&"</l>"
			str=str&"<s"
			if fg<>"" then str=str&" fg="""&fg&""""
			str=str&">"&Checkxml(scene)&"</s>"		
		str=str&"</m>"
	make_cflist_music=str	
end function

sub check_music_name()
%>
<table border="0" cellspacing="2" cellpadding="5" align="center" width="95%">
  <tr>
    <td align="center"><%
	set rs=conn.execute("select title from cmp_list Where title='"&request("music_name")&"'")
	if rs.eof then
		response.Write("可以添加!")
	else
		response.Write("已经存在<a href=""javascript:search_music_name('"&request("music_name")&"')""><font color=#ff0000>"&rs("title")&"</font></a>")
	end if
	rs.close
	set rs=nothing
%>
    </td>
  </tr>
  <tr>
    <td align="center"><input type="button" value="关 闭" onClick="window.close();" /></td>
  </tr>
</table>
<script language="JavaScript" type="text/javascript">
function search_music_name(music_name){
	opener.location="?selectkey="+music_name;
	window.close();
}
</script>
<%
end sub

sub make_lrc()
dim objFSO,objCountFile
dim lrc_name,lrc_content,lrc_path,root_lrc_path
'on error resume next
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
dim this_path,parent_path
this_path="http://"&Request.ServerVariables("HTTP_HOST")&left(Request.ServerVariables("PATH_INFO"),InStrRev(Request.ServerVariables("PATH_INFO"),"/")-1)
parent_path=left(this_path,InStrRev(this_path,"/"))
if request("make_lrc")="save" then
	lrc_content=request("lrc_content")
	lrc_path=request("lrc_path")
	if lrc_path<>"" and lrc_content<>"" then
		make_file lrc_content,lrc_path
		root_lrc_path=request("root_lrc_path")
%>
<script language="JavaScript" type="text/javascript">
//
function savepath(){
	opener.document.getElementById('lrc').value=document.getElementById('lrc_url').value;
	window.close();
}
function userpath1(){
	document.getElementById('lrc_url').value="<%=root_lrc_path%>";
}
function userpath2(){
	document.getElementById('lrc_url').value="<%=parent_path&root_lrc_path%>";
}
//
function copyToClipboard(obj){
	obj.select();
	rgn = obj.createTextRange();
	rgn.execCommand("Copy");
}

</script>
<table border="0" cellspacing="1" cellpadding="5" align=center class="tableBorder">
  <tr>
    <th align="center">歌词文件管理</th>
  </tr>
  <tr>
    <td align="center" class="cmsRow">歌词文件保存成功!</td>
  </tr>
  <tr>
    <td align="center" class="cmsRow"><input name="radiobutton" type="radio" value="radiobutton" checked="checked" onClick="userpath1();" />
      使用相对地址
      <input type="radio" name="radiobutton" value="radiobutton" onClick="userpath2();" />
      使用绝对地址</td>
  </tr>
  <tr>
    <td align="center" class="cmsRow"><input name="lrc_url" type="text" id="lrc_url" value="<%=root_lrc_path%>" size="70">
      <input type="button" name="Submit" value="复制到剪贴板" onClick="copyToClipboard(document.getElementById('lrc_url'));"></td>
  </tr>
  <tr>
    <td align="center" class="cmsRow"><input type="button" name="Submit3" value="确 定" onClick="savepath()"></td>
  </tr>
</table>
<%
	end if
else
	lrc_name=request("lrc_name")&".txt"
	lrc_path="../lrc/"&lrc_name
	root_lrc_path="lrc/"&lrc_name
	if objFSO.FileExists(Server.MapPath(lrc_path)) then
		Set objCountFile = objFSO.OpenTextFile(Server.MapPath(lrc_path),1,False)
		If Not objCountFile.AtEndOfStream Then
			lrc_content = objCountFile.ReadAll
		else
			lrc_content = ""
		end if
		objCountFile.Close
		Set objCountFile=Nothing
	else
		lrc_content = ""
	end if
%>
<table border="0" cellspacing="1" cellpadding="5" align=center class="tableBorder">
  <form name="lrc_file_form" action="?nomenu=1&action=make_lrc&make_lrc=save" method="post">
    <tr>
      <th colspan="4" align="center">歌词文件管理</th>
    </tr>
    <tr>
      <td align="right" class="cmsRow"><strong>文件名:</strong></td>
      <td class="cmsRow"><input type="text" size="50" name="lrc_name" value="<%=lrc_name%>" /></td>
    </tr>
    <tr>
      <td align="right" class="cmsRow"><strong>歌词内容:</strong><br />
        <br />
        [ti:歌名]<br />
        [ar:艺人]<br />
        [al:专辑]<br />
        [by:CenFun]<br />
        [offset:500]</td>
      <td class="cmsRow"><textarea name="lrc_content" rows="20" style="width:100%;"><%=lrc_content%></textarea></td>
    </tr>
    <tr>
      <td align="right" class="cmsRow"><strong>文件保存路径:</strong></td>
      <td class="cmsRow"><input type="text" size="70" name="lrc_path" value="<%=lrc_path%>" /></td>
    </tr>
    <tr>
      <td align="right" class="cmsRow"><strong>歌词使用地址:</strong></td>
      <td class="cmsRow"><input type="text" size="70" name="root_lrc_path" value="<%=root_lrc_path%>" /></td>
    </tr>
    <tr>
      <td colspan="2" align="center" class="cmsRow"><input type="button" onClick="check_lrc();" class="button" name="submit_lrc_file" value=" 提 交 " />
        <input type="reset" class="button" name="reset_lrc_file" value=" 取 消 " onClick="window.close();"/></td>
    </tr>
  </form>
</table>
<script language="JavaScript" type="text/javascript">
function check_lrc(){
	if(document.lrc_file_form.lrc_content.value==""){
		alert("歌词内容不能为空!");
		document.lrc_file_form.lrc_content.focus();
		return false;
	}
	if(document.lrc_file_form.lrc_path.value==""){
		alert("歌词文件保存路径不能为空!");
		document.lrc_file_form.lrc_path.focus();
		return false;
	}
	document.lrc_file_form.submit();
}
</script>
<%	
end if
Set objFSO = Nothing
if err.number<>0 then
	response.write "<center>"&Err.Description&",您的空间不支持FSO,请同您的空间商联系,或者查看相关权限设置。</center>"
end if
end sub

sub show()
%>
<table border="0" cellspacing="1" cellpadding="5" align=center class="tableBorder">
  <tr>
    <td align="center" class="cmsRow"><embed src="../cmp.swf?config=.." quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="420" id="cmp"></embed>
    </td>
  </tr>
  <tr>
    <td align="center" class="cmsRow"><p>如果没有刷新,请确定点击了<a href="?action=make_xml">生成xml文件</a>功能,仍然没有刷新则清空您的浏览器缓存即可!(<a href="../index.htm" target="_blank">带WMP接口页面</a>)</p></td>
  </tr>
</table>
<meta http-equiv=Pragma content=no-cache>
<meta http-equiv=expires content=0>
<meta http-equiv="cache-control" content="no-store">
<%
end sub
%>

⌨️ 快捷键说明

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