原贴请查看:https://discuz.dismall.com/thread-1512944-1-1.html
此插件近乎完美,但是有一个js错误,分析了一下错误,并修正了。
以上为错误图片。
————————————————————————————————修改方法——————————————————————————————————
修改template/default/下,header.htm代码,安装完此插件后根据原来的方法要修改成
<link rel="edituri" type="application/rsd+xml" title="rsd" href="xmlrpc.php?rsd=$space[uid]" />
</head>
<!--{if $space["field_1"]}-->
<body onLoad="playerinit();">
<!--{else}-->
<body>
<!--{/if}-->
现在将此部分改成
<link rel="edituri" type="application/rsd+xml" title="rsd" href="xmlrpc.php?rsd=$space[uid]" />
</head>
<body>
即还原成原来的样子。不必进行修改。
——————————————————
修改template/default/下,space_index.htm代码(将原来的播放器代码改成以下代码,就进用下面的代码进行替换):- <!--空间播放器代码开始-->
- <!--{if $space["field_1"]}-->
- <script language="javascript" src="flash/player1.js"></script>
- <script language="javascript" src="flash/player2.js" for="player" event="playstatechange(newstate)"></script>
- <script language="javascript">
- //歌曲列表
- function musicSwf_DOFSCommand(command,args){
- if (command=="Play"){
- play();
- }
- if (command=="Stop"){
- stop();
- }
- if (command=="Pause"){
- pause();
- }
- if (command=="next"){
- next();
- }
- if (command=="previous"){
- previous();
- }
- if (command=="gotoMusic") {
- showmusiclist();
- }
- }
- </script>
- <script language="javascript">
- //音乐初始化
- function playerinit()
- {
- loop=true;
- userstop=false;
- count=5;
- listURL = new Array();
- RadioList = new Array(count);
- <!--{if $space["field_3"]}-->
- listURL[0]="$space["field_3"]"
- <!--{/if}-->
- <!--{if $space["field_2"]}-->
- RadioList[0]="$space["field_2"]"
- <!--{/if}-->
- <!--{if $space["field_7"]}-->
- listURL[1]="$space["field_7"]"
- <!--{/if}-->
- <!--{if $space["field_6"]}-->
- RadioList[1]="$space["field_6"]"
- <!--{/if}-->
- <!--{if $space["field_9"]}-->
- listURL[2]="$space["field_9"]"
- <!--{/if}-->
- <!--{if $space["field_8"]}-->
- RadioList[2]="$space["field_8"]"
- <!--{/if}-->
- <!--{if $space["field_11"]}-->
- listURL[3]="$space["field_11"]"
- <!--{/if}-->
- <!--{if $space["field_10"]}-->
- RadioList[3]="$space["field_10"]"
- <!--{/if}-->
- <!--{if $space["field_13"]}-->
- listURL[4]="$space["field_13"]"
- <!--{/if}-->
- <!--{if $space["field_12"]}-->
- RadioList[4]="$space["field_12"]"
- <!--{/if}-->
- NowId=0;
- musicSwf.SetVariable("musicName", RadioList[NowId]);
- player.URL=listURL[NowId];
- //音乐初始结束
- }
- </script>
- <script language="vbscript">
- //音乐播放器命FSCommand
- Sub musicSwf_FSCommand(ByVal command, ByVal args)
- call musicSwf_DOFSCommand(command, args)
- end sub
- </script>
- <div id="space_app_guide" class="box">
- <h2>音乐盒</h2>
- <object id="player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="0" height="0" codebase="nsmp2inf.cab#Version=5,1,52,701standby=Loading" tppabs="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701standby=Loading" type="application/x-oleobject">
- <param name="URL" value="">
- <param name="UIMode" value="invisible">
- <param name="AutoStart" value="true">
- <param name="Enabled" value="true">
- <param name="enableContextMenu" value="false">
- <param name="DisplayBackColor" value="100">
- <param name="DisplayForeColor" value="100">
- <param name="WindowlessVideo" value="true">
- </object>
- <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="210" height="120" id="musicSwf">
- <param name="movie" value="flash/$space["field_1"]">
- <param name="quality" value="high">
- <param name="wmode" value="transparent">
- <param name="allowScriptAccess" value="always">
- </object>
- </div>
- <script type="text/javascript">
- playerinit();
- </script>
- <!--{/if}-->
- <!--空间播放器代码结束-->
复制代码 ————————————————修改完毕 |