\editor.php
1,修改CSS.在CSS里增加如下代码:
CSS代码
a.icoMusic{background-position:-575px 1px}
2,增加按钮.搜索如下代码:
XML/HTML代码
<a href="javascript:;" class="icoSwf" id="icoSwf" onClick="createFlash(event, 1);return false;" title="引用视频FLASH"></a>
在下面增加这么一行:
XML/HTML代码
<a href="javascript:;" class="icoMusic" id="icoMusic" onClick="createMu(event, 1);return false;" title="插入音乐"></a>
3,增加隐藏的DIV.搜索如下代码:
XML/HTML代码
<div id="createSwf" class="eMenu" style="display:none;top:35px;left:26px;width:400px;font-size:12px">
请输入视频URL地址:<br/>
<select name="vtype" id="vtype">
<option value="0">Flash动画</option>
<option value="1">Media视频</option>
<option value="2">Real视频</option>
</select>
<input type="text" id="videoUrl" name="videoUrl" value="http://" class="t_input" style="width: 200px;" />
<input type="button" onclick="createFlash();" name="createURL" value="确定" class="submit" />
<a href="javascript:;" onclick="fHide($('createSwf'));">取消</a>
</div>
在其后增加如下DIV:
XML/HTML代码
<div id="createMusic" class="eMenu" style="display:none;top:35px;left:26px;width:400px;font-size:12px">
请输入音乐URL地址:<br/>
<select name="MusicAuto" id="MusicAuto">
<option value="0">自动播放</option>
<option value="1">手动播放</option>
</select>
<input type="text" id="musicUrl" name="musicUrl" value="http://" class="t_input" style="width: 190px;" />
<input type="button" onClick="createMu();" name="createURL" value="确定" class="submit" />
<a href="javascript:;" onClick="fHide($('createMusic'));">取消</a>
</div>
\image\editor\editor_base.js
1,搜索:
JavaScript代码
if(fInObj(el, "createUrl") || fInObj(el, "createImg") || fInObj(el, "createSwf"
这一行改成:
JavaScript代码
if(fInObj(el, "createUrl") || fInObj(el, "createImg") || fInObj(el, "createSwf") || fInObj(el, "createMusic")){
2,搜索:
JavaScript代码
icoSwf:"createSwf"
改为:
JavaScript代码
icoSwf:"createSwf",
icoMusic:"createMusic"
3.搜索如下代码:
JavaScript代码
var arr = ["fontface", "fontsize", "dvForeColor", "dvPortrait", "divAlign", "divList" ,"divInOut", "editFaceBox", "createUrl", "createImg", "createSwf"];
把这一行替换为如下代码:
JavaScript代码
var arr = ["fontface", "fontsize", "dvForeColor", "dvPortrait", "divAlign", "divList" ,"divInOut", "editFaceBox", "createUrl", "createImg", "createSwf", "createMusic"];
\source\function_blog.php
1,搜索如下代码
PHP代码
function blog_bbcode($message)
在下面的return那一行上面增加这么一行:
PHP代码
$message = preg_replace("/\[music\=?(auto)*\](.+?)\[\/music\]/ie","blog_music('\\2', '\\1\')",$message);
2,搜索:
PHP代码
function blog_flash
在这个function下面添加如下function:
PHP代码
//音乐
function blog_music($music_url, $state)
{
$optauto = "";
$geshi = substr($music_url,-3,3);
if(!$GLOBALS['audioid']){
$GLOBALS['audioid']=1;
}else{
$GLOBALS['audioid']++;
}
if ($geshi == 'mp3') {
if ($state == "auto")//自动播放
{
$optauto = "yes";
}else{
$optauto = "no";
}
$html = '<p class="audioplayer_container" id="audioplayer_'.$GLOBALS['audioid'].'"><script type="text/javascript">';
$html .= 'AudioPlayer.embed("audioplayer_'.$GLOBALS['audioid'].'", {loop:"yes",autostart:"'.$optauto.'",soundFile:"'.($music_url).'"});';
$html .= '</script></p>';
}else{
if($state == "auto")
{
$optauto = "1";
}else{
$optauto = "0";
}
$html='<p class="audioplayer_container" id="audioplayer_'.$GLOBALS['audioid'].'"><object id="audioplayer_'.$GLOBALS['audioid'].'" width="290" height="68" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" align="baseline" border="0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">';
$html .= '<param name="FileName" value="'.$music_url.'">';
$html .= '<param name="ShowControls" value="1">';
$html .= '<param name="ShowPositionControls" value="0">';
$html .= '<param name="ShowAudioControls" value="1">';
$html .= '<param name="ShowTracker" value="1">';
$html .= '<param name="ShowDisplay" value="0">';
$html .= '<param name="ShowStatusBar" value="1">';
$html .= '<param name="AutoSize" value="0">';
$html .= '<param name="ShowGotoBar" value="0">';
$html .= '<param name="AutoStart" value="'.$optauto.'">';
$html .= '<param name="PlayCount" value="0">';
$html .= '<param name="AnimationAtStart" value="0">';
$html .= '<param name="TransparentAtStart" value="0">';
$html .= '<param name="AllowScan" value="0">';
$html .= '<param name="EnableContextMenu" value="1">';
$html .= '<param name="ClickToPlay" value="0">';
$html .= '<param name="InvokeURLs" value="1">';
$html .= '<param name="DefaultFrame" value="datawindow">';
$html .= '<embed src="'.$music_url.'" align="baseline" border="0" width="290" height="68" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin&" name="audioplayer_'.$GLOBALS['audioid'].'" showcontrols="1" showpositioncontrols="0" showaudiocontrols="1" showtracker="1" showdisplay="0" showstatusbar="1" autosize="0" showgotobar="0" showcaptioning="0" autostart="'.$optauto.'" autorewind="0" animationatstart="0" transparentatstart="0" allowscan="1" enablecontextmenu="1" clicktoplay="0" invokeurls="1" defaultframe="datawindow">';
$html .= '</embed></object></p>';
}
return $html;
}
\template\default\header.htm
在head里众多的JS下面增加如下代码:
JavaScript代码
<script language="javascript" type="text/javascript" src="image/audio-player.js"></script>
<script type="text/javascript">AudioPlayer.setup("image/audio-player.swf", {width:"290",animation:"yes",encode:"no",initialvolume:"60",remaining:"no",noinfo:"no",buffer:"5",checkpolicy:"no",rtl:"no",bg:"000000",text:"ffffff",leftbg:"000000",lefticon:"ffffff",volslider:"666666",voltrack:"ffffff",rightbg:"000000",rightbghover:"737373",righticon:"ffffff",righticonhover:"ffffff",track:"000000",loader:"666666",border:"000000",tracker:"484b4d",skip:"ffffff",pagebg:"FFFFFF",transparentpagebg:"yes"});</script>
<script language="javascript" type="text/javascript" src="image/jquery.js"></script>
最后替换\image\editor\editor_boolbar.gif这个图片.图片在附件里. |