让你的BO-BLOG使用的FMPlayer 插件更加的人性化

主要改进: 让页面 不会因为进入音乐模式而跳到首页,而且增加切换回非音乐模式的功能。。。 当想听音乐的时候 在所在页面点导航栏的【音乐】进入播放模式。。而且页面还会保持当前页面 不会跳到首页 当处于播放模式的时候 想切换到非音乐模式的时候 只需点下导航栏的【音乐】 即可去掉音乐模式。。。 而且页面保持在原来的页面。。。

第一步修改elements.php 到BLOG 风格目录下找到 elements.php 查找

$elements[‘displayfooter’]=<<<eot
再其下部插入
[separator]

<script language=”javascript” type=”text/javascript”>
<!–
top.document.title = document.title ;
function openmusic (){
if (top.document.location.href.indexOf(“music.php”)>=0){
top.document.location.href = document.location.href;
}else{
top.document.location.href = “{$config[‘blogurl’]}/music.php?loadiframepage=”+escape(document.location.href);
}

}
–>
</script>

第二步 修改 music.php 到BLOG 的根目录找到 music.php 注 FMPlayer插件的默认文件名是fmp.php 需要将fmp.php 改名为music.php 打开并修改music.php 找到


<?php
include(“plugin/fmplayer/include.php”);
include($file[‘dcfg’]);

在其下部插入

$loadiframepage = $_GET[‘loadiframepage’]?urldecode($_GET[‘loadiframepage’]):’index.php’;

找到

var docPage=window.location.search.substring(1);
if(docPage){window.setTimeout(‘MainFrame_change(docPage)’,500)}
function MainFrame_change(docPage){document.getElementById(“mainTopicFrame”).src= “read.php?”+ docPage;}

将其内容删除

找到

<iframe name=”mainTopicFrame” id=”mainTopicFrame”
src=”index.php” title=”URL” height=”100%”
width=”100%” frameborder=”0″
marginwidth=”0″ marginheight=”0″ vspace=”0″ hspace=”0″>
</iframe>

替换成

<iframe name=”mainTopicFrame” id=”mainTopicFrame”
src=”{$loadiframepage}” title=”URL” height=”100%”
width=”100%” frameborder=”0″
marginwidth=”0″ marginheight=”0″ vspace=”0″ hspace=”0″>
</iframe>

第三步 修改 模块

进入后台管理 -> 模块配置 -> 顶部模块 找到FMPlayer插件的 所在模块 Music 然后点编辑 修改链接地址 为 javascript:openmusic(); 好了 修改完毕!

附件内是FMPlayer1.6全部文件 没有的可以到这里下载 FMPlayer1.6 的发布页面在这里 http://bbs.bo-blog.com/viewthread.php?tid=13123&extra=page%3D1