作者: oytktk
演示: http://www.huasa.org/bbs
先提供一个图标.不喜欢的自己找.
修改方法
================
include\discuzcode.php
找到:
- "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[]+?)\s*\[\/img\]/ies"
复制代码
这里要严重说明一下:
在上一句的未尾加个逗号:
在下面加
- "/\[iframe\]\s*(.+?)\s*\[\/iframe\]/ies",
- "/\[iframe=(\d+?)[x|\,](\d+?)\]\s*(.+?)\s*\[\/iframe\]/ies",
- "/\[wmv\]\s*(.+?)\s*\[\/wmv\]/ies",
- "/\[mid\]\s*(.+?)\s*\[\/mid\]/ies",
- "/\[mp3\]\s*(.+?)\s*\[\/mp3\]/ies",
- "/\[ra\]\s*(.+?)\s*\[\/ra\]/ies",
- "/\[rm\]\s*(.+?)\s*\[\/rm\]/ies",
复制代码
找到:
- "bbcodeurl('\\3', '<img width="\\1" height="\\2" src="%s" border="0">')"
复制代码
这里要严重说明一下:
在上一句的未尾加个逗号:
下面加:
- "bbcodeurl('\\1', '<iframe src="%s" frameborder="0" allowtransparency="true" scrolling="yes" width="97%%" height="480"></iframe>')",
- "bbcodeurl('\\3', '<iframe width="\\1" height="\\2" src="%s" frameborder="0" border="0"></iframe>')",
- "bbcodeurl('\\1', '<object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="480" height="360" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="%s"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="%s" width="480" height="360"></embed></object>')",
- "bbcodeurl('\\1', '<embed src="%s" height="45" width="314" autostart="0"></embed>')",
- "bbcodeurl('\\1', '<object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="480" height="360" ><PARAM NAME="AUTOSTART" VALUE="true" ><param name="ShowStatusBar" value="-1"><param name="Filename" value="%s"><embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" flename="mp" src="%s" width="480" height="360"></embed></object>')",
- "bbcodeurl('\\1', '<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" id="RAOCX" width="253" height="60"><param name="_ExtentX" value="6694"><param name="_ExtentY" value="1588"><param name="AUTOSTART" value="0"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="SRC" value="%s"><param name="CONTROLS" value="StatusBar,ControlPanel"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><embed src="%s" width="253" autostart="true" height="60"></embed></object>')",
- "bbcodeurl('\\1', '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height="482" id="Player" width="632" viewastext><param name="_ExtentX" value="12726"><param name="_ExtentY" value="8520"><param name="AUTOSTART" value="0"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="CONTROLS" value="ImageWindow"><param name="CONSOLE" value="_master"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="%s"><param name="BACKGROUNDCOLOR" value="#000000"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=32 id=Player width=316 VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="AUTOSTART" value="-1"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="CONTROLS" value="controlpanel"><param name="CONSOLE" value="_master"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><param name="SRC" value="\\1"></object>')"
复制代码
到目前为止,你的论坛已经支持了
[MP3]
[WMV]
[RM]
[MID]
[RA]
标签的在线播放功能和
[iframe=X,Y]手动调整大小功能
下面是加入快捷按扭的方法,我只提供加入[WMV]的标签的方法,其它的都一样,自己加吧~~:
修改include/bbcode.js
找到
在上面添加
- function bb_wmv() {
- if (helpmode) {
- alert();
- } else if (document.selection && document.selection.type == "Text") {
- var range = document.selection.createRange();
- range.text = "[wmv]" + range.text + "[/wmv]";
- } else if (advmode) {
- AddTxt="\r[wmv]\r[/wmv]";
- AddText(AddTxt);
- } else {
- txt=prompt(quote_normal,text_input);
- if (txt!=null) {
- AddTxt="\r[wmv]"+txt;
- AddText(AddTxt);
- AddText("[/wmv]");
- }
- }
- }
复制代码
修改模版\templates\风格文件夹\post_bbinsert.htm
找到
- <a href="javascript:code()"><img src="{IMGDIR}/bb_code.gif" border="0" alt="{lang post_discuzcode_code}"></a>
复制代码
在下面添加
- <a href="javascript:bb_wmv()"><img src="{IMGDIR}/bb_wmv.gif" border="0" alt="插入WMV标签"></a>
复制代码
最后上传bb_wmv.gif图片到 images/模版文件夹 里就可以了。图片在最上面..
这个图片如果不适合你的论坛,你可以再去其它地方找一个以这个名字命名就行了!
其它的方法依此类推!
[ Last edited by oytktk on 2005-5-17 at 11:49 ]
[ 本帖最后由 oytktk 于 2007-8-24 08:35 编辑 ] |