• 网站首页 | 源码分类 | 最近更新 | 下载排行 | RSS 订阅

  • 网站首页
  • ASP源码
  • PHP源码
  • CGI源码
  • JSP源码
  • .NET源码
  • 建站资源
  • 书籍教程
  • 编程相关
  • 常用软件
模板下载 | 服务器软件 | 字体下载 | Java源码 | Delphi源码 | C/C++源码 | VB源码 | VC源码 | 编程工具 | 发布源码
源码分类 | 最近更新 | 下载排行 | 推荐资源 | RSS 订阅CODEDN | 源码搜索
登陆你的源码收藏空间!您的位置: 首页 >> 下载首页 >> PHP源码 >> 其他类别 >> 下载页面
 

其他类别下载排行

  • mysql数据库导入导出程序
  • Gregarius v0.5.5 汉化加强版(Rss聚合程序)
  • PHP后台管理自动生成程序
  • SQLSwitch 数据库转换器 v1.2(Access转mysql工具)
  • webadmin.php在线管理工具汉化版
  • PHP Web admin System v1.0
  • 互刷Alexa程序 v3.0
  • php硬盘资源管理器
  • PHP读取excel文件的源代码
  • 圣诞许愿墙源码
  • WAP浏览器 [php版]
  • BT种子信息插件 For Discuz 5.0
  • phpnuke v8.0 简体中文汉化版
  • 守望MySQL简单工具 v1.2
  • MySQL数据库分卷备份工具
 
 

最近更新源码

  • 动易转DEDECMS程序
  • PHPGEN代码生成系统
  • PHPSQL数据库系统 v2007
  • PHP读取excel文件的源代码
  • PHP在线解压缩的程序
  • ThinkPHP v1.0.0RC1
  • FleaPHP 1.0.70.947 (开源 PHP开发框架)
  • PHP Calendar Basic v2.2汉化版 (简单日历备忘录程序)
  • 钢笔手写体生成工具(PHP) v1.0
  • PHP 在线生成 favicon.ico
  • Release Easy 2 Home Edition(RE2网站在线管理PHP文本)
  • Vanlic RSS Log 开源RSS采集系统 v1.1
  • phpMyEdit v5.7
  • 在线CSS压缩与优化工具CssCompressor v1.3汉化版
  • 网站不良信息检查系统
 
 

编辑推荐

 
 

BT种子信息插件 For Discuz 5.0

  • 软件评价:
  • 更新日期:2007-2-3 11:56:56
  • 授权方式:免费源码
  • 源码语言:简体中文
  • 运行环境:PHP+MYSQL
  • 所属类型:其他类别
  • 源码大小:155KB
  • 下载次数:今日: 本周: 总计:
  • 演示地址:观看演示
  • 作者主页:官方主页
添加到收藏夹 报告下载错误
[下载地址] 快车专用高速下载   浙江移动
百度中"BT种子信息插件 For Discuz 5.0"的相关内容
  • 软件简介: 
  •  免费电子书下载
  •  非常安全的浏览器 
  •  网站通过Google赚取美金 

数据库升级: None

缺陷和不足:
1.发帖时候如果同时出现两个以上的[bt]将只能解释第一个,
但一直没写出其中的正则替换多个标签。
2.采用了远程读取和mb_string或iconv及对照表形式进行了UTF-8的转换
效率可能有点问题,而且很少有虚拟主机的伺服器能支持mb_string或iconv。
3.水平有限,代码很凌乱,参考了不少程序的函数,在此不说了,看你能看出几个。


打开discuzcode.func.php,在最后一行(大概320)后添加下列代码:

 
/*-------------------torrent plug----------------
author:blue2004
QQ:80392625
HomePage:http://www.pearphp.com/
Email:pearphp#gmail.com
Date:2007-2-3
------------------------------------------------*/

  function convert_encoding($str, $from, $to)
        {
               
                if (function_exists('mb_convert_encoding')) {
                        $str = mb_convert_encoding($str, $to, $from);
                } elseif (function_exists('iconv')) {
                        $str = iconv($from, $to, $str);
                } else {
                        include_once(DISCUZ_ROOT.'./include/functions_encoding.php');
                        $encode= new Encoding();
                        $str = $encode->EncodeString($str, $from, $to);
            }
                return $str;
        }

        function iif($expression, $returntrue, $returnfalse = '')
        {
                return ($expression ? $returntrue : $returnfalse);
        }

/**
* Formats a number with user's own decimal and thousands chars
*
* @param        mixed        Number to be formatted: integer / 8MB / 16 GB / 6.0 KB / 3M / 5K / ETC
* @param        integer        Number of decimal places to display
* @param        boolean        Special case for byte-based numbers
*
* @return        mixed        The formatted number
*/
function vb_number_format($number, $decimals = 0, $bytesize = false)
{
        $type = '';
        if (empty($number))
        {
                return 0;
        }
        else if (preg_match('#^(\d+(?:\.\d+)?)(?>\s*)([mkg])b?$#i', trim($number), $matches))
        {
                switch(strtolower($matches[2]))
                {
                        case 'g':
                                $number = $matches[1] * 1073741824;
                                break;
                        case 'm':
                                $number = $matches[1] * 1048576;
                                break;
                        case 'k':
                                $number = $matches[1] * 1024;
                                break;
                        default:
                                $number = $matches[1] * 1;
                }
        }

        if ($bytesize)
        {
                if ($number >= 1073741824)
                {
                        $number = $number / 1073741824;
                        $decimals = 2;
                        $type = "G";
                }
                else if ($number >= 1048576)
                {
                        $number = $number / 1048576;
                        $decimals = 2;
                        $type = "MB";
                }
                else if ($number >= 1024)
                {
                        $number = $number / 1024;
                        $decimals = 1;
                        $type = "KB";
                }
                else
                {
                        $decimals = 0;
                        $type = " bytes";
                }
        }
        return str_replace('_', ' ', number_format($number, $decimals)) . $type;
}

        //        {{{        bt UBB()

        /**
         *get bt tag
         */
        function tag_bt($info){
                $info = stripslashes($info);
                preg_match_all("/\[bt\](.+?)\[\/bt\]/is", $info, $matches);
                return $matches[1];
        }

        //        {{{        fetchContent()

        /**
         * Fetch the remote content.
         * @param        string        url of the page
         * @param        string        get the http header?
         * @return        string        HTML of the page
         */
        function fetchContent($url, $getHeader = false)
        {
                $content = "";
                if (ini_get('allow_url_fopen') && !$getHeader) {
                        //ByFile
                        $handle = @fopen($url,"r");
                        if(!$handle){
                                return false;
                        }
                        while($buffer = fgets($handle, 4096)) {
                          $content .= $buffer;
                        }
                        fclose($handle);
                        return $content;
                } elseif (function_exists('curl_init')) {
                        //ByCurl
                        $handle = curl_init();
                        curl_setopt ($handle, CURLOPT_URL, $url);
                        curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 5);
                        curl_setopt ($handle, CURLOPT_RETURNTRANSFER, 1);
                        curl_setopt ($handle, CURLOPT_FOLLOWLOCATION, 0);
                        if ($getHeader) {
                                curl_setopt ($handle, CURLOPT_HEADER, 1);
                                curl_setopt ($handle, CURLOPT_NOBODY, 1);
                        }
                        $content = curl_exec($handle);
                        curl_close($handle);
                        return $content;
                } elseif (function_exists('fsockopen')) {
                        //BySocket
                        if (!($pos = strpos($url, '://'))) {
                                return false;
                        }
                        $host = substr($url, $pos+3, strpos($url, '/', $pos+3) - $pos - 3);
                        $uri = substr($url, strpos($url, '/', $pos+3));
                        $request = "GET " . $uri . " HTTP/1.0\r\n"
                                           ."Host: " . $host . "\r\n"
                                           ."Accept: */*\r\n"
                                           ."User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)\r\n"
                                           ."\r\n";
                        $handle = @fsockopen($host, 80, $errno, $errstr, 30);
                        if (!$handle) {
                                return false;
                        }
                        @fputs($handle, $request);
                        while (!feof($handle)){
                                $content .= fgets($handle, 4096);
                        }
                        fclose($handle);
                        $separator = strpos($content, "\r\n\r\n");
                        if($getHeader) {
                                if($separator === false) {
                                        return false;
                                } else {
                                        return substr($content, 0, $separator);
                                }
                        } else {
                                if($separator === false) {
                                        return $content;
                                } else {
                                        return substr($content, $separator + 4);
                                }
                        }
                } else {
                        return false;
                }
        }

function info_bt($message){
        $array =tag_bt($message);
        if (is_array($array)) {
                #echo count($array);
                #foreach ($array as $key => $value) {
                        #echo $array[$key];
                        @set_time_limit(10);
                        $content = fetchContent($array['0']);
                        if (!empty($content)) {
                                include_once DISCUZ_ROOT.'./include/bencode.php';
                                $bencode = new BEncodeLib();
                                $torrent = $bencode->bdecode($content);
                                if (is_array($torrent)) {
                                        #print_r($torrent);
                                                if (is_array($torrent['announce-list'])) {
                                                        foreach ($torrent['announce-list'] as $key => $value) {
                                                                $announce .= $torrent['announce-list'][$key][0] . '\n';
                                                        }
                                                } else {
                                                        $announce = $torrent['announce'];
                                                }
                                                        $created_by = $torrent['created by'];
                                                        $creation_date =$torrent['creation date'];
                                                        $encoding = $torrent['encoding'];
                                                        #$codepage= $torrent['codepage'];#error
                                                        $name =  convert_encoding($torrent['info']['name.utf-8'],$from="UTF-8", $to="GBK");
                                                        #$length = $torrent['info']['length'];#error
                                                        #$pieces =$torrent['info']['pieces'];#error
                                                        $piece_length =$torrent['info']['piece length'];
                                                        $publisher =convert_encoding($torrent['info']['publisher.utf-8'],$from="UTF-8", $to="GBK");
                                                        $publisher_url =$torrent['info']['publisher-url.utf-8'];
                                                        $bt_head ="[url=$array[0]]下载种子文件[/url]\n[b]Tracker Url:[/b]\n".$announce."[b]软件:[/b]".$created_by."\n[b]编码:[/b]".$encoding."\n[b]名称:[/b]".$name."\n[b]块长度:[/b]".$piece_length."\n[b]发布人:[/b]".$publisher."\n[b]站点:[/b]".$publisher_url."\n";
                                                        #*********nodes
                                                        if (is_array($torrent['nodes'])){
                                                                foreach ($torrent['nodes'] as $key => $value) {
                                                                        $nodes .= $torrent['nodes'][$key][0] . ':' . $torrent['nodes'][$key][1] . "\n";
                                                                }
                                                        }else{
                                                                $nodes = $torrent['nodes'];
                                                        }
                                                        #*********
                                                        #---------files
                                                        if (is_array($torrent['info']['files'])) {
                                                                foreach ($torrent['info']['files'] as $key => $value) {
                                                                        if($torrent['info']['files'][$key]['path']) {
                                                                                $files .= iif(is_array($torrent['info']['files'][$key]['path']), implode('/', $torrent['info']['files'][$key]['path']), $torrent['info']['files'][$key]['path']) . ' (' . vb_number_format($torrent['info']['files'][$key]['length'], 1, true) . ') \n';
                                                                        } else {
                                                                                $files .= iif(is_array($torrent['info']['files'][$key]['path.utf-8']), implode('/', $torrent['info']['files'][$key]['path.utf-8']), $torrent['info']['files'][$key]['path.utf-8']) . ' (' . vb_number_format($torrent['info']['files'][$key]['length'], 1, true) . ') \n';
                                                                        }
                                                                }
                                                        }
                                                        #----------
                                                $info =$bt_head."[b]节点:[/b]\n".$nodes."[b]种子文件:[/b]\n".$files;

                                }
                        }
                #}
                return preg_replace("/\[bt\](.+?)\[\/bt\]/is",$info, $message);
        } else {
                return $message;  //$infos =info_bt($message);
        }
}

在newthread.inc.php搜索

 
$pinvisible = $modnewthreads ? -2 : 0;

在下面添加一句:

 
$message =info_bt($message);

上传文件,覆盖到include目录
相关软件
  • Discuz!NT v2.0 正式版(net v1.1)
  • Discuz!NT v2.0 正式版(net2.x/3.x)
  • 全文检索 For Discuz! 6.0.0
  • OSPod.Forum 论坛系统 v2.0
  • phpMyAdmin(最新) v2.11.1.2 rc1 For Windows
  • phpMyAdmin(最新) v2.11.1.2 rc1 For Linux
 

关于我们 | 版权声明 | 广告联系 | 商务合作 | 网站地图 | 帮助中心|

Copyright © 2007-2009 CodeDn.Com  Style by CODEDN   辽ICP备05026829号