crowni |
16th June 2011 19:08 |
[HACK]Torren Stream by crowni
3 Attachment(s)
I make this hack for xbtit 221 r669 version
Open torrent.list.tpl search
put below it
search
below it paste
open torrents.php and search
Code:
$torrenttpl->set("torrent_header_download",$language["DOWN"]);
below it paste
Code:
$torrenttpl->set("torrent_header_viewonline", 'View online');
search
below it paste
Code:
if(in_array($data['catid'], $GLOBALS['viewonline_categories'])) {
$torrents[$i]["viewonline"]="View online\n";
}
else {
$torrents[$i]["viewonline"] = "-";
}
open download.php and search
Code:
print($alltorrent);
}
?>
and replace with
Code:
print($alltorrent);
}
}
function viewonline($torrent_data, $name, $embed_player)
{
// подключение файла с клиентом
require_once($GLOBALS['THIS_BASEPATH'] . '/include/ts_client.php');
define('API_KEY', '21bc1d9127642b6b4b9748403c641d3g'); // ваш код партнера, находится в разделе "Мой профиль"
define('ZONE_ID', 20); // идентификатор площадки, находится в разделе "Площадки", колонка "ID"
// создание клиента
$client = new TS_Client(API_KEY);
/*
* Метод add_content имеет такие параметры:
* - id площадки
* - содержимое torrent-файла в кодировке base64
* - название контента
* - длительность в секундах
*
* При успешном добалении контента в систему Torrent Stream метод возвращается уникальный идентификатор контента ($content_uid).
* В случае ошибки возвращается FALSE.
*/
$duration = 0;
$content_uid = $client->add_content(ZONE_ID, base64_encode($torrent_data), $name, $duration);
if($content_uid === false) {
if($embed_player) {
return null;
}
else {
die('Cannot view online');
}
}
if($embed_player) {
return $content_uid;
}
else {
// полученный идентификатор можно использовать для переадресации на страницу плеера на сервере Torrent Stream
header('Location: http://torrentstream.org/play.php?id=' . $content_uid);
exit();
}
}
?>
go to this address and register after the registration http://torrentstream.net go to the menu of Мой профиль and copy the code right of the Код партнера:
locate in download.php
Code:
define('API_KEY', '21bc1d9127642b6b4b9748403c641d3g'); // ваш код партнера, находится в разделе "Мой профиль"
and replace this code 21bc1d9127642b6b4b9748403c641d3g your copy from which Мой профиль
Then click the menu Площадки click on caption Добавить площадку and box type a name of the site as receiver with which you registered and click Сохранитъ
under ID copy number and locate in download.php
Code:
define('ZONE_ID', 20);
and replace 20 with the figure under which copies ID
locate in download.php
Code:
$infohash=mysql_real_escape_string($_GET["id"]);
below it paste
Code:
$viewonline = isset($_GET['viewonline']) ? true : false;
search
below it paste
Code:
$filename = $row['filename'];
search
below it a space of one row insert
Code:
if(defined('VIEWONLINE_EMBED')) {
$content_uid = viewonline($alltorrent, $filename, true);
}
elseif($viewonline) {
viewonline($alltorrent, $filename, false);
}
else {
search
Code:
$alltorrent=BEncode($array);
header("Content-Type: application/x-bittorrent");
header('Content-Disposition: attachment; filename="'.$f.'"');
print($alltorrent);
}
and replace with
Code:
$alltorrent=BEncode($array);
if(defined('VIEWONLINE_EMBED')) {
$content_uid = viewonline($alltorrent, $filename, true);
}
elseif($viewonline) {
viewonline($alltorrent, $filename, false);
}
else {
header("Content-Type: application/x-bittorrent");
header('Content-Disposition: attachment; filename="'.$f.'"');
print($alltorrent);
}
}
now open details.php and looking for end of file
Code:
$torrenttpl->set("torrent",$row);
$torrenttpl->set("comments",$comments);
$torrenttpl->set("files",$dfiles);
?>
and replace with
Code:
$torrenttpl->set("torrent",$row);
$torrenttpl->set("comments",$comments);
$torrenttpl->set("files",$dfiles);
if(in_array($row['catid'], $GLOBALS['viewonline_categories'])) {
define('VIEWONLINE_EMBED', 1);
include('download.php');
if( ! empty($content_uid)) {
$torrenttpl->set('VIEWONLINE', true);
$torrenttpl->set('content_uid', $content_uid);
}
else {
$torrenttpl->set('VIEWONLINE', false);
}
}
?>
Search
Code:
$res = get_result("SELECT
after past
Code:
f.category AS catid,
if your torrent tracker is only for movies clips concerts past this code
Code:
$torrenttpl->set("torrent",$row);
$torrenttpl->set("comments",$comments);
$torrenttpl->set("files",$dfiles);
define('VIEWONLINE_EMBED', 1);
include('download.php');
if( ! empty($content_uid)) {
$torrenttpl->set('VIEWONLINE', true);
$torrenttpl->set('content_uid', $content_uid);
}
else {
$torrenttpl->set('VIEWONLINE', false);
}
?>
open torrent.details.tpl and search
|