用户名 UID Email
  • «
  • 1
  • 2
  • »
  • Pages: 1/2     Go
级别: 新手上路
楼主  发表于: 2008-02-25 01:34

 6.0正式版BT文件分析插件(不是原创)

        说明一下:
                      这是把这张贴子 http://www.phpwind.net/read-htm-tid-514799-fpage-2.html
                                的改一下.因为.很多人找不到第一步,
                 

                  演示地址:http://www.8kai.cn/read.php?tid-1350.html

图片



1.require\pw_func.php

找到:

        $ifupload=3;$type='zip';

在下面添加:



$ifupload=4;$type='torrent';


6.0正式版就是改了上面这一步..其它都没变

2.thread.php

找到:

$attachtype=array(
  '1'=>'img',
  '2'=>'txt',
  '3'=>'zip'
);

修改为:

$attachtype=array(
  '1'=>'img',
  '2'=>'txt',
  '3'=>'zip',
  '4'=>'torrent'
);


3.require\updateforum.php

找到:

    switch($type){
        case 'img': return 1;
        case 'txt': return 2;
        case 'zip': return 3;
    }

修改为:

    switch($type){
        case 'img': return 1;
        case 'txt': return 2;
        case 'zip': return 3;
        case 'torrent': return 4;
    }



4.read.php

找到:

else{
                $read['downattach'][$at['aid']]=array($at['aid'],$at['name'],$at['size'],$at['hits'],$at['needrvrc']

上面加上:


else if($at['type']=='torrent'){
require_once (R_P.'require/BDecode.php');
require_once (R_P.'require/BEncode.php');
  //打开bt文件,并获取其中的信息!
$fd = fopen(R_P.$attachpath.'/'.$at['attachurl'],"rb");
$btsize = $at['size']*1024;
$alltorrent = fread($fd,$btsize);
$array = BDecode($alltorrent);
if ($array) {
  $at['hash'] = @sha1(BEncode($array["info"]));
  $at['announce']=$array['announce'];
  if (sizeof($array['info']['files'])<=1) {
    $at['btfilesize']=$array['info']['length'];
    $at['btfilename']=$array['info']['name'];
  }else{
    $at['btfilesize']=0;
    $at['btfilename']=$array['info']['files']['name'];
    for ( $i=0 ; $i<sizeof($array['info']['files']);$i++){
    for ($j=0;$j<sizeof($array['info']['files'][$i]['path']);$j++){
      $at['btfilename'].="/".$array['info']['files'][$i]['path'][$j];
    }
    $at['btfilename'].='
        ';
    $at['btfilesize']+=$array['info']['files'][$i]['length'];
    }
  }
  $at['btfilename']=str_replace(array('>', '<', '"'),array('', '', "& q u o t" ),$at['btfilename']);
  $at['btfilename']= nl2br($at['btfilename']);
  if ($at['btfilesize']<1024 ) {
    $at['btfilesize']=$at['btfilesize']."B";
  }
  elseif ($at['btfilesize']<(1024*1024))  {
    $at['btfilesize']=(integer)($at['btfilesize']/1024) ;
    $at['btfilesize']=$at['btfilesize']."KB";
  }
  elseif ($at['btfilesize']<(1024*1024*1024))  {
    $at['btfilesize']=(integer)($at['btfilesize']/(1024*1024));
    $at['btfilesize']=$at['btfilesize']."MB";
  }elseif ($at['btfilesize']<(1024*1024*1024*1024)) {
    $at['btfilesize']=(integer)($at['btfilesize']/(1024*1024*1024));
    $at['btfilesize']=$at['btfilesize']."GB";
  }
  else{
    $at['btfilesize']=(integer)($at['btfilesize']/(1024*1024*1024*1024));
    $at['btfilesize']=$at['btfilesize']."TB";
  }
  unset($array);
  fclose($fd);
  }
$read['torrent'][]=array($at['aid'],$at['name'],$at['size'],$at['hits'],$at['needrvrc'],$at['type'],$dfadmin,
  $at['hash'],$at['btfilesize'],$at['btfilename'],$at['announce']);
}



找到:
                $read['downattach'][$at['aid']]=array($at['aid'],$at['name'],$at['size'],$at['hits'],$at['needrvrc'],$at['type'],$dfadmin,$at['desc']);


修改为:
                $read['downattach'][$at['aid']]=array($at['aid'],$at['name'],$at['size'],$at['hits'],$at['needrvrc'],$at['type'],$dfadmin,$at['desc'],$at['hash'],$at['btfilesize'],$at['btfilename'],$at['announce']);


5.read.htm:

找到:

<div class="tpc_content" id="read_$read[pid]">$read[content]</div>

下面添加:

<!--
EOT;
if($read['torrent']){
foreach($read['torrent'] as $bt){
if($bt){print <<<EOT
-->
<table align="center" width="80%" border="0" cellspacing="1" cellpadding="3" bgcolor=$tablecolor style="table-layout: fixed; word-wrap: break-word">
  <tr class="head"><td colspan="3" align="center">BitTorrent 下載 </td></tr>
  <tr class=t_one><td colspan="3" align="center"><img src='$imgpath/$stylepath/file/$bt[5].gif' align=absbottom> 種子下載:
  <a href='job.php?action=download&pid=$read[pid]&tid=$tid&aid=$bt[0]' target='_blank'><font color=red>$bt[1]</font></a>($bt[2]K)(下載次數$bt[3])
<!--
EOT;
if($bt[4]){print <<<EOT
-->
需要威望:$bt[4]
<!--
EOT;
}if($bt[6]){print <<<EOT
-->
[<a href='job.php?action=deldownfile&pid=$read[pid]&tid=$tid&aid=$bt[0]'><font color=red>刪除</font></a>]
<!--
EOT;
}print <<<EOT
-->
  </td></tr>
  <tr class=t_one><td width="100">文件hash :</td><td width="320" colspan="2">$bt[7]</td></tr>
  <tr class=t_two><td>文件大小 :</td><td colspan="2">$bt[8]</td></tr>
  <tr class=t_one><td>文件/目錄名 :</td><td colspan="2">$bt[9]</td></tr>
  <tr class=t_two><td>Tracker: </td><td colspan="2">$bt[10]</td></tr>
</table>
<!--
EOT;
}}}print <<<EOT
-->

6.把文件BDecode.php和BEncode.php放到论坛require目录里

红色为必须修改此处,一定要把& q u o t写上,并且字符间不带空格 才能在READ页显示 否则白页 很多人都这样的
BT文件分析插件.rar (16 K) 下载次数:64

本帖最近评分记录:
  • 威望:+1(wsf263747263)
  • 踏踏狗社区
    www.tatago.com
    mou
    闲来灌水
    级别: 六星会员
    1楼  发表于: 2008-02-25 03:38
    不错

    这个今天刚在想有没有
    mou
    闲来灌水
    级别: 六星会员
    2楼  发表于: 2008-02-25 03:38
    演示出现问题  帖子空白
    级别: 新手上路
    3楼  发表于: 2008-02-25 04:41
    我做的时候好好的.
    踏踏狗社区
    www.tatago.com
    级别: 新手上路
    4楼  发表于: 2008-02-25 04:42
    红色为必须修改此处,一定要把& q u o t写上,并且字符间不带空格 才能在READ页显示 否则白页 很多人都这样的
    踏踏狗社区
    www.tatago.com
    级别: 新手上路
    5楼  发表于: 2008-02-25 04:46
    我在修改页面时.冲突了...呵可.
    踏踏狗社区
    www.tatago.com
    级别: 新手上路
    6楼  发表于: 2008-02-25 05:11
    OK...我的演示已经改回了.可以去看看.
    踏踏狗社区
    www.tatago.com
    级别: Wind helper
    7楼  发表于: 2008-02-25 08:03
    看看
    今天来的比昨天早······因为······我昨天没来····(*^__^*)
    级别: Wind helper
    8楼  发表于: 2008-02-25 10:36
    Quote:
    引用第7楼秋的感觉于2008-02-25 08:03发表的  :
    看看
    名花虽有主,我来松松土。只要锄头挥的好,哪有墙角挖不倒!
    级别: 六星会员
    9楼  发表于: 2008-02-25 10:57
    额..
    级别: 初来乍到
    10楼  发表于: 2008-03-05 16:27
    太感谢楼主了
    link:订票 -- 十分优秀的票务网站
    Www.KisSoS.Cn
    级别: 二星会员
    11楼  发表于: 2008-04-05 10:21
    第一部~~还是找不到
    插件风格制作专用QQ联系QQ:263747263
    级别: 五星会员
    12楼  发表于: 2008-04-05 10:44
    不错
    壹号色网欢迎您www.1hsw.com
    级别: 新手上路
    13楼  发表于: 2008-04-05 11:57
    没弄好..找不到文件..
    壹号色网欢迎您www.1hsw.com
    级别: 一星会员
    14楼  发表于: 2008-05-14 18:47
    1.require\pw_func.php

    找到:

            $ifupload=3;$type='zip';

    在下面添加:


    $ifupload=4;$type='torrent';



    文件里面找不到查找的内容...