###################################################################
BitTorrent File Analyzer MolyX Board 2.x by Jiangcat @ MolyX Studio
###################################################################
首先,如果您有关于 BitTorrent 架构和通讯协议的任何问题,请查看:
<
a href=\"
http://bitconjurer.org/BitTorrent/protocol.html\" target=\"_blank\">
/a>\" target=\"_blank\">http://bitconjurer.org/BitTorrent/protocol.html</a>###################################################################
安装方法:请仔细阅读安装方法的每个步骤,确认您按照说明修改了论坛的
文件。
###################################################################
修改升级:liverxing
###################################################################
复制压缩包中的 xfunctions_torrent.php 到论坛 ./includes 目录
===================================================================
打开 ./lang/global.php
===================================================================
搜索:
===================================================================
'_uploadattachs' => '上传的附件',
===================================================================
下面添加:
===================================================================
'_uploadtorrents' => '上传的Torrent文件',
'_torrentdamaged' => 'Torrent文件信息损坏',
'_torrenthash' => '种子标识',
'_torrentcreatetime' => '创建日期',
'_torrentfilenum' => '文件数量',
'_torrentsizetotal' => '下载体积',
'_torrentsizepiece' => '分块体积',
===================================================================
===================================================================
打开 ./includes/functions_showthread.php
===================================================================
搜索:
===================================================================
class functions_showthread {
===================================================================
下面添加:
===================================================================
function generate_torrent_table($row=array())
{
global $forums, $bboptions;
if ( !count($row) )
return "";
$subpath = SAFE_MODE ? "" : implode('/', preg_split('//', intval($row['userid']), -1, PREG_SPLIT_NO_EMPTY));
$path = $bboptions['uploadfolder'] . '/' . $subpath;
$row['location'] = str_replace( "/", "", substr( $row['location'], strrpos( $row['location'], '/' ) ) );
$file = $path."/".$row['location'];
$stream = file_get_contents($file);
$array = $forums->DECfunc->BDecode($stream);
$infovariable = $array["info"];
if ( isset($infovariable["files"]) )
{
$filecount = "";
foreach ( $infovariable["files"] as $file )
{
$filecount += "1";
$torrentsize += $file['length'];
}
}
else
{
$filecount = 1;
$torrentsize = $infovariable['length'];
}
$thisrow = '
<
table width="
50%" border="
0" cellspacing="
1" cellpadding="
3" id="
ttable">
<
tr class="
tcat">
<
th width="
52%" align="
center" colspan="
4"><
a href="
attachment.php?'.$forums->sessionurl.'id='.$row[attachmentid].'&u='.$row[userid].'&extension='.$row[extension].'&attach='.$row[location].'&filename='.$row[filename].'" title="
" target="_blank">'.$row[filename].'<
/a><
/th>
<
/tr>';
if ( $array === FALSE )
{
$thisrow .= '
<
tr>
<
td class="
row1" align="
center" nowrap="
nowrap"><
strong>'.$forums->lang[_torrentdamaged].'<
/strong><
/td>
<
/tr>
<
/table>
<
br />';
return $thisrow;
}
$thisrow .= '
<
tr>
<
td class="
row1" nowrap="
nowrap" width="
1%">'.$forums->lang[_filesize].'<
/td>
<
td class="
row2">'.$forums->func->fetch_number_format($row[filesize], 1).'<
/td>
<
td class="
row1" nowrap="
nowrap" width="
1%">'.$forums->lang[_clicknums].'<
/td>
<
td class="
row2">'.$row[counter].'<
/td>
<
/tr>
<
tr>
<
td class="
row1" nowrap="
nowrap" width="
1%">'.$forums->lang[_torrentcreatetime].'<
/td>
<
td class="
row2">'.$forums->func->get_date($array["creation date"], 3).'<
/td>
<
td class="
row1" nowrap="
nowrap" width="
1%">'.$forums->lang[_torrentfilenum].'<
/td>
<
td class="
row2">'.$filecount.'<
/td>
<
/tr>
<
tr>
<
td class="
row1" nowrap="
nowrap" width="
1%">'.$forums->lang[_torrentsizetotal].'<
/td>
<
td class="
row2">'.$forums->func->fetch_number_format($torrentsize, 1).'<
/td>
<
td class="
row1" nowrap="
nowrap" width="
1%">'.$forums->lang[_torrentsizepiece].'<
/td>
<
td class="
row2">'.$forums->func->fetch_number_format($infovariable["piece length"], 1).'<
/td>
<
/tr>
<
tr>
<
td class="
row1" nowrap="
nowrap" width="
1%">'.$forums->lang[_torrenthash].'<
/td>
<
td class="
row2" colspan="
3" nowrap="
nowrap">'.sha1($forums->ENCfunc->BEncode($infovariable)).'<
/td>
<
/tr>
<
/table>
<
br />';
return $thisrow;
}
===================================================================
搜索:
===================================================================
function parse_attachment( $postids, $type='postid', $from='pid', $method='post' )
{
global $DB, $forums, $bbuserinfo, $bboptions;
===================================================================
下面添加:
===================================================================
require_once('./includes/xfunctions_torrent.php');
$forums->ENCfunc = new xfunctions_bencode();
$forums->DECfunc = new xfunctions_bdecode();
===================================================================
搜索:
===================================================================
} else {
$temp['attach'] .= "<
img src='images/".$bbuserinfo['imgurl']."/{$forums->cache['attachmenttype'][ $row['extension'] ]['attachimg']}' border='0' alt='".$forums->lang['_uploadattachs']."' /> <
a href='./../../attachment.php?{$forums->sessionurl}id={$row['attachmentid']}&u={$row['userid']}&extension={$row['extension']}&attach={$row['location']}&filename={$row['filename']}' title='' class='edit' target='_blank'>{$row['filename']}<
/a><
span class='edit'>( ".$forums->lang['_filesize'].": ".$forums->func->fetch_number_format($row['filesize'], 1)." ".$forums->lang['_clicknums'].": {$row['counter']} )<
/span><
br />";
}
===================================================================
替换为:
===================================================================
}
else if ( $row['extension'] == 'torrent' )
{
$temp['torrent'] .= $this->generate_torrent_table($row);
}
else {
$temp['attach'] .= "<
img src='images/".$bbuserinfo['imgurl']."/{$forums->cache['attachmenttype'][ $row['extension'] ]['attachimg']}' border='0' alt='".$forums->lang['_uploadattachs']."' /> <
a href='./../../attachment.php?{$forums->sessionurl}id={$row['attachmentid']}&u={$row['userid']}&extension={$row['extension']}&attach={$row['location']}&filename={$row['filename']}' title='' class='edit' target='_blank'>{$row['filename']}<
/a><
span class='edit'>( ".$forums->lang['_filesize'].": ".$forums->func->fetch_number_format($row['filesize'], 1)." ".$forums->lang['_clicknums'].": {$row['counter']} )<
/span><
br />";
}
===================================================================
查找:
===================================================================
if ( $temp['attach'] ) {
$attachment[$pid] .= "<
br /><
br /><
strong><
span class='edit'>".$forums->lang['_uploadattachs'].":<
/span><
/strong><
br />".$temp['attach'];
}
===================================================================
在下面添加:
===================================================================
if ( $temp['torrent'] ) {
$attachment[$pid] .= "<
br /><
br /><
strong><
span class='edit'>".$forums->lang['_uploadattachs'].":<
/span><
/strong><
br />".$temp['torrent'];
}
===================================================================