discuz!hack-添加MID、RM、WMV和MP3标签图标的方法
以下只是在发表帖子了显示标签的按钮,还需要后台设置Discuz 自定义代码,
1、修改 include/bbcode.js
在最下面加:
- function mid() {
- if (helpmode){
- alert(mid_help);
- } else if (advmode) {
- AddTxt="[mid] [/mid]";
- AddText(AddTxt);
- } else {
- txt=prompt(mid_normal,"http://");
- if(txt!=null) {
- AddTxt="\r[mid]"+txt;
- AddText(AddTxt);
- AddText("[/mid]");
- }
- }
- }
- function rm() {
- if (helpmode){
- alert(rm_help);
- } else if (advmode) {
- AddTxt="[rm] [/rm]";
- AddText(AddTxt);
- } else {
- txt=prompt(rm_normal,"http://");
- if(txt!=null) {
- AddTxt="\r[rm]"+txt;
- AddText(AddTxt);
- AddText("[/rm]");
- }
- }
- }
- function wmv() {
- if (helpmode){
- alert(wmv_help);
- } else if (advmode) {
- AddTxt="[wmv] [/wmv]";
- AddText(AddTxt);
- } else {
- txt=prompt(wmv_normal,"http://");
- if(txt!=null) {
- AddTxt="\r[wmv]"+txt;
- AddText(AddTxt);
- AddText("[/wmv]");
- }
- }
- }
- function mp3() {
- if (helpmode){
- alert(mp3_help);
- } else if (advmode) {
- AddTxt="[mp3] [/mp3]";
- AddText(AddTxt);
- } else {
- txt=prompt(mp3_normal,"http://");
- if(txt!=null) {
- AddTxt="\r[mp3]"+txt;
- AddText(AddTxt);
- AddText("[/mp3]");
- }
- }
- }
2、修改模板templates/post_bbinsert
查找
- var center_normal = "{lang post_discuzcode_center_normal}";
在下面加:
- var mid_normal = "{lang post_midi}";
- var mid_help = "{lang post_discuzcode_mid}\n\n{lang post_discuzcode_mid_comment}";
- var wmv_normal = "{lang post_wmv}";
- var wmv_help = "{lang post_discuzcode_wmv}\n\n{lang post_discuzcode_wmv_comment}";
- var mp3_normal = "{lang post_mp3}";
- var mp3_help = "{lang post_discuzcode_mp3}\n\n{lang post_discuzcode_mp3_comment}";
- var rm_normal = "{lang post_rm}";
- var rm_help = "{lang post_discuzcode_rm}\n\n{lang post_discuzcode_rm_comment}";
继续查找
- <a href="javascript:underline()"><img src="{IMGDIR}/bb_underline.gif" border="0" alt="{lang post_discuzcode_underline}"></a>
下面添加
- <a hidefocus=true href="javascript:mid()"><img src="{IMGDIR}/bb_mid.gif" border="0" width="23" height="22" alt="{lang post_discuzcode_midi}"></a>
- <a hidefocus=true href="javascript:wmv()"><img src="{IMGDIR}/bb_wmv.gif" border="0" width="23" height="22" alt="{lang post_discuzcode_wmv}"></a>
- <a hidefocus=true href="javascript:rm()"><img src="{IMGDIR}/bb_rm.gif" border="0" width="23" height="22" alt="{lang post_discuzcode_rm}"></a>
- <a href="javascript:mp3()"><img src="{IMGDIR}/bb_mp3.gif" border="0" width="23" height="22" alt="{lang post_discuzcode_mp3}"></a>
3、修改模板templates/templates.lang.php
查找
- 'post_imgcode' => '[img] 代码',
下面添加
- 'post_discuzcode_midi' => '插入 MIDI',
- 'post_discuzcode_wmv' => '插入 WMV 等',
- 'post_discuzcode_rm' => '插入 RM 等',
- 'post_discuzcode_mp3' => '插入 WMA , MP3 等',
- 'post_midi' => '插入 MIDI音乐',
- 'post_rm' => '插入RM',
- 'post_mp3' => '插入 MP3 , WMA 音乐',
- 'post_wmv' => '插入 wmv 等媒体',
4、将相对的图标传images/default/目录下,OK 啦!!\r
5、其他标签类似,只需更改相应参数就可以了。\r
下载
Created By: sb123
Form Page: discuz!hack-添加MID、RM、WMV和MP3标签图标的方法
