看到好几个人要eMule的地址转换,抽空写了一个最简单的。。。没家人和判断,不过还是不错的
演示如下
http://eland.3322.org/cbs/showthread.php?t=475
修改很简单
打开includes/functions_codeparse.php
找到
代码:
while ( preg_match( "#[(font|size|color)=([^]]+)](.+?)[/1]#ies", $text ) ) {
$text = preg_replace( "#[(font|size|color)=([^]]+)](.+?)[/1]#ies", "$this->parse_font(array('s'=>'1','1'=>'2','2'=>'3'))", $text );
}
下面以行增加
代码:
while ( preg_match( "#[(emule)=([^]]+)](.+?)[/emule]#ies", $text ) ) {
$text = preg_replace( "#[(emule)=([^]]+)](.+?)[/emule]#ies", "$this->parse_emu(array('1'=>'2','2'=>'3'))", $text );
}
while ( preg_match( "#[emulelist](.+?)[/emulelist]#is", $text ) ) {
$text = preg_replace( "#[emulelist](.+?)[/emulelist]#is", "<table cellpadding=0 cellspacing=0 border=0 style='border:1px solid #999'><tr><td style='padding:3px 8px 2px 8px;border-bottom:1px solid #999;filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr=#0A6CCE, endColorStr=#FFFFFF, gradientType=0);' align='center'><strong>eMule下载链接</strong></td></tr><tr><td align='center' style='padding:3px 20px 2px 20px;border-bottom:1px solid #999'>下面是eMule专用的下载链接,您必须安装eMule才能点击下载</td></tr><tr><td style='padding:10px 15px 10px 15px;line-height:1.8' bgcolor='#F9F9F9'>1</td></tr></table>", $text );
}
找
代码:
function parse_image($url="")
上面添加
代码:
function parse_emu($emu)
{
if (!is_array($emu)) return "";
if ( preg_match( "/;/", $emu['1'] ) ) {
$attr = explode( ";", $emu['1'] );
$emu['1'] = $attr[0];
}
return "文件名:<a href="".$emu['1']."">".$emu['2']."</a>
本链接为Emule专用下载链接";
}
搞定。
用的时候,复制eMule链接地址,打开
http://www.scfy.net/emulecode.php
转换一下就可以得到标准的emule格式,这个文件自己下载保存好了
简简单单第一个插件,嘿嘿
ps:原插件为psw版本 :yell: