本帖最后由 mixfans 于 2008-12-16 02:06 编辑
功能演示:
日志 http://my.mixga.com/space-1-do-blog-id-9.html
群组 http://my.mixga.com/space-1-do-thread-id-8.html
安装步骤:
1、更新UCHOME 1.5 RC3 12月1日补丁
2、下载附件,直接覆盖便可。
如果附件内的相关文件你修改过,则下载附件后,按照以下需要修改的代码点对点的复制到你的文件内。请勿直接在dz bbs复制代码,以免因为代码换行复制后出错。
PS:关于之前日志发布的MP3插入功能正常,而群组处如果手动输入MP3代码就会出现空白的现象,我开始没听懂这个反馈信息,后来有人到我的群组发了一个和日志发布一样的MP3代码的帖子,我才明白。因为之前群组并没有定义这个MP3插入功能,而你硬要输入这个MP3代码就会有问题,所以我干脆让群组也有这个MP3插入功能。
PS: 前几天我做了一个UCH 1.5RC3的风格,请大家帮忙测试一下,如果觉得好,我就发布到这里。 UCH 1.5RC3 密集社区风格
editor.php
查找- a.icoSwitchMdi{background-position:-671px 0px;width:23px}
复制代码 下面加入- a.icoMp3{background-position:-577px 1px}
复制代码 查找- <a href="javascript:;" class="icoSwf" id="icoSwf" onClick="createFlash(event, 1);return false;" title="引用视频
- FLASH"></a>
复制代码 下面加入- <a href="javascript:;" class="icoMp3" id="icoMp3" onClick="createMp3(event, 0);return false;" title="插入MP3"></a>
复制代码 查找- <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 id="createMp3" class="eMenu" style="display:none;top:35px;left:26px;width:400px;font-size:12px">
- 请输入MP3音乐URL地址:<br/>
- <select name="vmp3auto" id="vmp3auto">
- <option value="0">自动播放</option>
- <option value="1">手动播放</option>
- </select>
- <input type="text" id="mp3Url" name="mp3Url" value="http://" class="t_input" style="width: 190px;" />
- <input type="button" onclick="createMp3();" name="createURL" value="确定" class="submit" />
- <a href="javascript:;" onclick="fHide($('createMp3'));">取消</a>
- </div>
- image/editor/editor_base.js
复制代码 image/editor/editor_base.js
查找- if(fInObj(el, "createUrl") || fInObj(el, "createImg") || fInObj(el, "createSwf")){
复制代码 替换为- if(fInObj(el, "createUrl") || fInObj(el, "createImg") || fInObj(el, "createSwf") || fInObj(el, "createMp3")){
复制代码 查找替换为- icoSwf:"createSwf",
- icoMp3:"createMp3"
复制代码 查找- * 视频FLASH
- */
- function createFlash(e, show) {
- if(typeof show == 'undefined') {
- var flashtag = '';
- var vObj = $('videoUrl');
- var sFlash = vObj.value;
- if ((sFlash!=null) && (sFlash!="http://")){
- setCaret();
- var sFlashType = $('vtype').value;
- if(sFlashType==1) {
- flashtag = '[flash=media]';
- } else if(sFlashType==2) {
- flashtag = '[flash=real]';
- } else {
- flashtag = '[flash]';
- }
- format("insertHTML", flashtag + sFlash + '[/flash]');
- }
- fHide($('createSwf'));
- vObj.value = 'http://';
- } else {
- if(gIsIE){
- var e = window.event;
- }
- getCaret();
- var dvSwfBox = $("createSwf");
- var iX = e.clientX;
- var iY = e.clientY;
- dvSwfBox.style.display = "";
- dvSwfBox.style.left = (iX-350) + "px";
- dvSwfBox.style.top = 33 + "px";
- }
- }
- /**
复制代码 下面加- * 插入MP3
- */
- function createMp3(e, show) {
- if(typeof show == 'undefined') {
- var mp3tag = '';
- var mp30bj = $('mp3Url');
- var sMp3 = mp30bj.value;
- if ((sMp3!=null) && (sMp3!="http://")){
- setCaret();
- var sIsAuto = $('vmp3auto').value;
- if(sIsAuto==0) {
- mp3tag = '[mp3=auto]';
- } else {
- mp3tag = '[mp3]';
- }
- format("insertHTML", mp3tag + sMp3 + '[/mp3]');
- }
- fHide($('createMp3'));
- mp3Obj.value = 'http://';
- } else {
- if(gIsIE){
- var e = window.event;
- }
- getCaret();
- var dvMp3Box = $("createMp3");
- var iX = e.clientX;
- var iY = e.clientY;
- dvMp3Box.style.display = "";
- dvMp3Box.style.left = (iX-300) + "px";
- dvMp3Box.style.top = 33 + "px";
- }
- }
- /**
复制代码 查找- var arr = ["fontface", "fontsize", "dvForeColor", "dvPortrait", "divAlign", "divList" ,"divInOut",
- "editFaceBox", "createUrl", "createImg", "createSwf"];
- 替换为
- var arr = ["fontface", "fontsize", "dvForeColor", "dvPortrait", "divAlign", "divList" ,"divInOut",
- "editFaceBox", "createUrl", "createImg", "createSwf", "createMp3"];
复制代码 source/space_blog.php
拉到最后查找替换为- function blog_mp3( $mp3_url, $state )
- {
- $optauto = "";
- if ( $state == "auto" )
- {
- $optauto = "&autostart=yes";
- }
- $html = '<script language="JavaScript" src="image/audio-player.js"></script><object type="application/x-
- shockwave-flash" data="image/player.swf" id="_RANDOM_ID_" height="24" width="290"><param name="movie"
- value="image/player.swf"><param name="FlashVars" value="playerID=_RANDOM_ID_&soundFile='.$mp3_url.$optauto.'"><param
- name="quality" value="high"><param name="menu" value="false"><param name="wmode" value="transparent"></object>';
- return $html;
- }
- ?>
复制代码 source/function_blog.php
查找- //视频标签处理
- function blog_bbcode($message) {
- $message = preg_replace("/\[flash\=?(media|real)*\](.+?)\[\/flash\]/ie", "blog_flash('\\2', '\\1')",
- $message);
- return $message;
- }
复制代码 替换为- //视频标签处理
- function blog_bbcode($message) {
- $message = preg_replace("/\[flash\=?(media|real)*\](.+?)\[\/flash\]/ie", "blog_flash('\\2', '\\1')",
- $message);
- $message = preg_replace( "/\\[mp3\\=?(auto)*\\](.+?)\\[\\/mp3\\]/ie","blog_mp3("\\2", "\\1")",$message);
- return $message;
- }
复制代码 source/space_thread.php
拉到最后查找替换为- function blog_mp3( $mp3_url, $state )
- {
- $optauto = "";
- if ( $state == "auto" )
- {
- $optauto = "&autostart=yes";
- }
- $html = '<script language="JavaScript" src="image/audio-player.js"></script><object type="application/x-
- shockwave-flash" data="image/player.swf" id="_RANDOM_ID_" height="24" width="290"><param name="movie"
- value="image/player.swf"><param name="FlashVars" value="playerID=_RANDOM_ID_&soundFile='.$mp3_url.$optauto.'"><param
- name="quality" value="high"><param name="menu" value="false"><param name="wmode" value="transparent"></object>';
- return $html;
- }
- ?>
复制代码 |