Blueimp 論壇首頁
  首頁  | 討論區  | 最新話題  | 搜尋  | XML  |  登入
博客來購書 | 《主管這樣帶人就對了!》
貝殼鯨魚兒童程式啟蒙(點我去報名)

此話題中所有文章數: 1 [ 話題狀態: 一般 ]
上一話題 此文章已經觀看 5252 次 而且有 0 篇回應 下一話題
會員大頭照
男寶寶 jieh 《騎士團團長》
文章: 6857
v3.8.8

怎样令mvnForum支持粘贴audio和video的功能

Demo见
http://www.funcrystal.com/forum/viewthread?thread=224


修改源码文件 net.myvietnam.mvncore.filter.URLFilter
在函数 filter(String)中,While循环结束前添加以下代码:
/*Added by Jing Xu, www.shorelinesolution.com . Process [aud] and [vid]*/
else if (cur == '[' && index < len - 6 && chars[i = index + 1] == 'a' &&chars[++i] == 'u' && chars[++i] == 'd' && chars[++i] == ']' ) {
//process [aud]
j = ++i;
int u1 = j-1;
int u2 = input.indexOf("[/aud]", u1 + 1);
if (u2 < 0) {
buf.append(chars, oldend, j - oldend);
oldend = j;
} else {
buf.append(chars, oldend, index - oldend);
buf.append("String href = input.substring(u1 + 1, u2).trim();
// Add http:// to the front of links if and only if it doesn't have any protocols.
// Doing this handles this: "[aud=sun.com]SUN[/aud]"
// Changing it to SUN
// instead of SUN
if (href.indexOf("://") == -1) {
href = "http://" + href;
}
if (href.indexOf("javascript:") == -1 && href.indexOf("file:") == -1) {
buf.append(Encoder.filterUrl(href));
}

buf.append("\" type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" name=\"mediaplayer1\" showstatusbar=\"1\" EnableContextMenu=\"false\" autostart=\"true\" width=\"400\" height=\"50\" transparentstart=\"1\" loop=\"0\" controller=\"true\">");
oldend = u2 + 6; // 6 == length of [/aud]
}
index = oldend -1;// set to the last char of the tag, that is ']'

} else if (cur == '[' && index < len - 6 && chars[i = index + 1] == 'v' && chars[++i] == 'i' && chars[++i] == 'd' && chars[++i] == ']' ) {
//process [vid]
j = ++i;
int u1 = j-1;
int u2 = input.indexOf("[/vid]", u1 + 1);
if (u2 < 0) {
buf.append(chars, oldend, j - oldend);
oldend = j;
} else {
buf.append(chars, oldend, index - oldend);
buf.append("String href = input.substring(u1 + 1, u2).trim();
// Add http:// to the front of links if and only if it doesn't have any protocols.
// Doing this handles this: "[vid=sun.com]SUN[/vid]"
// Changing it to SUN
// instead of SUN
if (href.indexOf("://") == -1) {
href = "http://" + href;
}
if (href.indexOf("javascript:") == -1 && href.indexOf("file:") == -1) {
buf.append(Encoder.filterUrl(href));
}
buf.append("\" type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" name=\"mediaplayer1\" showstatusbar=\"1\" EnableContextMenu=\"false\" autostart=\"true\" width=\"400\" height=\"400\" transparentstart=\"1\" loop=\"0\" controller=\"true\">");
oldend = u2 + 6; // 6 == length of [/vid]
}
index = oldend -1;// set to the last char of the tag, that is ']'
}//end if
/*--Added by Jing Xu, www.shorelinesolution.com Process [aud] and [vid]--*/

编译打包后覆盖原有的myvietnam.jar,这样你的论坛就可以支持粘贴以下代码了
[aud]http://yourAudioSite/audiofile.name[/aud]

[vid]http://yourVideoSite/videofile.name[/vid]

----------------------------------------
支持小惡魔
BTC : 19tn3RnCuwZVukXAwyhDWZD4uBgUZoGJPx
LTC : LTFa17pSvvoe3aU5jbmfcmEpo1xuGa9XeA
知識跟八卦一樣,越多人知道越有價值;知識最好的備份方法,散播!
藍色小惡魔(林永傑): 臉書


[2007/10/25 下午 12:00:42]   [返迴此篇文章頂端 ]  回到頂端