帝国cms二级目录站插件 帝国二次开发会员中心 新消息声音提示方法

帝国CMS教程

会员中心 新消息声音提示方法:

1. 在/e/member/cp /index.php 文件中找到

 

//是否有短消息$havemsg="无";if($user[havemsg]){$havemsg="<ahref='".$public_r['newsurl']."e/member/msg'target=_blank><fontcolor=red>您有新消息</font></a>";}

在 $havemsg="<a href='".$public_r['newsurl']."e/member/msg' target=_blank><font color=red>您有新消息</font></a>";这行下加上

 

$s="/e/member/cp/duanxin.mp3";//mp3文件地址根据自己的mp3文件地址写

2. 在/e/template/member/cp.php中合适位置(比如文件最后的</body>前)加上

 

<audiostyle="display:none;height:0"preload="auto"id="bgmusic"autoplay="autoplay"src="<?=$s?>"></audio>

说明:电脑端使用正常,因为移动端自动播放被一些浏览器屏蔽,所以像qq浏览器等能正常使用,像uc、360浏览器等不能自动播放。