﻿Копируем все из папки Root в директорию сайта

#SQL - выполнить данный SQL запрос
ALTER TABLE `bb_bt_torrents` ADD `multi_trackers_and_peers` TEXT NOT NULL ,
ADD `multi_updated_date` INT NOT NULL 

ALTER TABLE `bb_bt_torrents` ADD `multi_tracker_use` TINYINT( 1 ) NOT NULL DEFAULT '0'  

#Открываем:
ajax.php

#Ищем:
		'view_post'         => array('guest'),

#После Добавляем:		
		'force_update'		=> array('admin'),
		
#В конце файла, добавляем:
	function force_update()
	{
		include_once 'includes/functions_multi_tracker.php';
		$attach_id = (int) $this->request['attach_id'];
		
		if( !$attach_id )
		{
			$this->response['html'] = 'ERROR';
			$this->response['erds'] = 'Invalid Attach ID';
		}
		else
		{
			$update_ex = multi_tracker_update( $attach_id, TRUE, TRUE );
			if( $update_ex === FALSE )
			{
				$this->response['html'] = 'ERROR';
				$this->response['erds'] = 'UPDATE ERROR';
			}
			else
			{
				$this->response['html'] 		= 'THIS External Torrent, Updated!';
				$this->response['complete']		= $update_ex['complete'];
				$this->response['incomplete']	= $update_ex['incomplete'];
			}
		}
	}
	
#Открываем:
includes/functions_torrent.php

#Ищем:
	// update tracker status for this attachment

#Перед добавляем:
	include_once 'includes/functions_multi_tracker.php';
	$attach_ids = (int) $attach_id;
	$states		= (int)	1;
	if(return_announcers($tor)=== FALSE)
	{ }
	else
	{
		_update_torrent_state($attach_ids, $states);
	}
	
	if( 
		!array_key_exists('announce-list',$tor) && 
		!stristr($bb_cfg['bt_announce_url'], $tor['announce'])
		)
	{	
		$tor['announce-list'] = array(array(
			$tor['announce']
		));
	}
	
#Открываем:	
templates/default/viewtopic_attach.tpl

#В самом начале добавляем:
<script type="text/javascript">
ajax.callback.force_update = function(data){
	if(data['html']=='ERROR')
	{
		alert(data['erds']);
	}
	else
	{
		alert(data['html']);
		$('#seeds').html(data['complete']);
		$('#lichs').html(data['incomplete']);
	}
};
</script>

#Ищем:
			[ <span title="{postrow.attach.tor_reged.REGED_DELTA}">{postrow.attach.tor_reged.REGED_TIME}</span> ]
			
#После добавляем:
            &nbsp;<a href="#" onclick="ajax.exec({action	: 'force_update',attach_id:{postrow.attach.tor_reged.ATTACH_ID}});">FORCE UPDATE</a>

#Открываем:
viewforum.php

#Ищем:
		sn.seeders, sn.leechers
		
#После В линии добавляем:
, tor.multi_trackers_and_peers AS ex_peers

#Ищем:
$template->assign_block_vars('t.tor', array(

#Перед добавляем:
$strx = @unserialize($topic['ex_peers']);

#Ищем:
			'SEEDERS'    => (int) $topic['seeders'],
			'LEECHERS'   => (int) $topic['leechers'],
			
#Заменяем:
			'SEEDERS'    => ((int) $topic['seeders'])+$strx['complete'],
			'LEECHERS'   => ((int) $topic['leechers'])+$strx['incomplete'],
			
#Открываем:
attach_mod/displaying_torrent.php

#Ищем:
$change_peers_bgr_over = true;

#После Добавляем:
require_once 'includes/functions_multi_tracker.php';

#Ищем:
$tor_reged = (bool) $tracker_status;

#Перед добавляем
multi_tracker_update($attach_id);

#Ищем:
	// Show peers
	
#Перед добавляем	
		$exPeers	= get_external_peers($attach_id);
		
		$template->assign_vars(array(
			'EX_SEEDS'		=> $exPeers['complete'],
			'EX_LICHERS'	=> $exPeers['incomplete'],
		));
		
#Открываем:		
tracker.php

#Ищем:
				t.topic_title, t.topic_replies, t.topic_views, sn.seeders, sn.leechers
				
#После В линии добавляем:
, tor.multi_trackers_and_peers

#Ищем:				
			$seeds  = $tor['seeders'];
			$leechs = $tor['leechers'];
			
#Заменяем:
			$sdfsd = @unserialize($tor['multi_trackers_and_peers']);
			
			$seeds  = $tor['seeders']+$sdfsd['complete'];
			$leechs = $tor['leechers']+$sdfsd['incomplete'];
			
#Открываем:				
config.php

#В самом конце добавляем:
//External Peer's statisric expire time 
$bb_cfg['m_expire_time'] 	= 10800;

//Tracker announce TimeOut
$bb_cfg['m_time_out']		= 5;

#Открываем:
templates/default/viewtopic_torrent.tpl

#Ищем:
<!-- ENDIF / SHOW_TOR_ACT -->

#После Добавляем:
<!-- IF EX_SEEDS -->
<tr>
	<td colspan="2" class="pad_8 row2">
    	<span style="color:#30F">Внешних Сидов/Личеров: <strong><span style="color:#0C0" id="seeds">{EX_SEEDS}</span>/<span style="color:#F30" id="lichs">{EX_LICHERS}</span></strong></span>
    </td>
</tr>
<!-- ENDIF -->



<!-- IF EX_SEEDS -->
<tr>
	<td colspan="2" class="pad_8 row2">
					<span class="seed">{L_EX_SEED}:&nbsp; <b>{SEED_COUNT}</b> &nbsp;[&nbsp; {EX_SEEDS} &nbsp;]</span> &nbsp;
					
					<span class="leech">{L_EX_LEECH}:&nbsp;	<b>{LEECH_COUNT}</b> &nbsp;[&nbsp; {EX_LICHERS}&nbsp;]</span> &nbsp;
					
    	    </td>
</tr>
<!-- ENDIF -->






