JS版本...在DZ官方不重复发帖了...FD发了帖子了
按楼主的方法修改include\discuzcode.php
post_bbinsert.htm找到var image_normal = "{lang post_discuzcode_image_normal}";
之后添加
var wmv_help = "{lang post_discuzcode_wmv_help}";
var media_normal = "{lang post_discuzcode_media_normal}";
var media_input1 = "{lang post_discuzcode_media_input1}";
var media_input2 = "{lang post_discuzcode_media_input2}";
var media_input3 = "{lang post_discuzcode_media_input3}";
var rm_help = "{lang post_discuzcode_rm_help}";
找到
<a href="javascript:code()"><img src="{IMGDIR}/bb_code.gif" border="0" alt="{lang post_discuzcode_code}"></a>
之后添加
<a href="javascript:wmv()"><img src="{IMGDIR}/vod.gif" border="0" alt="{lang post_discuzcode_wmv}"></a>
<a href="javascript:rm()"><img src="{IMGDIR}/rm.gif" border="0" alt="{lang post_discuzcode_rm}"></a>
include/bbcode.js在最后添加
function wmv() {
if (helpmode){
alert(wmv_help);
} else if (getSelectedText()) {
var range = document.selection.createRange();
range.text = "[wmv=480,360,1]" + range.text + "[/wmv]";
} else if (advmode) {
AddTxt="[wmv=480,360,1] [/wmv]";
AddText(AddTxt);
} else {
txt2=prompt(media_input1,"480");
txt3=prompt(media_input2,"360");
txt4=prompt(media_input3,"1");
if (txt2!=null && txt3!=null && txt4!=null ){
txt=prompt(media_normal,"http://");
if(txt!=null) {
if (txt2!="" && txt3!="" && txt4!=""){
AddTxt="[wmv="+txt2+","+txt3+","+txt4+"]"+txt;
AddText(AddTxt);
AddText("[/wmv]");
}else{
AddTxt="[wmv=480,360,1]"+txt;
AddText(AddTxt);
AddText("[/wmv]");
}
}
}
}
}
function rm() {
if (helpmode){
alert(rm_help);
} else if (getSelectedText()) {
var range = document.selection.createRange();
range.text = "[rm=480,360,1]" + range.text + "[/rm]";
} else if (advmode) {
AddTxt="[rm=480,360,1] [/rm]";
AddText(AddTxt);
} else {
txt2=prompt(media_input1,"480");
txt3=prompt(media_input2,"360");
txt4=prompt(media_input3,"1");
if (txt2!=null && txt3!=null && txt4!=null ){
txt=prompt(media_normal,"http://");
if(txt!=null) {
if (txt2!="" && txt3!="" && txt4!=""){
AddTxt="[rm="+txt2+","+txt3+","+txt4+"]"+txt;
AddText(AddTxt);
AddText("[/rm]");
}else{
AddTxt="[rm=480,360,1]"+txt;
AddText(AddTxt);
AddText("[/rm]");
}
}
}
}
}
templates.lang.php找到
'post_discuzcode_list_normal_input' => '请输入列表项目内容,如果留空表示项目结束。',
之后添加
'post_discuzcode_rm' => '插入RM类型的视频或音频文件',
'post_discuzcode_rm_help' => '插入RM类型的视频或音频文件[rm=x,y,n]URL[/rm]',
'post_discuzcode_media_normal' => '插入视频或音频文件的地址',
'post_discuzcode_media_input1' => '插入视频或音频文件的宽度,推荐480',
'post_discuzcode_media_input2' => '插入视频或音频文件的高度,推荐360',
'post_discuzcode_media_input3' => '是否自动播放,1=自动播放、0=手动播放',
'post_discuzcode_wmv' => '插入WMV类型的视频或音频文件',
'post_discuzcode_wmv_help' => '插入WMV类型的视频或音频文件[wmv=x,y,n]URL[/wmv]',
DONE!!!Firefox1.0.3以及IE6.0withSP1下测试成功!!!
[ 本帖最后由 cuijun 于 2005-7-3 16:41 编辑 ]
再次发现一个小错误!请更正!
'post_discuzcode_media_input3' => '是否自动播放,1=自动播放、0=手动播放',
[ 本帖最后由 cuijun 于 2005-7-4 18:09 编辑 ] |