一下修改是在安装了我的分享视频的基础上做的修改:
1在修改过后的source/cp_share.php中找到:- if(substr($link, -4, 4) == '.swf'){
- $arr['title_template'] = cplang('share_swf');
- $arr['body_data'] = array('cplang'=>cplang('share_swf_url'), 'id'=>mt_rand(1, 100000), 'link'=>$link, 'data'=>$link);
- $arr['body_template'] = '<div class="share_mp3"><object id="movie" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300">
- <param name="movie" value="{link}">
- <param name="FlashVars" value="playerID={id} />
- <embed src="{link}" loop="false" menu="false" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Pro" d_version="ShockwaveFlash" type="application/x-shockwave-flash" width="400" height="300">
- <param name="quality" value="high">
- </object><input type="text" value="{cplang}{link}" class="t_input" /></div>';
- }
复制代码 替换成:- if(substr($link, -4, 4) == '.swf'){
- $arr['title_template'] = cplang('share_swf');
- $arr['body_data'] = array('cplang'=>cplang('share_swf_url'), 'id'=>mt_rand(1, 100000), 'link'=>$link, 'data'=>$link);
- $arr['body_template'] = '
- <div class="share_video">
- <SPAN class=playbutton onclick=video_display(this) id=play_button_{id} rel="{link}"><IMG src="image/vd.gif"></SPAN>
- <DIV id=flash_video_{id} style="display:none">
- <EMBED src={link} width=400 height=300 type=application/x-shockwave-flash quality="1" wmode="Window" menu="menu" loop="loop" scale="ShowAll"></EMBED>
- </DIV>
- <A class=video-close-link id=video_close_{id} onclick=video_close(this) href="#" rel={id}>收起</A>
- <input type="text" value="{cplang}{link}" class="t_input" />
- </div>';
- }
复制代码 2.打开模板下的common.css文件,在最下面加入:- .share_video {}
- .share_video .playbutton {width:130px; height:100px}
- .video-close-link {line-height:32px; display:none}
- .share_video input {display:block; width:98%}
- .share_video img {width:200px}
复制代码 3.打开模板下的script_common.js文件在最下面加入:- //播放video的事件
- function video_display(obj)
- {
- var id=obj.id;
- id = id.replace("play_button_","");
- obj.style.display="none";
- document.getElementById("flash_video_"+id).style.display="block";
- document.getElementById("video_close_"+id).style.display="block";
- }
- //关闭video的事件
- function video_close(obj)
- {
- var id=obj.id;
- id = id.replace("video_close_","");
- obj.style.display="none";
- document.getElementById("flash_video_"+id).style.display="none";
- document.getElementById("play_button_"+id).style.display="block";
- }
复制代码 没来得及做测试,有什么问题大家跟帖啊。
还有,有些朋友到我的站上做测试,当然可以,但是请大家不要乱发内容,要是发测试的话,那就好好的发一个视频包括说明等。要不搞的我整站都是垃圾那就太打击我给大家做插件的信心了。大伙说对吧?
最后再唠叨一下,我的站是www.myhuainan.cn,大家送几个IP给我啊。
9月6日晚,做一下bug修改:
有网友提出做了此插件以后,不能再分享mp3,只需要在- [color=Red]if[/color](substr($link, -4, 4) == '.swf'){
- $arr['title_template'] = cplang('share_swf');
- $arr['body_data'] = array('cplang'=>cplang('share_swf_url'), 'id'=>mt_rand(1, 100000), 'link'=>$link, 'data'=>$link);
- $arr['body_template'] = '<div class="share_mp3"><object id="movie" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300">
- <param name="movie" value="{link}">
- <param name="FlashVars" value="playerID={id} />
- <embed src="{link}" loop="false" menu="false" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Pro" d_version="ShockwaveFlash" type="application/x-shockwave-flash" width="400" height="300">
- <param name="quality" value="high">
- </object><input type="text" value="{cplang}{link}" class="t_input" /></div>';
- }
复制代码 替换成:- if(substr($link, -4, 4) == '.swf'){
- $arr['title_template'] = cplang('share_swf');
- $arr['body_data'] = array('cplang'=>cplang('share_swf_url'), 'id'=>mt_rand(1, 100000), 'link'=>$link, 'data'=>$link);
- $arr['body_template'] = '
- <div class="share_video">
- <SPAN class=playbutton onclick=video_display(this) id=play_button_{id} rel="{link}"><IMG src="image/vd.gif"></SPAN>
- <DIV id=flash_video_{id} style="display:none">
- <EMBED src={link} width=400 height=300 type=application/x-shockwave-flash quality="1" wmode="Window" menu="menu" loop="loop" scale="ShowAll"></EMBED>
- </DIV>
- <A class=video-close-link id=video_close_{id} onclick=video_close(this) href="#" rel={id}>收起</A>
- <input type="text" value="{cplang}{link}" class="t_input" />
- </div>';
- }
复制代码 的if前加else即可。
[ 本帖最后由 mcck333 于 2008-9-6 00:37 编辑 ] |