引用:
原帖由 wenshuang 于 2005-12-30 09:48 发表
DP要改的话也要改文件,
正则表达式你熟不熟?

汗!你让我改html,我也许还能瞎弄出来,正则表达式,实在不懂!
我想的就是支持emule插件,supsite可以支持,但是中文会显示乱码!在论坛中要改的主要就是:
1、修改./data/wind_editor.js
在最后面添加:
function emulelink() {
if (helpmode){
alert('ed2k标记\\n使用ed2k标记,可以使输入的ed2k地址以超链接的形式在帖子中显示.\\n使用方法:\\n [ed2k]ed2k下载地址[/ed2k]');
} else if (nomode || document.selection && document.selection.type == "Text") {
AddTxt="\n[emule]"+text+"[/emule]\n";
AddText(AddTxt);
} else {
txt=prompt('ed2k链接',"ed2k://");
AddTxt="\n[emule]"+txt;
AddText(AddTxt);
AddTxt="[/emule]\n";
AddText(AddTxt);
}
}
2、修改./require/bbscode.php
查找:
if(strpos($message,"
复制内容到剪贴板
代码:
") !== false && strpos($message,"") !== false){
$message=preg_replace("/\[code\](.+?)\[\/code\]/eis","phpcode('\\1')",$message,$db_cvtimes);
}
在下面添加:
//------------------------http://www.lenju.net---------------------emule
if(strpos($message,"[emule]") !== false && strpos($message,"[/emule]") !== false){
$message=preg_replace("/\[emule\](.+?)\[\/emule\]/eis","emule('\\1')",$message);
}
//------------------------http://www.lenju.net----- ---------------emule
在最下面的
?>
的上面添加
//------------------------http://www.lenju.net---------------------emule
function emule($code){
global $num,$code_num,$code_htm,$tablecolor,$readcolorone,$readcolortwo;
$code=str_replace("<br>","\n",$code);
$code=str_replace("<br />","\n",$code);
$code_array=explode("\n",$code);
$rain="<br><table width=98% align=center cellspacing=1 cellpadding=5 bgcolor=$tablecolor><tr><td style='padding:3px 8px 2px 8px;border-bottom:1px solid #999;filter:progid

XImageTransform.Microsoft.Gradient(startColorStr=#0A6CCE, endColorStr=#FFFFFF, gradientType=0);' align='center' colspan='2'><strong>eMule下载链接</strong></td></tr><tr bgcolor=$readcolorone><td align=center colspan='2'>下面是eMule专用的下载链接,您必须安装eMule才能点击下载</td></tr>";
foreach($code_array as $emule)
{
if($emule!=''){
$emule_array=explode("|",$emule);
$total+=$emule_array[3];
$totalper=$emule_array[3];
if($totalper>(1024*1024*1024*1024)){
$totalper=round($totalper/1024/1024/1024/1024,2);
$totalper.="TB";
}elseif($totalper>(1024*1024*1024)){
$totalper=round($totalper/1024/1024/1024,2);
$totalper.="GB";
}elseif($totalper>(1024*1024)){
$totalper=round($totalper/1024/1024,2);
$totalper.="MB";
}else{
$totalper=round($totalper/1024,2);
$totalper.="KB";
}
$rain.="<tr bgcolor=$readcolortwo onmouseover=\"this.style.backgroundColor='$readcolorone'\" onmouseout=\"this.style.backgroundColor='$readcolortwo'\"><td class=smalltxt width=88% ><input type=checkbox name=EM42a795bb4b7d5$num value=$emule onclick=\"em_size('EM42a795bb4b7d5$num');\" checked=\"checked\" /><A href=$emule>$emule_array[2]</a></td><td class=smalltxt align=center>$totalper</td></tr>";
}}
if($total>(1024*1024*1024*1024)){
$total=round($total/1024/1024/1024/1024,2);
$total.="TB";
}elseif($total>(1024*1024*1024)){
$total=round($total/1024/1024/1024,2);
$total.="GB";
}elseif($total>(1024*1024)){
$total=round($total/1024/1024,2);
$total.="MB";
}else{
$total=round($total/1024,2);
$total.="KB";
}
$rain.="<tr bgcolor=$readcolorone><td align=left><input type=\"checkbox\" id=\"checkall_EM42a795bb4b7d5$num\" onclick=\"checkAll('EM42a795bb4b7d5$num',this.checked)\" checked=\"checked\"/> <label for=\"checkall_EM42a795bb4b7d5$num\">全选</label> <input type=\"button\" value=\"下载选中的文件\" onclick=\"download('EM42a795bb4b7d5$num',0,1)\"> <input type=\"button\" value=\"复制选中的链接\" onclick=\"copy('EM42a795bb4b7d5$num')\"><div id=\"ed2kcopy_EM42a795bb4b7d5$num\" style=\"position:absolute;height:0px;width:0px;overflow:hidden;\"></div></td><td class=smalltxt align=center id=\"size_EM42a795bb4b7d5$num\">$total</td></tr></table>";
$code_num++;
$code_htm[7][$code_num]=$rain;
$num++;
unset($emule_array,$total,$rain,$code);
return "<\twind_code_$code_num\t>";
}
//------------------------http://www.lenju.net--------------------emule
3、修改./wind/read.htm
查找:
<!--<?php
$votedb && require_once PrintEot('vote');
print <<<EOT
-->
在下面添加:
<script language='JavaScript' src='rainnetcnjs/rainnetcnemule.js'></script>
我不知道加在那里?希望老大最好能实现直接调用论坛bbscode文件,这样可以解决很多问题!
[
本帖最后由 marksman 于 2005-12-30 11:02 编辑 ]