Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[hack-原创] · 论坛支持多媒体播放+按扭+(歌词秀)

[复制链接]
oytktk 发表于 2005-8-19 18:34:54 | 显示全部楼层 |阅读模式
原创:   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",那么就把这句,和下面相应的那句覆盖掉!)

查找:

  1. "/\[img\]\s*([^\[]+?)\s*\[\/img\]/ies",
复制代码


下面加:

  1.                                 "/\[mp3\]\s*(.+?)\s*\[\/mp3\]/ies",
  2.                                 "/\[ron\]\s*(.+?)\s*\[\/ron\]/ies",
复制代码


查找:

  1. "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);}">')",
复制代码


下面加:

  1.                                 "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>')",
  2.                                 "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>')",
复制代码


查找:

  1. function parseurl(&$message) {
复制代码


上面加:



  1. function gcxdisp($code) {
  2.         global $thisbg, $codecount, $post_codecount, $codehtml;
  3.         $post_codecount++;
  4.         $code = htmlspecialchars(str_replace('\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)));
  5.         $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>";

  6.         $codecount++;
  7.         return "[\tDISCUZ_CODE_$post_codecount\t]";
  8. }

复制代码



查找:

       
  1. $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);
复制代码

               
下面加:
  1. $message = preg_replace("/\s*\[gcx\](.+?)\[\/gcx\]\s*/ies", "gcxdisp('\\1')", $message);
复制代码



include/bbcode.js

再文章最后加:


  1. function gcx_mp3()        {
  2.         if (helpmode) {
  3.                 alert(gcx_ghost);
  4.         } else if (getSelectedText()) {
  5.                 var        range =        document.selection.createRange();
  6.                 range.text = "[gcx]" +        range.text + "[/gcx][mp3]http://[/mp3]";
  7.         } else if (advmode)        {
  8.                 AddTxt="\r[gcx]"+gcx_ghost+"[/gcx][mp3]http://[/mp3]";
  9.                 AddText(AddTxt);
  10.         } else {   
  11.                 txt1=prompt(mp3_link,"http://");
  12.                 txt=prompt(gcx_ghost,gcx_ghost);
  13.                 if (txt!=null) {                  
  14.                         AddTxt="\r[gcx]"+txt;
  15.                         AddText(AddTxt);
  16.                         AddText("[/gcx][mp3]"+txt1+"[/mp3]");
  17.                 }                          
  18.         }
  19. }


  20. function gcx_ron()        {
  21.         if (helpmode) {
  22.                 alert(gcx_ghost);
  23.         } else if (getSelectedText()) {
  24.                 var        range =        document.selection.createRange();
  25.                 range.text = "[gcx]" +        range.text + "[/gcx][ron]http://[/ron]";
  26.         } else if (advmode)        {
  27.                 AddTxt="\r[gcx]"+gcx_ghost+"[/gcx][ron]http://[/ron]";
  28.                 AddText(AddTxt);
  29.         } else {   
  30.                 txt1=prompt(ron_link,"http://");
  31.                 txt=prompt(gcx_ghost,gcx_ghost);
  32.                 if (txt!=null) {                  
  33.                         AddTxt="\r[gcx]"+txt;
  34.                         AddText(AddTxt);
  35.                         AddText("[/gcx][ron]"+txt1+"[/ron]");
  36.                 }                          
  37.         }
  38. }
复制代码


include/common.js

文件最后加:

  1. function list1(){
  2. scrolltext.scrollDelay=30;
  3. scrolltext.scrollAmount=2;
  4. scrolltext.direction="up";
  5. }
  6. function list2(){
  7. scrolltext.scrollDelay=180;
  8. scrolltext.scrollAmount=1;
  9. scrolltext.direction="up";
  10. }

  11. function list3(){

  12. scrolltext.scrollDelay=30;
  13. scrolltext.scrollAmount=2;
  14. scrolltext.direction="down";

  15. }
  16. function list4(){
  17. scrolltext.scrollDelay=180;
  18. scrolltext.scrollAmount=1;
  19. scrolltext.direction="up";
  20. }

复制代码




templates\default\post_bbinsert.htm

查找

  1. var code_normal = "{lang post_discuzcode_code_normal}";
复制代码


下面加:

  1. var mp3_normal = "{lang post_discuzcode_mp3_normal}";
  2. var gcx_ghost = "{lang post_discuzcode_gcx_ghost}";
  3. var ron_help = "{lang post_discuzcode_ron_help}";
  4. var mp3_link = "{lang post_discuzcode_mp3_link}";
  5. var ron_link = "{lang post_discuzcode_ron_link}";
复制代码



查找:

  1. <a href="javascript:quote()"><img src="{IMGDIR}/bb_quote.gif" border="0" alt="{lang post_discuzcode_quote}"></a>
复制代码


下面加:

  1.         <a href="javascript:gcx_mp3()"><img src="{IMGDIR}/mp3.gif" border="0" alt="{lang post_discuzcode_mp3}"></a>
  2.         <a href="javascript:gcx_ron()"><img src="{IMGDIR}/ron.gif" border="0" alt="{lang post_discuzcode_ron}"></a>
复制代码



templates\default\templates.lang.php

查找:

  1. 'post_discuzcode_list_normal_input' => '请输入列表项目内容,如果留空表示项目结束。',
复制代码


下面加:

  1.         'post_discuzcode_mp3_link' => '插入MP3类型的音乐地址',
  2.         'post_discuzcode_mp3' => '插入MP3类型的音乐以及滚动歌词的显示!',
  3.         'post_discuzcode_ron' => '插入RM类型的音乐以及滚动歌词的显示!',
  4.         'post_discuzcode_ron_link' => '插入RM类型的音乐地址',
  5.         'post_discuzcode_mp3_help' => '插入MP3等类型的音乐及滚动歌词!',
  6.         'post_discuzcode_ron_help' => '插入RM等类型的音乐及滚动歌词!',
  7.         'post_discuzcode_gcx_ghost' => '\r在这里插入滚动显示的歌词\r',
复制代码



ok.


老H,接下来的工作。。。。该你啦!


最下面的两个图放在(IMAGES/模板/)内!

[ 本帖最后由 oytktk 于 2007-8-24 08:45 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
hufanyun 发表于 2005-8-19 18:40:12 | 显示全部楼层
他决定不杀你了.要阉了你
回复

使用道具 举报

 楼主| oytktk 发表于 2005-8-19 18:54:31 | 显示全部楼层
赞..~~
已经精华了真快~~
回复

使用道具 举报

hufanyun 发表于 2005-8-19 19:05:03 | 显示全部楼层
原帖由 oytktk 于 2005-8-19 18:54 发表
赞..~~
已经精华了真快~~

可是沙发已经没有.可能做沙发的0706有生命危险...
回复

使用道具 举报

 楼主| oytktk 发表于 2005-8-19 19:08:12 | 显示全部楼层
原帖由 hufanyun 于 2005-8-19 19:05 发表

可是沙发已经没有.可能做沙发的0706有生命危险...



老F,一向口硬心软~~他一般不会对别人怎么样的~~
回复

使用道具 举报

 楼主| oytktk 发表于 2005-8-20 00:07:03 | 显示全部楼层
精华是精华了..可惜没人顶.没人用~
回复

使用道具 举报

winter0706 发表于 2005-8-20 00:10:23 | 显示全部楼层
H~沙發舒服嗎?
回复

使用道具 举报

xjbl 发表于 2005-8-20 00:27:35 | 显示全部楼层
哈...这个比较cool..
回复

使用道具 举报

 楼主| oytktk 发表于 2005-8-20 16:51:44 | 显示全部楼层
原帖由 xjbl 于 2005-8-20 00:27 发表
哈...这个比较cool..


我觉得用在音乐型的论坛上会有点用呢~
回复

使用道具 举报

qdhys 发表于 2005-8-20 18:23:44 | 显示全部楼层
post_bbinsert.htm  文件里面没有  var code_normal = "{lang post_discuzcode_code_normal}"; 这个啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-4-27 17:22 , Processed in 0.100611 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表