原创: oytktk(靖飒)
插件功能:
让你的论坛支持多媒体在线播放:)……这个功能似乎发布N次了~~这次发布的功能主要是对会员发布的音乐
加上秀出滚动(及时调整速度)的功能~老H说要给精华……我能这不贴出来么!!
支持两大类媒体文件~~~
演示地址:
http://www.huasa.org/bbs/viewthread.php?tid=3651
http://www.huasa.org/bbs/viewthread.php?tid=3685
图:
============================
··········安装方法········································
============================
include/discuzcode.php
(这里得说明一下,如果你的文件中已经有了"/\[mp3\]\s*(.+?)\s*\[\/mp3\]/ies",那么就把这句,和下面相应的那句覆盖掉!)
查找:
- "/\[img\]\s*([^\[]+?)\s*\[\/img\]/ies",
复制代码
下面加:
- "/\[mp3\]\s*(.+?)\s*\[\/mp3\]/ies",
- "/\[ron\]\s*(.+?)\s*\[\/ron\]/ies",
复制代码
查找:
- "bbcodeurl('\\1', '<img src="%s" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\';}" onmouseover="if(this.resized) this.style.cursor=\'hand\';" onclick="if(this.resized) {window.open(this.src);}">')",
复制代码
下面加:
- "bbcodeurl('\\1', '<object align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="OBJECT" id="MediaPlayer" width="480" height="68" ><PARAM NAME="AutoStart" VALUE="-1" ><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="68"></embed></object>')",
- "bbcodeurl('\\1', '<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" id="Player" width="480" height="0" viewastext><param name="Autostart" value="-1"><param name="CONTROLS" value="ImageWindow"><param name="CONSOLE" value="_master"><param name="LOOP" value="-1"><param name="CENTER" value="0"></object><br><object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=64 id=Player width=480 VIEWASTEXT><param name="_ExtentX" value="18256"><param name="_ExtentY" value="794"><param name="Autostart" value="-1"><param name="LOOP" value="-1"><param name="CENTER" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><param name="SRC" value="%s"></object>')",
复制代码
查找:
- function parseurl(&$message) {
复制代码
上面加:
- function gcxdisp($code) {
- global $thisbg, $codecount, $post_codecount, $codehtml;
- $post_codecount++;
- $code = htmlspecialchars(str_replace('\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)));
- $codehtml[$post_codecount] = "<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="480" bgcolor="#000000"><tr><td rowspan="2"><marquee id="scrolltext" onmouseover=this.stop() onmouseout=this.start() scrollAmount=1 scrollDelay=120 width="455" height="280" direction="up"><font style="font-size: 13pt" color=#FFFFFF><center>$code</center></FONT></marquee></td><td width="30" onmouseover="list3()" onmouseout="list4()" style="Cursor:hand"><font color=#FFFFFF><center>↑</center></font></td></tr><tr><td width="30" onmouseover="list1()" onmouseout="list2()" style="Cursor:hand"><font color=#FFFFFF><center>↓</center></font></td></tr></table>";
- $codecount++;
- return "[\tDISCUZ_CODE_$post_codecount\t]";
- }
复制代码
查找:
- $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);
复制代码
下面加:
- $message = preg_replace("/\s*\[gcx\](.+?)\[\/gcx\]\s*/ies", "gcxdisp('\\1')", $message);
复制代码
include/bbcode.js
再文章最后加:
- function gcx_mp3() {
- if (helpmode) {
- alert(gcx_ghost);
- } else if (getSelectedText()) {
- var range = document.selection.createRange();
- range.text = "[gcx]" + range.text + "[/gcx][mp3]http://[/mp3]";
- } else if (advmode) {
- AddTxt="\r[gcx]"+gcx_ghost+"[/gcx][mp3]http://[/mp3]";
- AddText(AddTxt);
- } else {
- txt1=prompt(mp3_link,"http://");
- txt=prompt(gcx_ghost,gcx_ghost);
- if (txt!=null) {
- AddTxt="\r[gcx]"+txt;
- AddText(AddTxt);
- AddText("[/gcx][mp3]"+txt1+"[/mp3]");
- }
- }
- }
- function gcx_ron() {
- if (helpmode) {
- alert(gcx_ghost);
- } else if (getSelectedText()) {
- var range = document.selection.createRange();
- range.text = "[gcx]" + range.text + "[/gcx][ron]http://[/ron]";
- } else if (advmode) {
- AddTxt="\r[gcx]"+gcx_ghost+"[/gcx][ron]http://[/ron]";
- AddText(AddTxt);
- } else {
- txt1=prompt(ron_link,"http://");
- txt=prompt(gcx_ghost,gcx_ghost);
- if (txt!=null) {
- AddTxt="\r[gcx]"+txt;
- AddText(AddTxt);
- AddText("[/gcx][ron]"+txt1+"[/ron]");
- }
- }
- }
复制代码
include/common.js
文件最后加:
- function list1(){
- scrolltext.scrollDelay=30;
- scrolltext.scrollAmount=2;
- scrolltext.direction="up";
- }
- function list2(){
- scrolltext.scrollDelay=180;
- scrolltext.scrollAmount=1;
- scrolltext.direction="up";
- }
- function list3(){
- scrolltext.scrollDelay=30;
- scrolltext.scrollAmount=2;
- scrolltext.direction="down";
- }
- function list4(){
- scrolltext.scrollDelay=180;
- scrolltext.scrollAmount=1;
- scrolltext.direction="up";
- }
复制代码
templates\default\post_bbinsert.htm
查找
- var code_normal = "{lang post_discuzcode_code_normal}";
复制代码
下面加:
- var mp3_normal = "{lang post_discuzcode_mp3_normal}";
- var gcx_ghost = "{lang post_discuzcode_gcx_ghost}";
- var ron_help = "{lang post_discuzcode_ron_help}";
- var mp3_link = "{lang post_discuzcode_mp3_link}";
- var ron_link = "{lang post_discuzcode_ron_link}";
复制代码
查找:
- <a href="javascript:quote()"><img src="{IMGDIR}/bb_quote.gif" border="0" alt="{lang post_discuzcode_quote}"></a>
复制代码
下面加:
- <a href="javascript:gcx_mp3()"><img src="{IMGDIR}/mp3.gif" border="0" alt="{lang post_discuzcode_mp3}"></a>
- <a href="javascript:gcx_ron()"><img src="{IMGDIR}/ron.gif" border="0" alt="{lang post_discuzcode_ron}"></a>
复制代码
templates\default\templates.lang.php
查找:
- 'post_discuzcode_list_normal_input' => '请输入列表项目内容,如果留空表示项目结束。',
复制代码
下面加:
- 'post_discuzcode_mp3_link' => '插入MP3类型的音乐地址',
- 'post_discuzcode_mp3' => '插入MP3类型的音乐以及滚动歌词的显示!',
- 'post_discuzcode_ron' => '插入RM类型的音乐以及滚动歌词的显示!',
- 'post_discuzcode_ron_link' => '插入RM类型的音乐地址',
- 'post_discuzcode_mp3_help' => '插入MP3等类型的音乐及滚动歌词!',
- 'post_discuzcode_ron_help' => '插入RM等类型的音乐及滚动歌词!',
- 'post_discuzcode_gcx_ghost' => '\r在这里插入滚动显示的歌词\r',
复制代码
ok.
老H,接下来的工作。。。。该你啦!
最下面的两个图放在(IMAGES/模板/)内!
[ 本帖最后由 oytktk 于 2007-8-24 08:45 编辑 ] |