Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   TBDev 2010 revision 464 (http://www.bvlist.com/showthread.php?t=187)

Timisoreanul 18th January 2010 23:46

Quote:

Originally Posted by biggg (Post 19721)
can someone tell me where are that 2 files secrets.php and bittorrent.php?

in folder include you need to setup only bittorrent.php

Verifire 27th January 2010 22:31

Quote:

Originally Posted by Terminator (Post 17023)
i'm a big fan of tbdev releases, especially the black or dark, easy on eyes, skin ones. if they keep up the updates regularly like scam... ooops, i meant xam :)

Yeah.. Scxam.. That's it.. LOL. Guess who I've been feeding 80$ for nothing..

Wow, he weren't lying when he said they had "Unrivaled Customer Support", since there is none, except for if you pay him an additional 70,- to remove the bug that prevented my sysop from installing it onto our server .. Scxam.... :shock:

Now I'm shopping for TBDev.. Hear nice things about it..

Laffin 28th January 2010 00:16

tbdev is very nice, if you have some html/php coding skills.
if not, and you dont want to learn, than those fullymodded offshoots will have to suffice.
Other things about tbdev, is the support. You wont find a support system for a tracker that has endured as half as long as tbdev.
People, ya will also find a lot of knowledgeable ppl there as well regarding the source. And a number of other aspects Apache/mysql/linux/windows.
Also look at the longevity of the members there. Has to say something about what ppl think about tbdev and community.

seb35 28th January 2010 00:32

Agree with you laffin but me i love old code (xtbdev and torrentstrike)
Much simpler than the last release of tbdev

Laffin 28th January 2010 00:56

even if u use old code (I love the old code base as well). it still is a good idea to keep track of recent changes,and convert as necessary. Some of the new code is interesting. just doesn't fall into my style of coding (but than again, thats just personal preference and my coding experience).

if you used xtbdev/torrentstrike, you can see a lot of my coding style in the updates/add-ons i did.

varkulak 18th February 2010 01:39

Hi there..
I have a question. How i can transfer my btit tracker to this tbdev?

djblackout 5th April 2010 08:43

i like tbdev but evry time i install it on my web server the only thing not working is the hash key where exact do i need to enable or change that for work ? i have announce.php right and also config.php what more must i do to get the passkey system to work ? any help would be appriciated thanks i run mysql phpmyadmin apache2 linux debian 5.3 it saying invalid passkey when trying to seed on the torrent

wMan 5th April 2010 11:38

Quote:

Originally Posted by djblackout (Post 22248)
i like tbdev but evry time i install it on my web server the only thing not working is the hash key where exact do i need to enable or change that for work ? i have announce.php right and also config.php what more must i do to get the passkey system to work ? any help would be appriciated thanks i run mysql phpmyadmin apache2 linux debian 5.3 it saying invalid passkey when trying to seed on the torrent

its allways hed the passkey system not working and if you get working you will have proms with seed box upload then on it its not a very good code you want to wait for the new tbv code coming out very soon :cool: which ive been told its on its way so ill be trying it out

djblackout 5th April 2010 15:06

Quote:

Originally Posted by falcon (Post 22249)
its allways hed the passkey system not working and if you get working you will have proms with seed box upload then on it its not a very good code you want to wait for the new tbv code coming out very soon :cool: which ive been told its on its way so ill be trying it out

why the fuck would they go make a system where passkey is includet but not functionel thats big time gay ;S is it possible som where to disable passkey so torrents uploading and download work ? else its a joke to install a script like that where you cant use passkey lol

wMan 6th April 2010 01:23

Quote:

Originally Posted by djblackout (Post 22253)
why the fuck would they go make a system where passkey is includet but not functionel thats big time gay ;S is it possible som where to disable passkey so torrents uploading and download work ? else its a joke to install a script like that where you cant use passkey lol

yes i know me and a coder from here as tryed and tryed to get this to work with a seedbox upload and upload from a pc at home car`nt have both with it so we just dumped the code no good at all :wallbash:

mrrayden 15th April 2010 12:15

installation done?
 
hi i have installed the tracker source and maked de sysop account and when i try to login nothing happen just return me again to login page i have cookie enebled but nothing in my url when i put my adress: http://localhost/login.php?returnto=/


and when i try to loggin http://localhost/login.php?returnto=/my.php and
Code:

Not logged in!

Error: The page you tried to view can only be used when you're logged in.

Note: You need cookies enabled to log in.

and how can i disable the chaptcha code login i want more simple login not with pin or letters thanks

wdq 14th January 2011 13:32

go to include----> config.php


find and replace cookie setup with this lines


Code:

// Cookie setup
$TBDEV['cookie_prefix'] = 'tbalpha_'; // This allows you to have multiple trackers, eg for demos, testing etc.
$TBDEV['cookie_path'] = ''; // ATTENTION: You should never need this unless the above applies eg: /tbdev
$TBDEV['cookie_domain'] = ''; // set to eg: .somedomain.com or is subdomain set to: .sub.somedomain.com

and retry to login

hope this helps

badjoke23 23rd February 2011 10:54

Code:

Error

SQL query:

--
-- Database: `tb`
--
-- --------------------------------------------------------
--
-- Table structure for table `avps`
--
CREATE TABLE `avps` ( `arg` varchar( 20 ) COLLATE utf8_unicode_ci NOT NULL ,
`value_s` text COLLATE utf8_unicode_ci NOT NULL ,
`value_i` int( 11 ) NOT NULL DEFAULT '0',
`value_u` int( 10 ) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY ( `arg` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci;


MySQL said:

#1046 - No database selected


eremini 21st March 2011 16:01

Anyone had a problem with torrents made by the tracker being bad? As in I get "Invalid torrent file" from utorrent with every torrent downloaded.

chaotic 25th March 2011 03:53

hey pls help

PHP Code:


Warning
!                                  The following errors must be rectified before continuing!                                  

                                 
This feature has been DEPRECATED as of PHP 5.3.0Relying on this feature is highly discouraged 

what can i do?

cherwonk 13th April 2011 23:06

you need to upgrade your PHP .

d6bmg 27th April 2011 12:18

tbdev 2010 is not released yet. So, what is the point of this code?? part of tbdev09 v3 code??

Fynnon 27th April 2011 20:42

Quote:

Originally Posted by d6bmg (Post 27685)
tbdev 2010 is not released yet. So, what is the point of this code?? part of tbdev09 v3 code??

as it is said in the first post this is a BETA release of the next version of TBDEV
i called it 2010 so people know it`s diffrent from 2008/2009

i might call it TBDEV 2011 soon...or even 2012 if will not be released this year

:ok:

steglck 19th May 2011 15:32

PHP Code:

CREATE TABLE files id int(10unsigned NOT NULL AUTO_INCREMENTtorrent int(10unsigned NOT NULL DEFAULT '0'filename varchar(255COLLATE utf8_unicode_ci NOT NULLsize bigint(20unsigned NOT NULL DEFAULT '0'PRIMARY KEY (id), KEY torrent (torrent), FULLTEXT KEY filename (filename) ) 


Tyran 31st May 2011 12:18

PHP Code:

Warning!   The following errors must be rectified before continuing!  Please go back and try again!  CREATE TABLE files id int(10unsigned NOT NULL AUTO_INCREMENTtorrent int(10unsigned NOT NULL DEFAULT '0'filename varchar(255COLLATE utf8_unicode_ci NOT NULLsize bigint(20unsigned NOT NULL DEFAULT '0'PRIMARY KEY (id), KEY torrent (torrent), FULLTEXT KEY filename (filename) )  The used table type doesn't support FULLTEXT indexes 


Eltan 27th October 2011 16:54

Hum when I try to go on Index, I have this error :

PHP Code:

Warning:  require_once(C:\Program Files\EasyPHP-5.3.8.1\www\include\cache_functions.php) [function.require-once]: failed to open streamNo such file or directory in C:\Program Files\EasyPHP-5.3.8.1\www\index.php on line 23

Fatal error
:  require_once() [function.require]: Failed opening required 'include/cache_functions.php' (include_path='.;C:\php\pear'in C:\Program Files\EasyPHP-5.3.8.1\www\index.php on line 23 


Banned 29th November 2011 18:53

Cen i inport my Db from TBDEV netmaniac to TBDev 2010 revision 464?

dj_otrov 29th January 2012 01:58

:@
 
Code:

Warning! The following errors must be rectified before continuing!                                 

This feature has been DEPRECATED as of PHP 5.3.0.
Relying on this feature is highly discouraged. About Magic Quotes

host localhost
users user1868118
Password djvasko80
PhpMyAdmin interface
databases
1 to 3 as
db1868118-dbtorrent

http://balkantorrent.1x.de/install/index.php

shasta 29th January 2012 14:10

Quote:

Originally Posted by dj_otrov (Post 32750)
Code:

Warning! The following errors must be rectified before continuing!                                 

This feature has been DEPRECATED as of PHP 5.3.0.
Relying on this feature is highly discouraged. About Magic Quotes

host localhost
users user1868118
Password djvasko80
PhpMyAdmin interface
databases
1 to 3 as
db1868118-dbtorrent

http://balkantorrent.1x.de/install/index.php

Disable magic_quotes_gpc "On" to "Off" in your php.ini

Quote:

Originally Posted by Fynnon (Post 463)
Install:

1. from your hosting control panel or from phpmyadmin make a database and a database user

2. CHMOD 777 the files:

/announce.php
/include/config.php
and the folder /torrents

3. open in browser yourtracker.com/install and follow instructions


Fatal error
: Call to undefined function tbdev_cache_connect() in C:\AppServ\www\tracker\index.php on line 44

:sos:

duongkimngoc 21st April 2012 16:13

Quote:

Originally Posted by Eltan (Post 30864)
Hum when I try to go on Index, I have this error :

PHP Code:

( ! ) Warning: require_once(include/cache_functions.php) [function.require-once]: failed to open streamNo such file or directory in C:\wamp\www\tbdev\index.php on line 23

( ! ) Fatal error: require_once() [function.require]: Failed opening required 'include/cache_functions.php' (include_path='.;C:\php\pear'in C:\wamp\www\tbdev\index.php on line 23 


How to solve this problem?
I'm getting same error. :sad:

VodkAtekz 28th April 2012 14:40

Me, I've a error in index page go in http://www.bvlist.com/general/7870-i...010-tbdev.html for look my problems

:sos:

dandanch 30th May 2012 01:51

white page
 
Can someone please help me with this problem, I'm getting a white page on my home index and url http://codehacks.org not sure why. Any help would be grateful thanks.

firefly007 30th May 2012 11:39

Quote:

Originally Posted by duongkimngoc (Post 34401)
How to solve this problem?
I'm getting same error. :sad:

The error means as far as I can gather is that require_once "include/cache_functions.php"; can not be reached.

Also you will need to install and configure memchache :cool: or try this index.php where ive commented out that section.. its not the best solution though.


PHP Code:

<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2011 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
ob_start("ob_gzhandler");

require_once 
"include/bittorrent.php";
require_once 
"include/user_functions.php";
//require_once "include/cache_functions.php";

dbconn(true);

loggedinorreturn();

    
$lang array_mergeload_language('global'), load_language('index') );
    
//$lang = ;
    
    
$HTMLOUT '';
/*
$a = @mysql_fetch_assoc(@mysql_query("SELECT id,username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")) or die(mysql_error());
if ($CURUSER)
  $latestuser = "<a href='userdetails.php?id=" . $a["id"] . "'>" . $a["username"] . "</a>";
else
  $latestuser = $a['username'];
*/
/*$TBDEV['memcache_server'] = 'localhost';
$TBDEV['memcache_port'] = 11211;
$TBDEV['memcache'] = 1;
$TBDEVCACHE = array();

  if( tbdev_cache_connect() )
  {
      print( 'The cache is not working as intended' );
      exit();
  }
  
  if( !$TBDEVCACHE['stats']= getCache( 'frontpagestats' ) )
  {
    $sql = @mysql_query( "SELECT seeder, COUNT(*) as cnt FROM peers GROUP BY seeder" );
    
    $TBDEVCACHE['stats'] = array('seeders'=>0, 'leechers'=>0);
    
    while( $row = mysql_fetch_assoc($sql) )
    {
      if($row['seeder'] == 'yes')
      {
        $TBDEVCACHE['stats']['seeders'] = $row['cnt'];
      }
      else
      {
        $TBDEVCACHE['stats']['leechers'] = $row['cnt'];
      }
    }
    
    $TBDEVCACHE['stats']['registered'] = number_format(get_row_count("users"));
    //$unverified = number_format(get_row_count("users", "WHERE status='pending'"));
    $TBDEVCACHE['stats']['torrents'] = number_format(get_row_count("torrents"));
    //$dead = number_format(get_row_count("torrents", "WHERE visible='no'"));

    if ($TBDEVCACHE['stats']['leechers'] == 0)
    {
      $TBDEVCACHE['stats']['ratio'] = 0;
    }
    else
    {
      $TBDEVCACHE['stats']['ratio'] = round($TBDEVCACHE['stats']['seeders'] / $TBDEVCACHE['stats']['leechers'] * 100);
    }
    $TBDEVCACHE['stats']['peers'] = number_format($TBDEVCACHE['stats']['seeders'] + $TBDEVCACHE['stats']['leechers']);
    $TBDEVCACHE['stats']['seeders'] = number_format($TBDEVCACHE['stats']['seeders']);
    $TBDEVCACHE['stats']['leechers'] = number_format($TBDEVCACHE['stats']['leechers']);
    
    
    setCache( 'frontpagestats', $TBDEVCACHE['stats'], 10 );
  }
  //do_put( '12121212', $TBDEVCACHE['stats'], $ttl=60 );
  //print_r( do_get( '12121212' ) );
  //print_r( $TBDEVCACHE['stats'] );exit;
  
  //do_remove( '12121212' );
  
  
  
  if( !$TBDEVCACHE['news']= getCache( 'news' ) )
  {
    $sql = @mysql_query( "SELECT * FROM news WHERE added + ( 3600 *24 *45 ) >
                    ".TIME_NOW." ORDER BY added DESC LIMIT 10" );
    
    while( $row = mysql_fetch_assoc($sql) )
    {
      $TBDEVCACHE['news'][ $row['id'] ] = $row;
    }
    
    setCache( 'news', $TBDEVCACHE['news'], 30 );
  }
  
  
  //print_r(memcache_get_stats($memcache));exit;
  $adminbutton = '';
   */ 
    
if (get_user_class() >= UC_ADMINISTRATOR)
          
$adminbutton "&nbsp;<span style='float:right;'><a href='admin.php?action=news'>News page</a></span>\n";
          
    
$HTMLOUT .= "<div style='text-align:left;width:80%;border:1px solid blue;padding:5px;'>
    <div style='background:lightgrey;height:25px;'><span style='font-weight:bold;font-size:12pt;'>
{$lang['news_title']}</span>{$adminbutton}</div>";
      
                    
    if( 
count($TBDEVCACHE['news']) > )
    {
      require_once 
"include/bbcode_functions.php";

      
$button "";
      
      foreach( 
$TBDEVCACHE['news'] as $array )
      {
        if (
get_user_class() >= UC_ADMINISTRATOR)
        {
          
$button "<div style='float:right;'><a href='admin.php?action=news&mode=edit&newsid={$array['id']}'>{$lang['news_edit']}</a>&nbsp;<a href='admin.php?action=news&mode=delete&newsid={$array['id']}'>{$lang['news_delete']}</a></div>";
        }
        
        
$HTMLOUT .= "<div style='background:lightgrey;height:20px;'><span style='font-weight:bold;font-size:10pt;'>{$array['headline']}</span></div>\n";
        
        
$HTMLOUT .= "<span style='color:grey;font-weight:bold;text-decoration:underline;'>".get_date$array['added'],'DATE') . "</span>{$button}\n";
        
        
$HTMLOUT .= "<div style='margin-top:10px;padding:5px;'>".format_comment($array['body'])."</div><hr />\n";
        
      
      }
     
    }

    
$HTMLOUT .= "</div>\n";


    
$HTMLOUT .= "<div style='text-align:left;width:80%;border:1px solid blue;padding:5px;'>
    <div style='background:lightgrey;height:25px;'><span style='font-weight:bold;font-size:12pt;'>
{$lang['stats_title']}</span></div>
    
      <table align='center' class='main' border='1' cellspacing='0' cellpadding='5'>
      <tr>
      <td class='rowhead'>
{$lang['stats_regusers']}</td><td align='right'>{$TBDEVCACHE['stats']['registered']}</td>
      </tr>
      <!-- <tr><td class='rowhead'>
{$lang['stats_unverified']}</td><td align=right>{unverified}</td></tr> -->
      <tr>
      <td class='rowhead'>
{$lang['stats_torrents']}</td><td align='right'>{$TBDEVCACHE['stats']['torrents']}</td>
      </tr>"
;
      
    if (isset(
$TBDEVCACHE['stats']['peers'])) 
    { 
      
$HTMLOUT .= "<tr><td class='rowhead'>{$lang['stats_peers']}</td><td align='right'>{$TBDEVCACHE['stats']['peers']}</td></tr>
      <tr><td class='rowhead'>
{$lang['stats_seed']}</td><td align='right'>{$TBDEVCACHE['stats']['seeders']}</td></tr>
      <tr><td class='rowhead'>
{$lang['stats_leech']}</td><td align='right'>{$TBDEVCACHE['stats']['leechers']}</td></tr>
      <tr><td class='rowhead'>
{$lang['stats_sl_ratio']}</td><td align='right'>{$TBDEVCACHE['stats']['ratio']}</td></tr>";
    } 
    
      
$HTMLOUT .= "</table>
      </div>"
;

/*
<h2>Server load</h2>
<table width='100%' border='1' cellspacing='0' cellpadding='1'0><tr><td align=center>
<table class=main border='0' width=402><tr><td style='padding: 0px; background-image: url("<?php echo $TBDEV['pic_base_url']?>loadbarbg.gif"); background-repeat: repeat-x'>
<?php $percent = min(100, round(exec('ps ax | grep -c apache') / 256 * 100));
if ($percent <= 70) $pic = "loadbargreen.gif";
elseif ($percent <= 90) $pic = "loadbaryellow.gif";
else $pic = "loadbarred.gif";
$width = $percent * 4;
print("<img height='1'5 width=$width src=\"{$TBDEV['pic_base_url']}{$pic}\" alt='$percent%'>"); ?>
</td></tr></table>
</td></tr></table>
*/

    
$HTMLOUT .= sprintf("<p><font class='small'>{$lang['foot_disclaimer']}</font></p>"$TBDEV['site_name']);
    
    
$HTMLOUT .= "";

///////////////////////////// FINAL OUTPUT //////////////////////

    
print stdhead('Home') . $HTMLOUT stdfoot();
?>


Cataclismo 27th June 2012 11:56

1 Attachment(s)
File chache_functions.php is missing from include ... :sos:
EDIT :
Here is a index.php 100% working :)
Hope you like it :drink:

djzoulox 10th July 2012 15:44

public announce.php ?
 
can some one write me announce.php so it works as a public tracker.

this is my announce.php

Code:

/*
+------------------------------------------------
|  TBDev.net BitTorrent Tracker PHP
|  =============================================
|  by CoLdFuSiOn
|  (c) 2003 - 2011 TBDev.Net
|  http://www.tbdev.net
|  =============================================
|  svn: http://sourceforge.net/projects/tbdevnet/
|  Licence Info: GPL
+------------------------------------------------
|  $Date: 2011-04-06 01:23:59 +0300 (Wed, 06 Apr 2011) $
|  $Revision$
|  $Author: tbdevnet $
|  $URL: http://tbdevnet.svn.sourceforge.net/svnroot/tbdevnet/trunk/TB/install/announce_dist.php $
+------------------------------------------------
*/error_reporting(0);
////////////////// GLOBAL VARIABLES ////////////////////////////       
$TBDEV['baseurl'] = 'http://';
$TBDEV['announce_interval'] = 60 * 30;
$TBDEV['min_interval'] = 60 * 15;
$TBDEV['user_ratios'] = 0;
$TBDEV['connectable_check'] = 0;
define ('UC_VIP', 2);
// DB setup
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "";
$TBDEV['mysql_pass'] = "";
$TBDEV['mysql_db']  = "";
define( 'TIME_NOW', time() );
////////////////// GLOBAL VARIABLES ////////////////////////////

// DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU'RE DOING!!

define( 'TIME_NOW', time() );

$agent = $_SERVER["HTTP_USER_AGENT"];

// Deny access made with a browser...
if (
    preg_match('%^Mozilla/|^Opera/|^Links |^Lynx/%i', $agent) ||
    isset($_SERVER['HTTP_COOKIE']) ||
    isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ||
    isset($_SERVER['HTTP_ACCEPT_CHARSET'])
    )
    err("torrent not registered with this tracker CODE 1");

if( !$_GET['compact'] )
  {
    err('Sorry, this tracker no longer supports non-compact clients!');
  }
/////////////////////// FUNCTION DEFS ///////////////////////////////////
function dbconn()
{
    global $TBDEV;

    if (!@mysql_connect($TBDEV['mysql_host'], $TBDEV['mysql_user'], $TBDEV['mysql_pass']))
    {
          err('Please call back later');
    }
    mysql_select_db($TBDEV['mysql_db']) or err('Please call back later');
}

function err($x)
{
        exit('d14:failure reason' . strlen($x) . ":{$x}e");
}

function warn($x)
{
        exit('d15:warning message' . strlen($x) . ":{$x}e");
}

function benc_resp_raw($x)
{
    header( "Content-Type: text/plain" );
    header( "Pragma: no-cache" );

    if ( $_SERVER['HTTP_ACCEPT_ENCODING'] == 'gzip' )
    {
        header( "Content-Encoding: gzip" );
        echo gzencode( $x, 9, FORCE_GZIP );
    }
    else
        echo $x ;
}

function hash_where($name, $hash) {
    $shhash = preg_replace('/ *$/s', "", $hash);
    return "($name = " . sqlesc($hash) . " OR $name = " . sqlesc($shhash) . ")";
}

function sqlesc($x) {
    return "'".mysql_real_escape_string($x)."'";
}

function portblacklisted($port)
{
        // direct connect
        if ($port >= 411 && $port <= 413) return true;

        // bittorrent
        if ($port >= 6881 && $port <= 6889) return true;

        // kazaa
        if ($port == 1214) return true;

        // gnutella
        if ($port >= 6346 && $port <= 6347) return true;

        // emule
        if ($port == 4662) return true;

        // winmx
        if ($port == 6699) return true;

        return false;
}
/////////////////////// FUNCTION DEFS END ///////////////////////////////

$parts = array();
if( !isset($_GET['passkey']) OR !preg_match('/^[0-9a-fA-F]{32}$/i', $_GET['passkey'], $parts) )
                err("Invalid Passkey");
        else
                $GLOBALS['passkey'] = $parts[0];
               
foreach (array("info_hash","peer_id","event","ip","localip") as $x)
{
if(isset($_GET["$x"]))
$GLOBALS[$x] = "" . $_GET[$x];
}

foreach (array("port","downloaded","uploaded","left") as $x)
{
$GLOBALS[$x] = 0 + $_GET[$x];
}


foreach (array("passkey","info_hash","peer_id","port","downloaded","uploaded","left") as $x)

if (!isset($x)) err("Missing key: $x");



foreach (array("info_hash","peer_id") as $x)

if (strlen($GLOBALS[$x]) != 20) err("Invalid $x (" . strlen($GLOBALS[$x]) . " - " . urlencode($GLOBALS[$x]) . ")");

unset($x);

$info_hash = bin2hex($info_hash);

$ip = $_SERVER['REMOTE_ADDR'];

$port = 0 + $port;
$downloaded = 0 + $downloaded;
$uploaded = 0 + $uploaded;
$left = 0 + $left;

$rsize = 30;
foreach(array("num want", "numwant", "num_want") as $k)
{
        if (isset($_GET[$k]))
        {
                $rsize = (int)$_GET[$k];
                break;
        }
}


if (!$port || $port > 0xffff)
        err("invalid port");

if (!isset($event))
        $event = "";

$seeder = ($left == 0) ? "yes" : "no";

dbconn();


$user_query = mysql_query("SELECT id, uploaded, downloaded, class, enabled FROM users WHERE passkey=".sqlesc($passkey)) or err("Tracker error 2");

if ( mysql_num_rows($user_query) != 1 )

 err("Unknown passkey. Please redownload the torrent from {$TBDEV['baseurl']}.");
 
        $user = mysql_fetch_assoc($user_query);
        if( $user['enabled'] == 'no' ) err('Permission denied, you\'re not enabled');
       
       
$res = mysql_query("SELECT id, banned, seeders + leechers AS numpeers, added AS ts FROM torrents WHERE info_hash = " .sqlesc($info_hash));//" . hash_where("info_hash", $info_hash));

$torrent = mysql_fetch_assoc($res);
if (!$torrent)
        err("torrent not registered with this tracker CODE 2");

$torrentid = $torrent["id"];

$fields = "seeder, peer_id, compact, ip, port, uploaded, downloaded, userid";

//$numpeers = $torrent["numpeers"];
  $limit = "";

  if ($torrent['numpeers'] > $rsize)
    $limit = "ORDER BY RAND() LIMIT $rsize";
   
  $whereap ='';
 
  if ($seeder == 'yes')
    $whereap = "AND seeder = 'no'";
   
  $res = mysql_query("SELECT $fields FROM peers WHERE torrent = $torrentid AND connectable = 'yes' {$whereap} {$limit}");
 
  unset($whereap);
 
//////////////////// START NEW COMPACT MODE/////////////////////////////

  //$resp = "d" . benc_str("interval") . "i" . $TBDEV['announce_interval'] ."e" . benc_str("min interval") . "i" . 300 ."e5:"."peers" ;
  $resp = "d8:intervali{$TBDEV['announce_interval']}e12:min intervali{$TBDEV['min_interval']}e5:peers";
 
  $peers = '';

  $peer_num = 0;
 
  while ($row = mysql_fetch_assoc($res))
  {
    $peers .= $row['compact']; //pack('Nn', ip2long($row['ip']), $row['port']);

    $peer_num++;
  }



$resp .= strlen($peers) . ':' . $peers . 'e';



$selfwhere = "torrent = $torrentid AND " . hash_where("peer_id", $peer_id);

///////////////////////////// END NEW COMPACT MODE////////////////////////////////



if (!isset($self))
{
        $res = mysql_query("SELECT $fields FROM peers WHERE $selfwhere");
        $row = mysql_fetch_assoc($res);
        if ($row)
        {
                $userid = $row["userid"];
                $self = $row;
        }
}

//// Up/down stats ////////////////////////////////////////////////////////////



if (!isset($self))

{

$valid = @mysql_fetch_row(@mysql_query("SELECT COUNT(*) FROM peers WHERE torrent=$torrentid AND passkey=" . sqlesc($passkey)));

if ($valid[0] >= 1 && $seeder == 'no') err("Connection limit exceeded! You may only leech from one location at a time.");

if ($valid[0] >= 3 && $seeder == 'yes') err("Connection limit exceeded!");


        if ($left > 0 && $user['class'] < UC_VIP && $TBDEV['user_ratios'])
        {
                $gigs = $user["uploaded"] / (1024*1024*1024);
                $elapsed = floor((TIME_NOW - $torrent["ts"]) / 3600);
                $ratio = (($user["downloaded"] > 0) ? ($user["uploaded"] / $user["downloaded"]) : 1);
                if ($ratio < 0.5 || $gigs < 5) $wait = 48;
                elseif ($ratio < 0.65 || $gigs < 6.5) $wait = 24;
                elseif ($ratio < 0.8 || $gigs < 8) $wait = 12;
                elseif ($ratio < 0.95 || $gigs < 9.5) $wait = 6;
                else $wait = 0;
                if ($elapsed < $wait)
                                err("Not authorized (" . ($wait - $elapsed) . "h) - READ THE FAQ!");
        }
}
else
{
        $upthis = max(0, $uploaded - $self["uploaded"]);
        $downthis = max(0, $downloaded - $self["downloaded"]);

        if ($upthis > 0 || $downthis > 0)
                mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=".$user['id']) or err("Tracker error 3");
}

///////////////////////////////////////////////////////////////////////////////


$updateset = array();

if ($event == "stopped")
{
        if (isset($self))
        {
                mysql_query("DELETE FROM peers WHERE $selfwhere");
                if (mysql_affected_rows())
                {
                        if ($self["seeder"] == "yes")
                                $updateset[] = "seeders = seeders - 1";
                        else
                                $updateset[] = "leechers = leechers - 1";
                }
        }
}
else
{
        if ($event == "completed")
                $updateset[] = "times_completed = times_completed + 1";

        if (isset($self))
        {
                $compact = '';
                // only update compact if ip or port has changed
    if( $self['ip'] != $ip || ($self['port']+0) != $port )
    {
      $compact = "compact = ".sqlesc(pack('Nn', ip2long($ip), $port)).',';
    }
               
                mysql_query("UPDATE peers SET uploaded = $uploaded, downloaded = $downloaded,
                to_go = $left, last_action = ".TIME_NOW.", $compact
                seeder = '$seeder'"
                        . ($seeder == "yes" && $self["seeder"] != $seeder ? ",
                        finishedat = " . TIME_NOW : "") . " WHERE $selfwhere");
                       
                if (mysql_affected_rows() && $self["seeder"] != $seeder)
                {
                        if ($seeder == "yes")
                        {
                                $updateset[] = "seeders = seeders + 1";
                                $updateset[] = "leechers = leechers - 1";
                        }
                        else
                        {
                                $updateset[] = "seeders = seeders - 1";
                                $updateset[] = "leechers = leechers + 1";
                        }
                }
        }
        else
        {
                if ($event != "started")
                        err("Peer not found. ".$passkey." Restart the torrent.");

                if (portblacklisted($port))
                {
                        err("Port $port is blacklisted.");
                }
                elseif ( $TBDEV['connectable_check'] )
                {
                        $sockres = @fsockopen($ip, $port, $errno, $errstr, 5);
                        if (!$sockres)
                                $connectable = "no";
                        else
                        {
                                $connectable = "yes";
                                @fclose($sockres);
                        }
                }
                else
                {
      $connectable = 'yes';
                }
   
    $compact = sqlesc(pack('Nn', ip2long($ip), $port));
   
                $ret = mysql_query("INSERT INTO peers (connectable, torrent, peer_id, compact, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, passkey) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", $compact, " . sqlesc($ip) . ", $port, $uploaded, $downloaded, $left, ".TIME_NOW.", ".TIME_NOW.", '$seeder', {$user['id']}, " . sqlesc($agent) . "," . sqlesc($passkey) . ")");
               
                if ($ret)
                {
                        if ($seeder == "yes")
                                $updateset[] = "seeders = seeders + 1";
                        else
                                $updateset[] = "leechers = leechers + 1";
                }
        }
}

if ($seeder == "yes")
{
        if ($torrent["banned"] != "yes")
                $updateset[] = "visible = 'yes'";
       
        $updateset[] = "last_action = ".TIME_NOW;
}

if (count($updateset))
        mysql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $torrentid");

benc_resp_raw($resp);



?>


zyberwax 22nd October 2012 12:33

Problems!
 
I have upload all files and try and install this but i have this error:

This feature has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged. About Magic Quotes!


My hoster for dedicate server say that:
I see that is an error generated by php please contact developer.
He can replace the depreciated command about Magic Quotes.


Hope somebody can help with that :-)

Chez 19th November 2012 20:03

After i install the source, and when i go to the Index i got an error:

PHP Code:

Parse errorsyntax errorunexpected '<' in /home/www/free/uv.ro/torrapp.uv.ro/index.php on line 364 

how to solve it?:sos::muscle:

daffy 19th November 2012 20:05

looks like you have an extra < on line 364. try removing it or post index.php here

hmm there is no line 364? it only has 148lines in index.php

did you grab all files from svn?

http://tbdevnet.svn.sourceforge.net/...tbdevnet/trunk
(rev 464 Trunk)

http://tbdevnet.svn.sourceforge.net/...beta/?view=tar
(TBDev.Heavy.beta.rar)

Chez 20th November 2012 10:47

Sorry ... this is the error:

PHP Code:

Warning: require_once() [function.require-once]: Unable to access include/cache_functions.php in /home/www/free/uv.ro/torrapp.uv.ro/index.php on line 23

Warning
: require_once(include/cache_functions.php) [function.require-once]: failed to open streamNo such file or directory in /home/www/free/uv.ro/torrapp.uv.ro/index.php on line 23

Fatal error
: require_once() [function.require]: Failed opening required 'include/cache_functions.php' (include_path='.:./inc:/home/www/lib:/home/www/lib/pear:/home/www/lib/pear/DB:/home/www/lib/nusoap:/home/www/lib/phrame:/home/www/lib/toplabs:/allowrun:'in /home/www/free/uv.ro/torrapp.uv.ro/index.php on line 23 


but i solved the problem .... with index from Revision 334 from TBDEV Heavy Beta

Thanx a lot daffy :drink::friend:

ivo 26th December 2012 03:01

help
 
Hello people .. when I want to download torrent file shows me this in the picture, please help

http://www.zaslike.com/files/cugbtkwamoc86elv0ui.png


sorry if the topic is not on a distinguished place, I use a translator GOOGL

Bump: can somebody help please

joeroberts 28th December 2012 01:07

yea make sure you make your torrent directory write able

ivo 28th December 2012 01:11

downloaded
 
After uploading torrents ballot can not be downloaded, simply not in the torrent.

TBDev / Torrent how to set this up? thanks

joeroberts 28th December 2012 01:16

chmod your torrent directory to 777

ivo 28th December 2012 01:38

DL
 
http://www.zaslike.com/files/2npgz3ge6x5bnfnz6cl.png


htaccess / deny from all

joeroberts 28th December 2012 01:46

are you not going to lessen to what I said?
That fine Its not my problem I move on.


All times are GMT +2. The time now is 15:44.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.