Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

为Discuz! 2.5增加[music]按钮 小Hack!

[复制链接]
Weiman 发表于 2005-1-7 05:59:05 | 显示全部楼层 |阅读模式
源文转自: http://www.21ed.net/viewthread.php?tid=14

增加按钮前先要增加 music Discuz!代码:

进后台管理 ->帖子相关->Discuz! 代码

新增: music

新增后点祥情:

替换内容填:

  1. <embed src={1} height="45" width="314" AutoStart=1 border="0"
  2. ></embed>
复制代码


例子填:

  1. [music]http://www.21ed.net/music.mp3[/music]
复制代码


解释填:

  1. 适用于可以使用Windows Media Player进行播放的音乐格式文件
复制代码


嵌套次数真: 1

修改 /include/bbcode.js

在文件最后加:

  1. function music() {
  2.         if (helpmode){
  3.                 alert(music_help);
  4.         } else if (document.selection && document.selection.type == "Text") {
  5.                 var range = document.selection.createRange();
  6.                 range.text = "[music]" + range.text + "[/music]";
  7.         } else if (advmode) {
  8.                 AddTxt="[music] [/music]";
  9.                 AddText(AddTxt);
  10.         } else {  
  11.                 txt=prompt(music_normal,"http://");   
  12.                 if(txt!=null) {            
  13.                         AddTxt="\r[music]"+txt;
  14.                         AddText(AddTxt);
  15.                         AddText("[/music]");
  16.                 }      
  17.         }
  18. }
复制代码


修改 /templates/default/post_bbinsert.htm 模板

查找:

  1. var underline_normal = "{lang post_discuzcode_underline_normal}";
复制代码


在下面加:

  1. var music_help = "{lang post_discuzcode_music}\n\n{lang post_discuzcode_music_comment}";
  2. var music_normal = "{lang post_discuzcode_music_normal}";
复制代码


查找:

  1. <a href="javascript:list()"><img src="{IMGDIR}/bb_list.gif" border="0" alt="{lang post_discuzcode_list}"></a>
复制代码


在下面加:

  1. <a href="javascript:music()"><img src="{IMGDIR}/bb_music.gif" border="0" alt="{lang post_discuzcode_music}"></a>
复制代码


修改 /templates/default/templates.lang.php 文件

查找:

  1. 'post_discuzcode_list_normal_input' => '请输入列表项目内容,如果留空表示项目结束。',
复制代码


在下面加:

  1. 'post_discuzcode_music' => '插入 music',
  2. 'post_discuzcode_music_comment' => '在文本中插入 音乐文件。\n例如:[music]http://www.21ed.net/music.mp3[/music]',
  3. 'post_discuzcode_music_normal' => '请输入 音乐文件的 URL。',
复制代码


最后把这个图
拷贝到 /images/default/
效果:
这里原来没有[music]支持,那只有到 http://www.21ed.net 看看了.

[ Last edited by Weiman on 2005-1-7 at 06:04 ]

评分

1

查看全部评分

渡雨 发表于 2005-1-7 07:07:38 | 显示全部楼层
已经成功。顶!!!
回复

使用道具 举报

绝对痴心 发表于 2005-1-7 09:09:50 | 显示全部楼层
不错,给你加分
回复

使用道具 举报

killangel 发表于 2005-1-7 09:34:37 | 显示全部楼层
謝謝的說。
回复

使用道具 举报

seraphami 发表于 2005-1-7 10:23:11 | 显示全部楼层
回复

使用道具 举报

kevin615 发表于 2005-1-7 10:33:00 | 显示全部楼层
真是好用的小東西..推..
回复

使用道具 举报

QQ 发表于 2005-1-7 10:59:54 | 显示全部楼层
谢谢分享......
回复

使用道具 举报

wkcom 发表于 2005-1-7 11:43:00 | 显示全部楼层
这个 不错哦,会不会和其他的WMV那些混淆啊?
回复

使用道具 举报

msm1985 发表于 2005-1-7 12:13:40 | 显示全部楼层
顶!!!
回复

使用道具 举报

laoyang 发表于 2005-1-7 13:47:54 | 显示全部楼层
不好,应分细一下,ra/rm、wmv等
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-3 17:06 , Processed in 0.121187 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表