Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
Thread Tools
  #1  
Old 17th June 2010, 20:40
usbiz usbiz is offline
Member
 
Join Date: Jun 2010
P2P
Posts: 12
Default upload failed
i have install the script but when upload an torrent it show

Code:
Upload failed!
invalid announce url! must be http://03530.com/announce.php
how can i fix it ?

announce.php
PHP Code:
<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2009 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
error_reporting(0);
////////////////// GLOBAL VARIABLES ////////////////////////////    
$TBDEV['baseurl'] = 'http://03530.com/';
$TBDEV['announce_interval'] = 60 30;
$TBDEV['user_ratios'] = 0;
$TBDEV['connectable_check'] = 0;
define ('UC_VIP'2);
// DB setup
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "t";
$TBDEV['mysql_pass'] = "t";
$TBDEV['mysql_db']   = "t";
////////////////// GLOBAL VARIABLES ////////////////////////////

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

$agent $_SERVER["HTTP_USER_AGENT"];

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

/////////////////////// 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($msg)
{
    
benc_resp(array('failure reason' => array('type' => 'string''value' => $msg)));
    
    exit();
}

function 
benc_resp($d)
{
    
benc_resp_raw(benc(array('type' => 'dictionary''value' => $d)));
}

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$x9FORCE_GZIP );
    }
    else
        echo 
$x ;
}

function 
benc($obj) {
    if (!
is_array($obj) || !isset($obj["type"]) || !isset($obj["value"]))
        return;
    
$c $obj["value"];
    switch (
$obj["type"]) {
        case 
"string":
            return 
benc_str($c);
        case 
"integer":
            return 
benc_int($c);
        case 
"list":
            return 
benc_list($c);
        case 
"dictionary":
            return 
benc_dict($c);
        default:
            return;
    }
}

function 
benc_str($s) {
    return 
strlen($s) . ":$s";
}

function 
benc_int($i) {
    return 
"i" $i "e";
}

function 
benc_list($a) {
    
$s "l";
    foreach (
$a as $e) {
        
$s .= benc($e);
    }
    
$s .= "e";
    return 
$s;
}

function 
benc_dict($d) {
    
$s "d";
    
$keys array_keys($d);
    
sort($keys);
    foreach (
$keys as $k) {
        
$v $d[$k];
        
$s .= benc_str($k);
        
$s .= benc($v);
    }
    
$s .= "e";
    return 
$s;
}

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();
$pattern '[0-9a-fA-F]{32}';
if( !isset(
$_GET['passkey']) OR !ereg($pattern$_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] = $_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]) != 20err("Invalid $x (" strlen($GLOBALS[$x]) . " - " urlencode($GLOBALS[$x]) . ")");

unset(
$x);

$info_hash bin2hex($info_hash);

$ip $_SERVER['REMOTE_ADDR'];

$port $port;
$downloaded $downloaded;
$uploaded $uploaded;
$left $left;

$rsize 50;
foreach(array(
"num want""numwant""num_want") as $k)
{
    if (isset(
$_GET[$k]))
    {
        
$rsize $_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) != )

 
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, ip, port, uploaded, downloaded, userid";

$numpeers $torrent["numpeers"];
$limit "";
if (
$numpeers $rsize)
    
$limit "ORDER BY RAND() LIMIT $rsize";
$res mysql_query("SELECT $fields FROM peers WHERE torrent = $torrentid AND connectable = 'yes' $limit");

//////////////////// START NEW COMPACT MODE/////////////////////////////

if($_GET['compact'] != 1)

{

$resp "d" benc_str("interval") . "i" $TBDEV['announce_interval'] . "e" benc_str("peers") . "l";

}

else

{

$resp "d" benc_str("interval") . "i" $TBDEV['announce_interval'] ."e" benc_str("min interval") . "i" 300 ."e5:"."peers" ;

}

$peer = array();

$peer_num 0;
while (
$row mysql_fetch_assoc($res))

{

    if(
$_GET['compact'] != 1)

{



$row["peer_id"] = str_pad($row["peer_id"], 20);



if (
$row["peer_id"] === $peer_id)

{

 
$self $row;

 continue;

}



$resp .= "d" .

 
benc_str("ip") . benc_str($row["ip"]);

       if (!
$_GET['no_peer_id']) {

  
$resp .= benc_str("peer id") . benc_str($row["peer_id"]);

 }

 
$resp .= benc_str("port") . "i" $row["port"] . "e" .

 
"e";

      }

      else

      {

         
$peer_ip explode('.'$row["ip"]);

$peer_ip pack("C*"$peer_ip[0], $peer_ip[1], $peer_ip[2], $peer_ip[3]);

$peer_port pack("n*", (int)$row["port"]);

$time intval((time() % 7680) / 60);

if(
$_GET['left'] == 0)

{

$time += 128;

}

$time pack("C"$time);



   
$peer[] = $time $peer_ip $peer_port;

$peer_num++;


      }

}



if (
$_GET['compact']!=1)

$resp .= "ee";

else

{
$o "";
for(
$i=0;$i<$peer_num;$i++)

 {

  
$o .= substr($peer[$i], 16);

 }

$resp .= strlen($o) . ':' $o '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] >= && $seeder == 'no'err("Connection limit exceeded! You may only leech from one location at a time.");

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


    if (
$left && $user['class'] < UC_VIP && $TBDEV['user_ratios'])
    {
        
$gigs $user["uploaded"] / (1024*1024*1024);
        
$elapsed floor((time() - $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 || $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))
    {
        
mysql_query("UPDATE peers SET uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = ".time().", seeder = '$seeder'"
            
. ($seeder == "yes" && $self["seeder"] != $seeder ", finishedat = " time() : "") . " 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$errstr5);
            if (!
$sockres)
                
$connectable "no";
            else
            {
                
$connectable "yes";
                @
fclose($sockres);
            }
        }
        else
        {
      
$connectable 'yes';
        }

        
$ret mysql_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, passkey) VALUES ('$connectable', $torrentid, " sqlesc($peer_id) . ", " sqlesc($ip) . ", $port$uploaded$downloaded$left, ".time().", ".time().", '$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();
}

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

benc_resp_raw($resp);



?>
config.php
PHP Code:
<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2009 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
error_reporting(E_ALL);

define('SQL_DEBUG'2);

/* Compare php version for date/time stuff etc! */
    
if (version_compare(PHP_VERSION"5.1.0RC1"">="))
        
date_default_timezone_set('Europe/London');


define('TIME_NOW'time());

$TBDEV['time_adjust'] =  0;
$TBDEV['time_offset'] = '0'
$TBDEV['time_use_relative'] = 1;
$TBDEV['time_use_relative_format'] = '{--}, h:i A';
$TBDEV['time_joined'] = 'j-F y';
$TBDEV['time_short'] = 'jS F Y - h:i A';
$TBDEV['time_long'] = 'M j Y, h:i A';
$TBDEV['time_tiny'] = '';
$TBDEV['time_date'] = '';


// DB setup
// FYNNON FUCKWIT FRENCH RETARD
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "t";
$TBDEV['mysql_pass'] = "t";
$TBDEV['mysql_db']   = "t";

// 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']  = '.03530.com'// set to eg: .somedomain.com or is subdomain set to: .sub.somedomain.com
                              
$TBDEV['site_online'] = 1;
$TBDEV['tracker_post_key'] = 'changethisorelse';
$TBDEV['max_torrent_size'] = 1000000;
$TBDEV['announce_interval'] = 60 30;
$TBDEV['signup_timeout'] = 86400 3;
$TBDEV['minvotes'] = 1;
$TBDEV['max_dead_torrent_time'] = 3600;

// Max users on site
$TBDEV['maxusers'] = 5000// LoL Who we kiddin' here?


if ( strtouppersubstr(PHP_OS03) ) == 'WIN' )
  {
    
$file_path str_replace"\\""/"dirname(__FILE__) );
    
$file_path str_replace"/include"""$file_path );
  }
  else
  {
    
$file_path dirname(__FILE__);
    
$file_path str_replace"/include"""$file_path );
  }
  
define('ROOT_PATH'$file_path);
$TBDEV['torrent_dir'] = ROOT_PATH '/torrents'# must be writable for httpd user   

# the first one will be displayed on the pages
$TBDEV['announce_urls'] = array();
$TBDEV['announce_urls'][] = "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";

if ($_SERVER["HTTP_HOST"] == "")
  
$_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];
  
$TBDEV['baseurl'] = "http://" $_SERVER["HTTP_HOST"]."/TB_ALPHA";

/*
## DO NOT UNCOMMENT THIS: IT'S FOR LATER USE!
$host = getenv( 'SERVER_NAME' );
$script = getenv( 'SCRIPT_NAME' );
$script = str_replace( "\\", "/", $script );

  if( $host AND $script )
  {
    $script = str_replace( '/index.php', '', $script );

    $TBDEV['baseurl'] = "http://{$host}{$script}";
  }
*/

//set this to true to make this a tracker that only registered users may use
//$TBDEV['membersonly'] = 1; //deprecated no longer needed

//maximum number of peers (seeders+leechers) allowed before torrents starts to be deleted to make room...
//set this to something high if you don't require this feature
//$TBDEV['peerlimit'] = 50000; //deprecated. no longer used.

// Email for sender/return path.
$TBDEV['site_email'] = "coldfusion@localhost";

$TBDEV['site_name'] = "Torrent Site";

$TBDEV['language'] = 'en';
$TBDEV['msg_alert'] = 0// saves a query when off

$TBDEV['autoclean_interval'] = 900;
$TBDEV['sql_error_log'] = ROOT_PATH.'/logs/sql_err_'.date("M_D_Y").'.log';
$TBDEV['pic_base_url'] = "./pic/";
$TBDEV['stylesheet'] = "./1.css";
$TBDEV['readpost_expiry'] = 14*86400// 14 days
//set this to size of user avatars
$TBDEV['av_img_height'] = 100;
$TBDEV['av_img_width'] = 100;
$TBDEV['allowed_ext'] = array('image/gif''image/png''image/jpeg');
// Set this to the line break character sequence of your system
//$TBDEV['linebreak'] = "\r\n"; // not used at present.

define ('UC_USER'0);
define ('UC_POWER_USER'1);
define ('UC_VIP'2);
define ('UC_UPLOADER'3);
define ('UC_MODERATOR'4);
define ('UC_ADMINISTRATOR'5);
define ('UC_SYSOP'6);

//Do not modify -- versioning system
//This will help identify code for support issues at tbdev.net
define ('TBVERSION','TBDev_2009_svn');

?>

Last edited by usbiz; 18th June 2010 at 09:55.
Reply With Quote
  #2  
Old 17th June 2010, 22:44
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Red face
Quote:
Originally Posted by usbiz View Post
i have install the script but when upload an torrent it show

Code:
Upload failed!
invalid announce url! must be http://03530.com/announce.php
how can i fix it ?
it would help if we know what code u got
Reply With Quote
  #3  
Old 18th June 2010, 00:33
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
Upload a torrent with the proper announce url
check to make sure you set your announce url in configs
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #4  
Old 18th June 2010, 09:57
usbiz usbiz is offline
Member
 
Join Date: Jun 2010
P2P
Posts: 12
Default
this is the code plz check for me
thanks very much

announce.php
PHP Code:
<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2009 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
error_reporting(0);
////////////////// GLOBAL VARIABLES ////////////////////////////   
$TBDEV['baseurl'] = 'http://03530.com/';
$TBDEV['announce_interval'] = 60 30;
$TBDEV['user_ratios'] = 0;
$TBDEV['connectable_check'] = 0;
define ('UC_VIP'2);
// DB setup
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "t";
$TBDEV['mysql_pass'] = "t";
$TBDEV['mysql_db']   = "t";
////////////////// GLOBAL VARIABLES ////////////////////////////
// DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU'RE DOING!!
$agent $_SERVER["HTTP_USER_AGENT"];
// Deny access made with a browser...
if (
    
ereg("^Mozilla\\/"$agent) ||
    
ereg("^Opera\\/"$agent) ||
    
ereg("^Links "$agent) ||
    
ereg("^Lynx\\/"$agent) ||
    isset(
$_SERVER['HTTP_COOKIE']) ||
    isset(
$_SERVER['HTTP_ACCEPT_LANGUAGE']) ||
    isset(
$_SERVER['HTTP_ACCEPT_CHARSET'])
    )
    
err("torrent not registered with this tracker CODE 1");
/////////////////////// 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($msg)
{
    
benc_resp(array('failure reason' => array('type' => 'string''value' => $msg)));
   
    exit();
}
function 
benc_resp($d)
{
    
benc_resp_raw(benc(array('type' => 'dictionary''value' => $d)));
}
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$x9FORCE_GZIP );
    }
    else
        echo 
$x ;
}
function 
benc($obj) {
    if (!
is_array($obj) || !isset($obj["type"]) || !isset($obj["value"]))
        return;
    
$c $obj["value"];
    switch (
$obj["type"]) {
        case 
"string":
            return 
benc_str($c);
        case 
"integer":
            return 
benc_int($c);
        case 
"list":
            return 
benc_list($c);
        case 
"dictionary":
            return 
benc_dict($c);
        default:
            return;
    }
}
function 
benc_str($s) {
    return 
strlen($s) . ":$s";
}
function 
benc_int($i) {
    return 
"i" $i "e";
}
function 
benc_list($a) {
    
$s "l";
    foreach (
$a as $e) {
        
$s .= benc($e);
    }
    
$s .= "e";
    return 
$s;
}
function 
benc_dict($d) {
    
$s "d";
    
$keys array_keys($d);
    
sort($keys);
    foreach (
$keys as $k) {
        
$v $d[$k];
        
$s .= benc_str($k);
        
$s .= benc($v);
    }
    
$s .= "e";
    return 
$s;
}
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();
$pattern '[0-9a-fA-F]{32}';
if( !isset(
$_GET['passkey']) OR !ereg($pattern$_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] = $_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]) != 20err("Invalid $x (" strlen($GLOBALS[$x]) . " - " urlencode($GLOBALS[$x]) . ")");
unset(
$x);
$info_hash bin2hex($info_hash);
$ip $_SERVER['REMOTE_ADDR'];
$port $port;
$downloaded $downloaded;
$uploaded $uploaded;
$left $left;
$rsize 50;
foreach(array(
"num want""numwant""num_want") as $k)
{
    if (isset(
$_GET[$k]))
    {
        
$rsize $_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) != )
 
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, ip, port, uploaded, downloaded, userid";
$numpeers $torrent["numpeers"];
$limit "";
if (
$numpeers $rsize)
    
$limit "ORDER BY RAND() LIMIT $rsize";
$res mysql_query("SELECT $fields FROM peers WHERE torrent = $torrentid AND connectable = 'yes' $limit");
//////////////////// START NEW COMPACT MODE/////////////////////////////
if($_GET['compact'] != 1)
{
$resp "d" benc_str("interval") . "i" $TBDEV['announce_interval'] . "e" benc_str("peers") . "l";
}
else
{
$resp "d" benc_str("interval") . "i" $TBDEV['announce_interval'] ."e" benc_str("min interval") . "i" 300 ."e5:"."peers" ;
}
$peer = array();
$peer_num 0;
while (
$row mysql_fetch_assoc($res))
{
    if(
$_GET['compact'] != 1)
{
 
$row["peer_id"] = str_pad($row["peer_id"], 20);
 
if (
$row["peer_id"] === $peer_id)
{
 
$self $row;
 continue;
}
 
$resp .= "d" .
 
benc_str("ip") . benc_str($row["ip"]);
       if (!
$_GET['no_peer_id']) {
  
$resp .= benc_str("peer id") . benc_str($row["peer_id"]);
 }
 
$resp .= benc_str("port") . "i" $row["port"] . "e" .
 
"e";
      }
      else
      {
         
$peer_ip explode('.'$row["ip"]);
$peer_ip pack("C*"$peer_ip[0], $peer_ip[1], $peer_ip[2], $peer_ip[3]);
$peer_port pack("n*", (int)$row["port"]);
$time intval((time() % 7680) / 60);
if(
$_GET['left'] == 0)
{
$time += 128;
}
$time pack("C"$time);
 
   
$peer[] = $time $peer_ip $peer_port;
$peer_num++;

      }
}
 
if (
$_GET['compact']!=1)
$resp .= "ee";
else
{
$o "";
for(
$i=0;$i<$peer_num;$i++)
 {
  
$o .= substr($peer[$i], 16);
 }
$resp .= strlen($o) . ':' $o '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] >= && $seeder == 'no'err("Connection limit exceeded! You may only leech from one location at a time.");
if (
$valid[0] >= && $seeder == 'yes'err("Connection limit exceeded!");

    if (
$left && $user['class'] < UC_VIP && $TBDEV['user_ratios'])
    {
        
$gigs $user["uploaded"] / (1024*1024*1024);
        
$elapsed floor((time() - $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 || $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))
    {
        
mysql_query("UPDATE peers SET uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = ".time().", seeder = '$seeder'"
            
. ($seeder == "yes" && $self["seeder"] != $seeder ", finishedat = " time() : "") . " 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$errstr5);
            if (!
$sockres)
                
$connectable "no";
            else
            {
                
$connectable "yes";
                @
fclose($sockres);
            }
        }
        else
        {
      
$connectable 'yes';
        }
        
$ret mysql_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, passkey) VALUES ('$connectable', $torrentid, " sqlesc($peer_id) . ", " sqlesc($ip) . ", $port$uploaded$downloaded$left, ".time().", ".time().", '$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();
}
if (
count($updateset))
    
mysql_query("UPDATE torrents SET " join(","$updateset) . " WHERE id = $torrentid");
benc_resp_raw($resp);
 
?>

config.php
PHP Code:
<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2009 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
error_reporting(E_ALL);
define('SQL_DEBUG'2);
/* Compare php version for date/time stuff etc! */
    
if (version_compare(PHP_VERSION"5.1.0RC1"">="))
        
date_default_timezone_set('Europe/London');

define('TIME_NOW'time());
$TBDEV['time_adjust'] =  0;
$TBDEV['time_offset'] = '0';
$TBDEV['time_use_relative'] = 1;
$TBDEV['time_use_relative_format'] = '{--}, h:i A';
$TBDEV['time_joined'] = 'j-F y';
$TBDEV['time_short'] = 'jS F Y - h:i A';
$TBDEV['time_long'] = 'M j Y, h:i A';
$TBDEV['time_tiny'] = '';
$TBDEV['time_date'] = '';

// DB setup
// FYNNON FUCKWIT FRENCH RETARD
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "t";
$TBDEV['mysql_pass'] = "t";
$TBDEV['mysql_db']   = "t";
// 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']  = '.03530.com'// set to eg: .somedomain.com or is subdomain set to: .sub.somedomain.com
                             
$TBDEV['site_online'] = 1;
$TBDEV['tracker_post_key'] = 'changethisorelse';
$TBDEV['max_torrent_size'] = 1000000;
$TBDEV['announce_interval'] = 60 30;
$TBDEV['signup_timeout'] = 86400 3;
$TBDEV['minvotes'] = 1;
$TBDEV['max_dead_torrent_time'] = 3600;
// Max users on site
$TBDEV['maxusers'] = 5000// LoL Who we kiddin' here?

if ( strtouppersubstr(PHP_OS03) ) == 'WIN' )
  {
    
$file_path str_replace"\\""/"dirname(__FILE__) );
    
$file_path str_replace"/include"""$file_path );
  }
  else
  {
    
$file_path dirname(__FILE__);
    
$file_path str_replace"/include"""$file_path );
  }
 
define('ROOT_PATH'$file_path);
$TBDEV['torrent_dir'] = ROOT_PATH '/torrents'# must be writable for httpd user  
# the first one will be displayed on the pages
$TBDEV['announce_urls'] = array();
$TBDEV['announce_urls'][] = "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";
if ($_SERVER["HTTP_HOST"] == "")
  
$_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];
 
$TBDEV['baseurl'] = "http://" $_SERVER["HTTP_HOST"]."/TB_ALPHA";
/*
## DO NOT UNCOMMENT THIS: IT'S FOR LATER USE!
$host = getenv( 'SERVER_NAME' );
$script = getenv( 'SCRIPT_NAME' );
$script = str_replace( "\\", "/", $script );
  if( $host AND $script )
  {
    $script = str_replace( '/index.php', '', $script );
    $TBDEV['baseurl'] = "http://{$host}{$script}";
  }
*/
//set this to true to make this a tracker that only registered users may use
//$TBDEV['membersonly'] = 1; //deprecated no longer needed
//maximum number of peers (seeders+leechers) allowed before torrents starts to be deleted to make room...
//set this to something high if you don't require this feature
//$TBDEV['peerlimit'] = 50000; //deprecated. no longer used.
// Email for sender/return path.
$TBDEV['site_email'] = "coldfusion@localhost";
$TBDEV['site_name'] = "Torrent Site";
$TBDEV['language'] = 'en';
$TBDEV['msg_alert'] = 0// saves a query when off
$TBDEV['autoclean_interval'] = 900;
$TBDEV['sql_error_log'] = ROOT_PATH.'/logs/sql_err_'.date("M_D_Y").'.log';
$TBDEV['pic_base_url'] = "./pic/";
$TBDEV['stylesheet'] = "./1.css";
$TBDEV['readpost_expiry'] = 14*86400// 14 days
//set this to size of user avatars
$TBDEV['av_img_height'] = 100;
$TBDEV['av_img_width'] = 100;
$TBDEV['allowed_ext'] = array('image/gif''image/png''image/jpeg');
// Set this to the line break character sequence of your system
//$TBDEV['linebreak'] = "\r\n"; // not used at present.
define ('UC_USER'0);
define ('UC_POWER_USER'1);
define ('UC_VIP'2);
define ('UC_UPLOADER'3);
define ('UC_MODERATOR'4);
define ('UC_ADMINISTRATOR'5);
define ('UC_SYSOP'6);
//Do not modify -- versioning system
//This will help identify code for support issues at tbdev.net
define ('TBVERSION','TBDev_2009_svn');
?>
Reply With Quote
  #5  
Old 18th June 2010, 11:21
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Smile
Quote:
Originally Posted by usbiz View Post
this is the code plz check for me
thanks very much
PHP Code:
$TBDEV['announce_urls'][] = "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";
if ($_SERVER["HTTP_HOST"] == ""
you must put your tracker there and set it something like http:/yoursite.com.announce.php
ive used this code and very easy to use and set up
Reply With Quote
  #6  
Old 18th June 2010, 11:27
usbiz usbiz is offline
Member
 
Join Date: Jun 2010
P2P
Posts: 12
Default
Quote:
Originally Posted by falcon View Post
PHP Code:
$TBDEV['announce_urls'][] =  "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";
if ($_SERVER["HTTP_HOST"] == ""
you must put your tracker there and set it something like http:/yoursite.com.announce.php
ive used this code and very easy to use and set up
thanks for your reply
can you tell me how to fix it ?
Reply With Quote
  #7  
Old 18th June 2010, 12:23
raefor's Avatar
raefor raefor is offline
Senior Member
 
Join Date: Mar 2008
United States
Posts: 90
Default
announce.php

PHP Code:
<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2009 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
error_reporting(0);
////////////////// GLOBAL VARIABLES ////////////////////////////    
$TBDEV['baseurl'] = 'http://03530.com';
$TBDEV['announce_interval'] = 60 30;
define ('UC_USER'0);
define ('UC_POWER_USER'1);
define ('UC_VIP'2);
define ('UC_UPLOADER'3);
define ('UC_MODERATOR'4);
define ('UC_ADMINISTRATOR'5);
define ('UC_SYSOP'6);
// DB setup
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "t";
$TBDEV['mysql_pass'] = "t";
$TBDEV['mysql_db']   = "t";
////////////////// GLOBAL VARIABLES ////////////////////////////
// DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU'RE DOING!!
$agent $_SERVER["HTTP_USER_AGENT"];
// Deny access made with a browser...
if (
    
ereg("^Mozilla\\/"$agent) || 
    
ereg("^Opera\\/"$agent) || 
    
ereg("^Links "$agent) || 
    
ereg("^Lynx\\/"$agent) || 
    isset(
$_SERVER['HTTP_COOKIE']) || 
    isset(
$_SERVER['HTTP_ACCEPT_LANGUAGE']) || 
    isset(
$_SERVER['HTTP_ACCEPT_CHARSET'])
    )
    
err("torrent not registered with this tracker CODE 1");
/////////////////////// 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($msg)
{
    
benc_resp(array('failure reason' => array('type' => 'string''value' => $msg)));
    
    exit();
}

function 
auto_enter_cheater($userid$rate$upthis$diff$torrentid$client$ip$last_up)
{
mysql_query("INSERT INTO cheaters (added, userid, client, rate, beforeup, upthis, timediff, userip, torrentid) VALUES(" sqlesc(time()) . ", " sqlesc($userid) . ", " sqlesc($client) . ", " sqlesc($rate) . ", " sqlesc($last_up) . ", " sqlesc($upthis) . ", " sqlesc($diff) . ", " sqlesc($ip) . ", " sqlesc($torrentid) . ")") or sqlerr(__FILE____LINE__);
}

function 
benc_resp($d)
{
    
benc_resp_raw(benc(array('type' => 'dictionary''value' => $d)));
}

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$x9FORCE_GZIP );
    }
    else
        echo 
$x ;
}

function 
benc($obj) {
    if (!
is_array($obj) || !isset($obj["type"]) || !isset($obj["value"]))
        return;
    
$c $obj["value"];
    switch (
$obj["type"]) {
        case 
"string":
            return 
benc_str($c);
        case 
"integer":
            return 
benc_int($c);
        case 
"list":
            return 
benc_list($c);
        case 
"dictionary":
            return 
benc_dict($c);
        default:
            return;
    }
}

function 
benc_str($s) {
    return 
strlen($s) . ":$s";
}

function 
benc_int($i) {
    return 
"i" $i "e";
}

function 
benc_list($a) {
    
$s "l";
    foreach (
$a as $e) {
        
$s .= benc($e);
    }
    
$s .= "e";
    return 
$s;
}

function 
benc_dict($d) {
    
$s "d";
    
$keys array_keys($d);
    
sort($keys);
    foreach (
$keys as $k) {
        
$v $d[$k];
        
$s .= benc_str($k);
        
$s .= benc($v);
    }
    
$s .= "e";
    return 
$s;
}

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)
{
    
//=== new portblacklisted ....... ==> direct connect 411 ot 413,  bittorrent 6881 to 6889, kazaa 1214, gnutella 6346 to 6347, emule 4662, winmx 6699, IRC bot based trojans 65535
    
$portblacklisted = array(4114124136881 ,68826883688468856886688768891214634663474662669965535);
        if (
in_array($port$portblacklisted)) return true;

    return 
false;
}

/////////////////////// FUNCTION DEFS END ///////////////////////////////

$parts = array();
$pattern '[0-9a-fA-F]{32}';
if( !isset(
$_GET['passkey']) OR !ereg($pattern$_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] = $_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]) != 20err("Invalid $x (" strlen($GLOBALS[$x]) . " - " urlencode($GLOBALS[$x]) . ")");

unset(
$x);



$ip $_SERVER['REMOTE_ADDR'];

$port $port;
$downloaded $downloaded;
$uploaded $uploaded;
$left $left;

$rsize 50;
foreach(array(
"num want""numwant""num_want") as $k)
{
    if (isset(
$_GET[$k]))
    {
        
$rsize $_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, downloadpos, parked, free_switch, highspeed, enabled FROM users WHERE passkey=".sqlesc($passkey)) or err("Tracker error 2");

if ( 
mysql_num_rows($user_query) != )

 
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 torrents.id, torrents.banned, torrents.free, torrents.seeders + torrents.leechers AS numpeers, torrents.added AS ts, freeslots.free AS freeslot, freeslots.double AS doubleslot FROM torrents LEFT JOIN freeslots ON (torrents.id=freeslots.tid AND freeslots.uid=".sqlesc($user['id']).") 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, ip, port, uploaded, downloaded, userid, ('.time().' - last_action) AS announcetime, last_action AS ts';

$numpeers $torrent["numpeers"];
$limit "";
if (
$numpeers $rsize)
    
$limit "ORDER BY RAND() LIMIT $rsize";
$res mysql_query("SELECT $fields FROM peers WHERE torrent = $torrentid AND connectable = 'yes' $limit");

//////////////////// START NEW COMPACT MODE/////////////////////////////
if($_GET['compact'] != 1)
{
$resp "d" benc_str("interval") . "i" $TBDEV['announce_interval'] . "e" benc_str("private") . 'i1e' benc_str("peers") . "l";
}
else
{
$resp "d" benc_str("interval") . "i" $TBDEV['announce_interval'] ."e" benc_str("private") . 'i1e'benc_str("min interval") . "i" 300 ."e5:"."peers" ;
}

$peer = array();
$peer_num 0;
while (
$row mysql_fetch_assoc($res))
{
if(
$_GET['compact'] != 1)
{
$row["peer_id"] = str_pad($row["peer_id"], 20);
if (
$row["peer_id"] === $peer_id)
{
$self $row;
continue;
}

$resp .= "d" .
benc_str("ip") . benc_str($row["ip"]);
if (!
$_GET['no_peer_id']) {
$resp .= benc_str("peer id") . benc_str($row["peer_id"]);
}
$resp .= benc_str("port") . "i" $row["port"] . "e" "e";
}
else
{
$peer_ip explode('.'$row["ip"]);
$peer_ip pack("C*"$peer_ip[0], $peer_ip[1], $peer_ip[2], $peer_ip[3]);
$peer_port pack("n*", (int)$row["port"]);
$time intval((time() % 7680) / 60);
if(
$_GET['left'] == 0)
{
$time += 128;
}
$time pack("C"$time);
$peer[] = $time $peer_ip $peer_port;
$peer_num++;
}
}
if (
$_GET['compact']!=1)
$resp .= "ee";
else
{
$o "";
for(
$i=0;$i<$peer_num;$i++)
{
$o .= substr($peer[$i], 16);
}
$resp .= strlen($o) . ':' $o '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] >= && $seeder == 'no'err("Connection limit exceeded! You may only leech from one location at a time.");

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


    if (
$left && $user['class'] < UC_VIP)
    {
        
$gigs $user["uploaded"] / (1024*1024*1024);
        
$elapsed floor((time() - $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"]);
  
$upspeed = ($upthis $upthis $self["announcetime"] : 0);
  
$downspeed = ($downthis $downthis $self["announcetime"] : 0);
  
$announcetime = ($self["seeder"] == "yes" "seedtime = seedtime + $self[announcetime]"leechtime = leechtime + $self[announcetime]");
  
   
//==freeleech/doubleupload system by ezero - recoded block by putyn
   
$q mysql_query("SELECT * FROM events ORDER BY startTime DESC LIMIT 1") or print (mysql_error());
     
$a mysql_fetch_assoc($q);
     if(
$a["startTime"] < time() && $a["endTime"] >time())
     {
     if(
$a['freeleechEnabled'] == 1)
     
$downthis 0;
     if(
$a['duploadEnabled'] == 1){
     
$upthis *=2;
     
$downthis 0;
     }
     if(
$a['hdownEnabled'] == 1){
     
$downthis $downthis 2;
     }
     }
  
  if (
$upthis || $downthis 0)
  {
  
/** free addon start **/
  
$isfree =   '';
  
$isdouble '';
  include(
"cache/free_cache.php");
  if (isset(
$free))
  {
  foreach (
$free as $fl) {
  
$isfree =   ($fl['modifier'] == || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
  
$isdouble = ($fl['modifier'] == || $fl['modifier'] == 3) && $fl['expires'] > TIME_NOW;
  }
  }
  if (!(
$user['free_switch'] != || $isfree || $torrent['free'] != || ($torrent['freeslot'] != 0)
  ))
  
$updq[0] = "downloaded = downloaded + $downthis";
  
$updq[1] = "uploaded = uploaded + ".(($torrent['doubleslot'] != || $isdouble) ? ($upthis*2) : $upthis);
  
$udq=implode(',',$updq);
  
mysql_query("UPDATE users SET $udq WHERE id=".$user['id']) or err('Tracker error 3');
  }
      
//=== abnormal upload detection
            
if ($user['highspeed'] == 'no' && $upthis 103872
            {
      
//=== Work out difference
      
$diff = (time() - $self['ts']);
      
$rate = ($upthis / ($diff 1));
      
$last_up $user['uploaded'];
      
//=== about 1 MB/s
      
if ($rate 103872
      {
          
auto_enter_cheater($user['id'], $rate$upthis$diff$torrentid$agent$ip$last_up );
      }
            } 
//=== end abnormal upload detection
      
}
      
  
///////////////////////////////////////////////////////////////////////////////
        
if (portblacklisted($port))
            
err('Port is blacklisted.');
        else
        {
            
$sockres = @fsockopen($ip$port$errno$errstr5);
            if (!
$sockres)
                
$connectable 'no';
            else
            {
                
$connectable 'yes';
                @
fclose($sockres);
            }
        }

 
$updateset = array();

 if (isset(
$self) && $event == "stopped") {
 
mysql_query("DELETE FROM peers WHERE $selfwhere") or err("D Err");
 
 
//===09 sir_snuggles hit and run
 
$res_snatch mysql_query("SELECT seedtime, uploaded, downloaded, finished, start_date AS start_snatch FROM snatched WHERE torrentid = $torrentid AND userid = $userid") or err('Snatch Error 1');
 
$a mysql_fetch_array($res_snatch);
 
//=== only run the function if the ratio is below 1
 
if( ($a['uploaded'] + $upthis) < ($a['downloaded'] + $downthis) && $a['finished'] == 'yes')
 {
 
$HnR_time_seeded = ($a['seedtime'] + $self['announcetime']);
 
//=== get times per class
 
switch (true)
 { 
 
//=== user
 
case ($user['class'] < UC_POWER_USER):
 
$days_3 3*86400//== 3 days
 
$days_14 2*86400//== 2 days
 
$days_over_14 86400//== 1 day
 
break;
 
//=== poweruser
 
case ($user['class'] == UC_POWER_USER):
 
$days_3 2*86400//== 2 days
 
$days_14 129600//== 36 hours
 
$days_over_14 64800//== 18 hours
 
break;
 
//=== vip / donor?
 
case ($user['class'] == UC_VIP):
 
$days_3 129600//== 36 hours
 
$days_14 86400//== 24 hours
 
$days_over_14 43200//== 12 hours
 
break;
 
//=== uploader / staff and above (we don't need this for uploaders now do we?
 
case ($user['class'] >= UC_UPLOADER):
 
$days_3 86400//== 24 hours
 
$days_14 43200//== 12 hours
 
$days_over_14 21600//== 6 hours
 
break;
 }

 switch(
true
 {
 case ((
$a['start_snatch'] - $torrent['ts']) < 7*86400):
 
$minus_ratio = ($days_3 $HnR_time_seeded);
 break;
 case ((
$a['start_snatch'] - $torrent['ts']) < 21*86400):
 
$minus_ratio = ($days_14 $HnR_time_seeded);
 break;
 case ((
$a['start_snatch'] - $torrent['ts']) >= 21*86400):
 
$minus_ratio = ($days_over_14 $HnR_time_seeded);
 break;
 }
 
$hit_and_run = (($minus_ratio && ($a['uploaded'] + $upthis) < ($a['downloaded'] + $downthis)) ? ", seeder='no', hit_and_run= '".time()."'" ", hit_and_run = '0'");
 } 
//=== end if not 1:1 ratio
 
else
 
$hit_and_run ", hit_and_run = '0'";
 
//=== end hit and run
 
 
if (mysql_affected_rows()) {
 
$updateset[] = ($self["seeder"] == "yes" "seeders = seeders - 1" "leechers = leechers - 1");
 
mysql_query("UPDATE snatched SET ip = ".sqlesc($ip).", port = $port, connectable = '$connectable', uploaded = uploaded + $upthis, downloaded = downloaded + $downthis, to_go = $left, upspeed = $upspeed, downspeed = $downspeed$announcetime, last_action = ".time().", seeder = '$seeder', agent = ".sqlesc($agent).$hit_and_run WHERE torrentid = $torrentid AND userid = {$user['id']}") or err("SL Err 1");
 }
 } elseif (isset(
$self)) {

 if (
$event == "completed") {
 
$updateset[] = "times_completed = times_completed + 1";
 
$finished ", finishedat = ".time()."";
 
$finished1 ", complete_date = ".time().", finished = 'yes'";
 }

 
mysql_query("UPDATE peers SET ip = ".sqlesc($ip).", port = $port, connectable = '$connectable', uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = " time() . ", seeder = '$seeder', agent = ".sqlesc($agent).$finished WHERE $selfwhere") or err("PL Err 1");

 if (
mysql_affected_rows()) {
 if (
$seeder <> $self["seeder"])
 
$updateset[] = ($seeder == "yes" "seeders = seeders + 1, leechers = leechers - 1" "seeders = seeders - 1, leechers = leechers + 1");
 
$anntime "timesann = timesann + 1";
 
mysql_query("UPDATE snatched SET ip = ".sqlesc($ip).", port = $port, connectable = '$connectable', uploaded = uploaded + $upthis, downloaded = downloaded + $downthis, to_go = $left, upspeed = $upspeed, downspeed = $downspeed$announcetime, last_action = ".time().", seeder = '$seeder', agent = ".sqlesc($agent).$finished1$anntime WHERE torrentid = $torrentid AND userid = {$user['id']}") or err("SL Err 2");
 }
 } else {
 if (
$user["parked"] == "yes")
 
err("Your account is parked! (Read the FAQ)");
 elseif (
$user["downloadpos"] == OR $user["downloadpos"] > )
 
err("Your downloading priviledges have been disabled! (Read the rules)");

 
mysql_query("INSERT INTO peers (torrent, userid, peer_id, ip, port, connectable, uploaded, downloaded, to_go, started, last_action, seeder, agent, downloadoffset, uploadoffset, passkey) VALUES ($torrentid{$user['id']}, ".sqlesc($peer_id).", ".sqlesc($ip).", $port, '$connectable', $uploaded$downloaded$left, ".time().", ".time().", '$seeder', ".sqlesc($agent).", $downloaded$uploaded, ".sqlesc($passkey).")") or err("PL Err 2");

 if (
mysql_affected_rows()) {
 
$updateset[] = ($seeder == "yes" "seeders = seeders + 1" "leechers = leechers + 1");
 
$anntime "timesann = timesann + 1";
 
mysql_query("UPDATE snatched SET ip = ".sqlesc($ip).", port = $port, connectable = '$connectable', to_go = $left, last_action = ".time().", seeder = '$seeder', agent = ".sqlesc($agent).", $anntime, hit_and_run = '0', mark_of_cain = 'no' WHERE torrentid = $torrentid AND userid = {$user['id']}") or err("SL Err 3");

 if (!
mysql_affected_rows() && $seeder == "no")
 
mysql_query("INSERT INTO snatched (torrentid, userid, peer_id, ip, port, connectable, uploaded, downloaded, to_go, start_date, last_action, seeder, agent) VALUES ($torrentid{$user['id']}, ".sqlesc($peer_id).", ".sqlesc($ip).", $port, '$connectable', $uploaded$downloaded$left, ".time().", ".time().", '$seeder', ".sqlesc($agent).")") or err("SL Err 4");
 }
 }

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

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

benc_resp_raw($resp);
?>
config.php

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

define('SQL_DEBUG'2);

/* Compare php version for date/time stuff etc! */
    
if (version_compare(PHP_VERSION"5.1.0RC1"">="))
        
date_default_timezone_set('Europe/London');


define('TIME_NOW'time());

$TBDEV['time_adjust'] =  0;
$TBDEV['time_offset'] = '0'
$TBDEV['time_use_relative'] = 1;
$TBDEV['time_use_relative_format'] = '{--}, h:i A';
$TBDEV['time_joined'] = 'j-F y';
$TBDEV['time_short'] = 'jS F Y - h:i A';
$TBDEV['time_long'] = 'M j Y, h:i A';
$TBDEV['time_tiny'] = '';
$TBDEV['time_date'] = '';


// DB setup
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "t";
$TBDEV['mysql_pass'] = "t";
$TBDEV['mysql_db']   = "t";

// Cookie setup
$TBDEV['cookie_prefix']  = ''// 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                      
$TBDEV['site_online'] = 1;
$TBDEV['tracker_post_key'] = 'changethisorelse';
$TBDEV['max_torrent_size'] = 1000000;
$TBDEV['announce_interval'] = 60 30;
$TBDEV['signup_timeout'] = 86400 3;
$TBDEV['minvotes'] = 1;
$TBDEV['max_dead_torrent_time'] = 3600;
$TBDEV['language'] = 'en';
// Max users on site
$TBDEV['maxusers'] = 5000// LoL Who we kiddin' here?
$TBDEV['invites'] = 3500// LoL Who we kiddin' here?
$TBDEV['openreg'] = true//==true=open, false = closed
$TBDEV['failedlogins'] = 5// Maximum failed logins before ip ban
/*
if ( strtoupper( substr(PHP_OS, 0, 3) ) == 'WIN' )
  {
    $file_path = str_replace( "\\", "/", dirname(__FILE__) );
    $file_path = str_replace( "/include", "", $file_path );
  }
  else
  {
    $file_path = dirname(__FILE__);
    $file_path = str_replace( "/include", "", $file_path );
  }
  
define('ROOT_PATH', $file_path);
*/
/** define dirs **/
define('INCL_DIR'dirname(__FILE__).DIRECTORY_SEPARATOR);
define('ROOT_DIR'realpath(INCL_DIR.'..'.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR);
define('ADMIN_DIR'ROOT_DIR.'admin'.DIRECTORY_SEPARATOR);
define('FORUM_DIR'ROOT_DIR.'forums'.DIRECTORY_SEPARATOR);
define('CACHE_DIR'ROOT_DIR.'cache'.DIRECTORY_SEPARATOR);
define('MODS_DIR'ROOT_DIR.'mods'.DIRECTORY_SEPARATOR);
define('LANG_DIR'ROOT_DIR.'lang'.DIRECTORY_SEPARATOR.$TBDEV['language'].DIRECTORY_SEPARATOR);  
define('TEMPLATE_DIR'ROOT_DIR.'templates'.DIRECTORY_SEPARATOR);

$TBDEV['dictbreaker'] = ROOT_DIR.'dictbreaker';
$TBDEV['torrent_dir'] = ROOT_DIR.'torrents'# must be writable for httpd user   
$TBDEV['bucket_dir'] = ROOT_DIR .'/bitbucket'# must be writable for httpd user  
# the first one will be displayed on the pages
$TBDEV['announce_urls'] = array();
$TBDEV['announce_urls'][] = "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";

if ($_SERVER["HTTP_HOST"] == "")
  
$_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];
  
$TBDEV['baseurl'] = "http://" $_SERVER["HTTP_HOST"]."";

/*
## DO NOT UNCOMMENT THIS: IT'S FOR LATER USE!
$host = getenv( 'SERVER_NAME' );
$script = getenv( 'SCRIPT_NAME' );
$script = str_replace( "\\", "/", $script );

  if( $host AND $script )
  {
    $script = str_replace( '/index.php', '', $script );

    $TBDEV['baseurl'] = "http://{$host}{$script}";
  }
*/

// Email for sender/return path.
$TBDEV['site_email'] = "coldfusion@03530.com";
$TBDEV['site_name'] = "03530.com";

$TBDEV['language'] = 'en';
$TBDEV['msg_alert'] = 1// saves a query when off

$TBDEV['autoclean_interval'] = 900;
$TBDEV['sql_error_log'] = ROOT_DIR.'logs'.DIRECTORY_SEPARATOR.'sql_err_'.date('M_D_Y').'.log';
$TBDEV['pic_base_url'] = "./pic/";
//$TBDEV['stylesheet'] = "./1.css";
$TBDEV['stylesheet'] = "1";
$TBDEV['readpost_expiry'] = 14*86400// 14 days
//set this to size of user avatars
$TBDEV['av_img_height'] = 100;
$TBDEV['av_img_width'] = 100;
//set this to size of user signatures
$TBDEV['sig_img_height'] = 100;
$TBDEV['sig_img_width'] = 500;
$TBDEV['bucket_dir'] = ROOT_DIR '/bitbucket'# must be writable for httpd user  
$TBDEV['allowed_ext'] = array('image/gif''image/png''image/jpeg');
$TBDEV['bucket_maxsize'] = 500*1024#max size set to 500kb
//last 24 users online
$TBDEV['last24cache'] = CACHE_DIR.'last24/'.date('dmy').'.txt';
$TBDEV['last24record'] = CACHE_DIR.'last24record.txt';
// Set this to the line break character sequence of your system
//$TBDEV['linebreak'] = "\r\n"; // not used at present.

define ('UC_USER'0);
define ('UC_POWER_USER'1);
define ('UC_VIP'2);
define ('UC_UPLOADER'3);
define ('UC_MODERATOR'4);
define ('UC_ADMINISTRATOR'5);
define ('UC_SYSOP'6);

//Do not modify -- versioning system
//This will help identify code for support issues at tbdev.net
define ('TBVERSION','TBDev_2009_svn');

?>
you can try them:unknown:
Reply With Quote
  #8  
Old 18th June 2010, 18:02
usbiz usbiz is offline
Member
 
Join Date: Jun 2010
P2P
Posts: 12
Default
i edit

PHP Code:
# the first one will be displayed on the pages
$TBDEV['announce_urls'] = array();
$TBDEV['announce_urls'][] = "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://03530.com:2710/announce";
//$TBDEV['announce_urls'] = "http://03530.com:83/announce.php"; 
but it still show

Code:
Upload failed!
 
invalid announce url! must be http://03530.com/announce.php
use the filesweb shows

Code:
Notice: Use of undefined constant ROOT_PATH - assumed 'ROOT_PATH' in /home/tt/public_html/include/bittorrent.php on line 916

Code:
SYSTEM ERROR
 
Can't find language files
Reply With Quote
  #9  
Old 18th June 2010, 18:25
raefor's Avatar
raefor raefor is offline
Senior Member
 
Join Date: Mar 2008
United States
Posts: 90
Default sorry wrong config.php
PHP Code:
<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2009 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
error_reporting(E_ALL);

define('SQL_DEBUG'2);

/* Compare php version for date/time stuff etc! */
    
if (version_compare(PHP_VERSION"5.1.0RC1"">="))
        
date_default_timezone_set('Europe/London');


define('TIME_NOW'time());

$TBDEV['time_adjust'] =  0;
$TBDEV['time_offset'] = '0'
$TBDEV['time_use_relative'] = 1;
$TBDEV['time_use_relative_format'] = '{--}, h:i A';
$TBDEV['time_joined'] = 'j-F y';
$TBDEV['time_short'] = 'jS F Y - h:i A';
$TBDEV['time_long'] = 'M j Y, h:i A';
$TBDEV['time_tiny'] = '';
$TBDEV['time_date'] = '';


// DB setup
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "root";
$TBDEV['mysql_pass'] = "blank";
$TBDEV['mysql_db']   = "tb";

// Cookie setup
$TBDEV['cookie_prefix']  = ''// 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
                              
$TBDEV['site_online'] = 1;
$TBDEV['tracker_post_key'] = 'changethisorelse';
$TBDEV['max_torrent_size'] = 1000000;
$TBDEV['announce_interval'] = 60 30;
$TBDEV['signup_timeout'] = 86400 3;
$TBDEV['minvotes'] = 1;
$TBDEV['max_dead_torrent_time'] = 3600;

// Max users on site
$TBDEV['maxusers'] = 5000// LoL Who we kiddin' here?


if ( strtouppersubstr(PHP_OS03) ) == 'WIN' )
  {
    
$file_path str_replace"\\""/"dirname(__FILE__) );
    
$file_path str_replace"/include"""$file_path );
  }
  else
  {
    
$file_path dirname(__FILE__);
    
$file_path str_replace"/include"""$file_path );
  }
  
define('ROOT_PATH'$file_path);
$TBDEV['torrent_dir'] = ROOT_PATH '/torrents'# must be writable for httpd user   

# the first one will be displayed on the pages
$TBDEV['announce_urls'] = array();
$TBDEV['announce_urls'][] = "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";

if ($_SERVER["HTTP_HOST"] == "")
  
$_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];
  
$TBDEV['baseurl'] = "http://" $_SERVER["HTTP_HOST"]."";

/*
## DO NOT UNCOMMENT THIS: IT'S FOR LATER USE!
$host = getenv( 'SERVER_NAME' );
$script = getenv( 'SCRIPT_NAME' );
$script = str_replace( "\\", "/", $script );

  if( $host AND $script )
  {
    $script = str_replace( '/index.php', '', $script );

    $TBDEV['baseurl'] = "http://{$host}{$script}";
  }
*/

//set this to true to make this a tracker that only registered users may use
//$TBDEV['membersonly'] = 1; //deprecated no longer needed

//maximum number of peers (seeders+leechers) allowed before torrents starts to be deleted to make room...
//set this to something high if you don't require this feature
//$TBDEV['peerlimit'] = 50000; //deprecated. no longer used.

// Email for sender/return path.
$TBDEV['site_email'] = "coldfusion@03530.comt";

$TBDEV['site_name'] = "TBDEV.NET";

$TBDEV['language'] = 'en';
$TBDEV['msg_alert'] = 0// saves a query when off

$TBDEV['autoclean_interval'] = 900;
$TBDEV['sql_error_log'] = ROOT_PATH.'/logs/sql_err_'.date("M_D_Y").'.log';
$TBDEV['pic_base_url'] = "./pic/";
$TBDEV['stylesheet'] = "./1.css";
$TBDEV['readpost_expiry'] = 14*86400// 14 days
//set this to size of user avatars
$TBDEV['av_img_height'] = 100;
$TBDEV['av_img_width'] = 100;
$TBDEV['allowed_ext'] = array('image/gif''image/png''image/jpeg');
// Set this to the line break character sequence of your system
//$TBDEV['linebreak'] = "\r\n"; // not used at present.

define ('UC_USER'0);
define ('UC_POWER_USER'1);
define ('UC_VIP'2);
define ('UC_UPLOADER'3);
define ('UC_MODERATOR'4);
define ('UC_ADMINISTRATOR'5);
define ('UC_SYSOP'6);

//Do not modify -- versioning system
//This will help identify code for support issues at tbdev.net
define ('TBVERSION','TBDev_2009_svn');

?>
Reply With Quote
  #10  
Old 20th June 2010, 14:51
usbiz usbiz is offline
Member
 
Join Date: Jun 2010
P2P
Posts: 12
Default
really thanks for your reply

i have edite the file but it is still show

invalid announce url! must be http://03530.com/announce.php

i do not know why



Quote:
Originally Posted by raefor View Post
PHP Code:
<?php
/*
+------------------------------------------------
|   TBDev.net BitTorrent Tracker PHP
|   =============================================
|   by CoLdFuSiOn
|   (c) 2003 - 2009 TBDev.Net
|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
error_reporting(E_ALL);
 
define('SQL_DEBUG'2);
 
/* Compare php version for date/time stuff etc! */
    
if (version_compare(PHP_VERSION"5.1.0RC1"">="))
        
date_default_timezone_set('Europe/London');
 
 
define('TIME_NOW'time());
 
$TBDEV['time_adjust'] =  0;
$TBDEV['time_offset'] = '0'
$TBDEV['time_use_relative'] = 1;
$TBDEV['time_use_relative_format'] = '{--}, h:i A';
$TBDEV['time_joined'] = 'j-F y';
$TBDEV['time_short'] = 'jS F Y - h:i A';
$TBDEV['time_long'] = 'M j Y, h:i A';
$TBDEV['time_tiny'] = '';
$TBDEV['time_date'] = '';
 
 
// DB setup
$TBDEV['mysql_host'] = "localhost";
$TBDEV['mysql_user'] = "root";
$TBDEV['mysql_pass'] = "blank";
$TBDEV['mysql_db']   = "tb";
 
// Cookie setup
$TBDEV['cookie_prefix']  = ''// 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
 
$TBDEV['site_online'] = 1;
$TBDEV['tracker_post_key'] = 'changethisorelse';
$TBDEV['max_torrent_size'] = 1000000;
$TBDEV['announce_interval'] = 60 30;
$TBDEV['signup_timeout'] = 86400 3;
$TBDEV['minvotes'] = 1;
$TBDEV['max_dead_torrent_time'] = 3600;
 
// Max users on site
$TBDEV['maxusers'] = 5000// LoL Who we kiddin' here?
 
 
if ( strtouppersubstr(PHP_OS03) ) == 'WIN' )
  {
    
$file_path str_replace"\\""/"dirname(__FILE__) );
    
$file_path str_replace"/include"""$file_path );
  }
  else
  {
    
$file_path dirname(__FILE__);
    
$file_path str_replace"/include"""$file_path );
  }
 
define('ROOT_PATH'$file_path);
$TBDEV['torrent_dir'] = ROOT_PATH '/torrents'# must be writable for httpd user   
 
# the first one will be displayed on the pages
$TBDEV['announce_urls'] = array();
$TBDEV['announce_urls'][] = "http://03530.com/announce.php";
//$TBDEV['announce_urls'] = "http://localhost:2710/announce";
//$TBDEV['announce_urls'] = "http://domain.com:83/announce.php";
 
if ($_SERVER["HTTP_HOST"] == "")
  
$_SERVER["HTTP_HOST"] = $_SERVER["SERVER_NAME"];
 
$TBDEV['baseurl'] = "http://" $_SERVER["HTTP_HOST"]."";
 
/*
## DO NOT UNCOMMENT THIS: IT'S FOR LATER USE!
$host = getenv( 'SERVER_NAME' );
$script = getenv( 'SCRIPT_NAME' );
$script = str_replace( "\\", "/", $script );
 
  if( $host AND $script )
  {
    $script = str_replace( '/index.php', '', $script );
 
    $TBDEV['baseurl'] = "http://{$host}{$script}";
  }
*/
 
//set this to true to make this a tracker that only registered users may use
//$TBDEV['membersonly'] = 1; //deprecated no longer needed
 
//maximum number of peers (seeders+leechers) allowed before torrents starts to be deleted to make room...
//set this to something high if you don't require this feature
//$TBDEV['peerlimit'] = 50000; //deprecated. no longer used.
 
// Email for sender/return path.
$TBDEV['site_email'] = "coldfusion@03530.comt";
 
$TBDEV['site_name'] = "TBDEV.NET";
 
$TBDEV['language'] = 'en';
$TBDEV['msg_alert'] = 0// saves a query when off
 
$TBDEV['autoclean_interval'] = 900;
$TBDEV['sql_error_log'] = ROOT_PATH.'/logs/sql_err_'.date("M_D_Y").'.log';
$TBDEV['pic_base_url'] = "./pic/";
$TBDEV['stylesheet'] = "./1.css";
$TBDEV['readpost_expiry'] = 14*86400// 14 days
//set this to size of user avatars
$TBDEV['av_img_height'] = 100;
$TBDEV['av_img_width'] = 100;
$TBDEV['allowed_ext'] = array('image/gif''image/png''image/jpeg');
// Set this to the line break character sequence of your system
//$TBDEV['linebreak'] = "\r\n"; // not used at present.
 
define ('UC_USER'0);
define ('UC_POWER_USER'1);
define ('UC_VIP'2);
define ('UC_UPLOADER'3);
define ('UC_MODERATOR'4);
define ('UC_ADMINISTRATOR'5);
define ('UC_SYSOP'6);
 
//Do not modify -- versioning system
//This will help identify code for support issues at tbdev.net
define ('TBVERSION','TBDev_2009_svn');
 
?>
Reply With Quote
Reply

Tags
failed , upload


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload failed: eek ajax Community Cafe 2 21st June 2010 13:44
Upload Failed No NFO!!! HELP!! drosatos TBDev 1 24th February 2010 13:59
FTS sysadmin login failed after install bRum Free Torrent Source 0 23rd April 2009 16:08
signup failed borked error NatashaRhea Torrent Strike 2 13th August 2008 19:09



All times are GMT +2. The time now is 00:50. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.