第一步：修改 include/discuzcode.func.php查找[php]$message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);[/php]在下方添加[php]$message = preg_replace("/\s*\[emule\](.+?)\[\/emule\]\s*/ies", "emu('\\1')", $message);[/php]查找[php] return $htmlon || $allowhtml ? $message : nl2br(str_replace(array("\t", ' ', ' '), array(' ', ' ', ' '), $message));[/php]替换成[php] $message = $htmlon || $allowhtml ? $message : nl2br(str_replace(array("\t", ' ', ' '), array(' ', ' ', ' '), $message)); return str_replace("/ ","/\n",$message);[/php]查找[php]"/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/is",[/php]替换成[php]"/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/is",[/php]在文件尾部的“?>”前添加[php] function emu($code) { global $discuzcodes; $discuzcodes['pcodecount']++; $codecount=$discuzcodes['pcodecount']; $code = htmlspecialchars(str_replace('\\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code))); $view = '';$temp = $total = 0; $searcharray = explode("\n",$code); $view = " 下面是eMule专用的下载链接，您必须安装eMule才能点击下载 "; foreach($searcharray as $emule) { if($emule!='' && eregi("^ed2k:\/\/",$emule)){ $temp++; $emule = dhtmlspecialchars(trim($emule)); $emule_array = explode("|",$emule); $total += $emule_array[3]; $totalper = esizecount($emule_array[3]); $view.=" $totalper "; } } $total=esizecount($total); if($temp>0){ $view.=" 全选 $total "; } $discuzcodes['codehtml'][$discuzcodes['pcodecount']] = " $view "; $discuzcodes['codecount']++; return "[\tDISCUZ_CODE_$discuzcodes[pcodecount]\t]"; }function esizecount($filesize) { if($filesize >= 1073741824) { $filesize = round($filesize / 1073741824 * 100) / 100 . ' G'; } elseif($filesize >= 1048576) { $filesize = round($filesize / 1048576 * 100) / 100 . ' M'; } elseif($filesize >= 1024) { $filesize = round($filesize / 1024 * 100) / 100 . ' K'; } else { $filesize = $filesize . ' bytes'; } return $filesize; } [/php]第二步：修改include/javascript/common.js在结尾添加[php] function checkAll(str,checked) { var a = document.getElementsByName(str); var n = a.length;for (var i = 0; i < n; i++) { a[i].checked = checked; } em_size(str); }function download(str, i, first) { var a = document.getElementsByName(str); var n = a.length;for (var i = i; i < n; i++) { if(a[i].checked) { window.location=a[i].value; if (first) timeout = 6000; else timeout = 500; i++; window.setTimeout("download('"+str+"', "+i+", 0)", timeout); break; } }}function copy(str) {var a = document.getElementsByName(str); var n = a.length; var ed2kcopy = ""; for (var i = 0; i < n; i++) { if(a[i].checked) { ed2kcopy += a[i].value; ed2kcopy += ""; } } copyToClipboard(ed2kcopy);}function copyToClipboard(txt) { if(window.clipboardData) { window.clipboardData.clearData(); window.clipboardData.setData("Text", txt); } else if(navigator.userAgent.indexOf("Opera") != -1) { window.location = txt; } else if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'"); } var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); if (!clip) return; var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); if (!trans) return; trans.addDataFlavor('text/unicode'); var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); var copytext = txt; str.data = copytext; trans.setTransferData("text/unicode",str,copytext.length*2); var clipid = Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans,null,clipid.kGlobalClipboard); } }function em_size(str) { var a = document.getElementsByName(str); var n = a.length; try { var input_checkall = document.getElementById("checkall_"+str); var size = 0; input_checkall.checked = true ; for (var i=0; i < n; i++) { if (a[i].checked) { var piecesArray = a[i].value.split( "|" ); size += piecesArray[3]*1; } else { input_checkall.checked = false; } } test = document.getElementById("size_"+str); test.innerHTML = gen_size(size, 3, 1); } catch (e) {} }function gen_size(val, li, sepa ) { sep = Math.pow(10, sepa); //小数点后的位数 li = Math.pow(10, li); //开始截断的长度 retval = val; unit = 'Bytes'; if (val >= li*1000000000) { val = Math.round( val / (1099511627776/sep) ) / sep; unit = 'TB'; } else if (val >= li*1000000) { val = Math.round( val / (1073741824/sep) ) / sep; unit = 'GB'; } else if (val >= li*1000) { val = Math.round( val / (1048576/sep) ) / sep; unit = 'MB'; } else if (val >= li) { val = Math.round( val / (1024/sep) ) / sep; unit = 'KB'; } return val + unit; } [/php]第三步：后台添加Discuz!代码标签：emule 替换内容：（无） 例子：[emule]下载地址[/emule] 解释：添加 eMule 电驴下载 参数个数：1 参数提示：使用emule标记，可以使输入的ed2k地址以超链接的形式在帖子中显示。 嵌套次数：1 图标：bb_emule.gif上传文件，更新后台缓存，升级完毕！