//Update//Discuz! 4.0.0
//1.新的界面
//2.修正小bug同时打开相同帖子时real工作不正常
//3.整理代码~
//修改./include/discuzcode.func.php
- /*------------------------------------------------PLAYER UBB CODE--BY KINPOO--HTTP://www.CNGUY.com---BEGIN*/
- #############...
- //...
- #############...
- function realplayer(...){
- //...
- }
- function mediaplayer(...){
- //...
- }
- /*------------------------------------------------PLAYER UBB CODE--BY KINPOO--HTTP://www.CNGUY.com-----END*/
复制代码
//替换为
- /*------------------------------------------------PLAYER UBB CODE--BY KINPOO--HTTP://www.CNGUY.com---BEGIN*/
- ################################################config begin############################
- //"true" or "1" is on,"false" or "0" is off
- $player_file=0; //是否显示影片地址
- $player_ubb_on=true; //use player ubb or not
- #################################################config end#############################
- $player_num=0;
- $player_pre=mt_rand();
- function realplayer($url,$width=450,$height=350,$auto=1){
- global $player_pre,$player_num;
- $pid=$player_pre.'_'.$player_num;
- $fullscreen ="function Full_{$pid}(){if(!document.all.I_{$pid}.CanStop()){alert('影片未开始,无法全屏!');}else{alert('将进入全屏模式,按Esc键退出全屏!');document.all.I_{$pid}.SetFullScreen();}}";
- $player ="<OBJECT classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' id='I_{$pid}' width='$width' height='$height'>";
- $player.="<PARAM NAME='SRC' VALUE='$url'>";
- $player.="<PARAM NAME='CONSOLE' VALUE='P_{$pid}'>";
- $player.="<PARAM NAME='CONTROLS' VALUE='Imagewindow'>";
- $player.="<PARAM NAME='AUTOSTART' VALUE='$auto'></OBJECT>";
- $player.="<br><OBJECT classid='CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA' id='C_{$pid}' width='$width' height='32'>";
- $player.="<PARAM NAME='SRC' VALUE='$url'>";
- $player.="<PARAM NAME='CONSOLE' VALUE='P_{$pid}'>";
- $player.="<PARAM NAME='CONTROLS' VALUE='controlpanel'>";
- $player.="<PARAM NAME='AUTOSTART' VALUE='$auto'></OBJECT>";
- $htmlcode=get_player_html($player,$pid,$fullscreen,$url);
- $player_num++;
- return $htmlcode;
- }
- function mediaplayer($url,$auto,$width=450,$height=350){
- global $player_num,$player_pre;
- $pid=$player_pre.'_'.$player_num;
- $fullscreen="function Full_{$pid}(){alert('将进入全屏模式,按Esc键退出全屏!\\n若影片未加载成功将无法进入全屏!');document.all.P_{$pid}.DisplaySize=3;}";
- if($auto=="-01" || $width=="-01"){
- $fullscreen="";
- $width=280;
- $height=69;
- }
- ($auto==="-00" || $auto=="-01") && $auto=1;
- $player ="<OBJECT align='middle' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' id='P_{$pid}' width='$width' height='$height'>";
- $player.="<param name='autostart' value='$auto'>";
- $player.="<param name='ShowStatusBar' value='-1'>";
- $player.="<param name='EnableContextMenu' value='0'>";
- $player.="<param name='Filename' value='$url'></OBJECT>";
- $htmlcode=get_player_html($player,$pid,$fullscreen,$url);
-
- $player_num++;
- return $htmlcode;
- }
- function get_player_html($player,$pid,$full,$url){
- global $player_file,$discuz_uid;
-
- $table_color='#80cbf9';
-
- if($player_file){
- if($discuz_uid){
- $show_url="<a href='$url' style='color=orangered'><font color='#FFFFFF'><b>[ 下载-媒体 ]</b></font></a>";
- }else{
- $show_url="<a href='./logging.php?action=login'><font color='#FFFFFF'><b>[ 下载-登陆 ]</b></font></a>";
- }
- }else{
- $show_url='';
- }
- if ($full!='') $full_btn=""<input type='button' name='btn_{$pid}_B_1' onclick='javascript:Full_{$pid}()' value='全屏播放'" + btn_end";
- else $full_btn="""";
- $btn_end =" style='background-color: $table_color;color: #FFFFFF;cursor: hand;filter: Alpha(Opacity=100, FinishOpacity=0, Style=3, StartX=70, StartY=70, FinishX=100, FinishY=100);font-weight: bolder;width: 100px;height:18px;border: 0px;'";
- $btn_end.=" onmouseover=\\"this.style.filter='';this.style.color='#666666';this.style.background='#EEFFFF';\\"";
- $btn_end.=" onmouseout=\\"this.style.filter='Alpha(Opacity=100, FinishOpacity=0, Style=3, StartX=70, StartY=70, FinishX=100, FinishY=100)';this.style.color='#FFFFFF';this.style.background='$table_color';\\">";
-
- $code ="<table width='50%' style='border:4px double $table_color' cellspacing='0' cellpadding='4'>";
- $code.="<tr bgcolor='$table_color'><td><font color='#FFFFFF'><b>[ 播放媒体文件 ]</b></font></td><td align='right'>$show_url</td></tr>";
- $code.="<tr><td id='TD_{$pid}_A'></td><td align='right' id='TD_{$pid}_B'></td></tr>";
- $code.="<tr><td colspan='2' id='TD_{$pid}_C'></td></tr></table>";
- $code.="<script language='javascript'>var btn_end="$btn_end";";
- $code.="var HTM_{$pid}_A_0="<input type='button' name='btn_{$pid}_A_0' onclick='javascript:HTML_{$pid}(0)' value='观看媒体'" + btn_end;";
- $code.="var HTM_{$pid}_A_1="<input type='button' name='btn_{$pid}_A_1' onclick='javascript:HTML_{$pid}(1)' value='关闭媒体'" + btn_end;";
- $code.="var HTM_{$pid}_B_0=' ';";
- $code.="var HTM_{$pid}_B_1=$full_btn;";
- $code.="var HTM_{$pid}_C_0='';";
- $code.="var HTM_{$pid}_C_1="$player";";
- $code.="HTML_{$pid}(1);";
- $code.="function HTML_{$pid}(close){";
- $code.="if(close){";
- $code.="document.all.TD_{$pid}_A.innerHTML=HTM_{$pid}_A_0;";
- $code.="document.all.TD_{$pid}_B.innerHTML=HTM_{$pid}_B_0;";
- $code.="document.all.TD_{$pid}_C.innerHTML=HTM_{$pid}_C_0;";
- $code.="}else{";
- $code.="document.all.TD_{$pid}_A.innerHTML=HTM_{$pid}_A_1;";
- $code.="document.all.TD_{$pid}_B.innerHTML=HTM_{$pid}_B_1;";
- $code.="document.all.TD_{$pid}_C.innerHTML=HTM_{$pid}_C_1;";
- $code.="}} $full</script>";
-
- return $code;
- }
- /*------------------------------------------------PLAYER UBB CODE--BY KINPOO--HTTP://www.CNGUY.com-----END*/
复制代码
[ 本帖最后由 haohao036 于 2005-12-25 21:49 编辑 ] |