因为我的论坛中有一个音乐板块所以想让此版块在访问时播放背景音乐,调查了论坛中的一些帖子,现总结如下,如有需要的朋友可以分享
方法是在板块的板块规则中放置HTML代码,因为6.0之后的版本版块规则不支持Html代码,只支持Discuz代码。我试了一下,Discuz代码也不能正常支持,所以方法是修改代码恢复支持Html代码。
演示地址:http://www.bit-voice.net/forumdisplay.php?fid=39&page=1
步骤1,修改程序代码,此方法来此论坛中的帖子
打开 /admin/forums.inc.php 查找:- showsetting('forums_edit_description', 'descriptionnew', html2bbcode($forum['description']), 'textarea'); showsetting('forums_edit_rules', 'rulesnew', html2bbcode($forum['rules']), 'textarea');
复制代码 改为:- showsetting('forums_edit_description', 'descriptionnew', $forum['description'], 'textarea'); showsetting('forums_edit_rules', 'rulesnew', $forum['rules'], 'textarea');
复制代码 继续查找:- $descriptionnew = addslashes(discuzcode(stripslashes($descriptionnew), 1, 0, 0, 0, 1, 1, 0, 0, 1)); $rulesnew = addslashes(discuzcode(stripslashes($rulesnew), 1, 0, 0, 0, 1, 1, 0, 0, 1));
复制代码 改为:- $descriptionnew = addslashes(stripslashes($descriptionnew)); $rulesnew = addslashes(stripslashes($rulesnew));
复制代码 OK!现在可以使用 HTML代码了……
步骤2 放置背景音乐的代码
1,直接放置背景音乐
<bgsound src= "./attachments/swfupload/Pick Me Up - Emilia De Poret.wma" loop="-1">
2,在规则中安置播放器
<EMBED src="./attachments/swfupload/Pick Me Up - Emilia De Poret.wma" width=400 height=65 type=audio/mpeg ShowStatusBar="1" volume="0" autostart="true" loop="-1">
注意,请放置音乐文件的相对路径,绝对路径不知道为什么不能打开 |