Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #61  
Old 27th October 2011, 16:54
Eltan Eltan is offline
Senior Member
 
Join Date: Nov 2008
Canada
Posts: 60
Default
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 
Reply With Quote
The Following User Says Thank You to Eltan For This Useful Post:
roland22 (31st January 2015)
  #62  
Old 29th November 2011, 18:53
Banned Banned is offline
Member
 
Join Date: Nov 2010
P2P
Posts: 4
Default
Cen i inport my Db from TBDEV netmaniac to TBDev 2010 revision 464?
Reply With Quote
  #63  
Old 29th January 2012, 01:58
dj_otrov's Avatar
dj_otrov dj_otrov is offline
Senior Member
 
Join Date: Jan 2012
Bulgaria
Posts: 142
Angry :@
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

Last edited by dj_otrov; 29th January 2012 at 03:14.
Reply With Quote
  #64  
Old 29th January 2012, 14:10
shasta's Avatar
shasta shasta is offline
Senior Member
 
Join Date: Mar 2011
P2P
Posts: 46
Default
Quote:
Originally Posted by dj_otrov View Post
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 View Post
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

Reply With Quote
  #65  
Old 21st April 2012, 16:13
duongkimngoc duongkimngoc is offline
Member
 
Join Date: Apr 2012
P2P
Posts: 1
Default
Quote:
Originally Posted by Eltan View Post
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.

Last edited by duongkimngoc; 21st April 2012 at 17:54.
Reply With Quote
  #66  
Old 28th April 2012, 14:40
VodkAtekz VodkAtekz is offline
Member
 
Join Date: Apr 2012
P2P
Posts: 2
Default
Me, I've a error in index page go in http://www.bvlist.com/general/7870-i...010-tbdev.html for look my problems

Reply With Quote
  #67  
Old 30th May 2012, 01:51
dandanch dandanch is offline
Senior Member
 
Join Date: Mar 2012
United States
Posts: 17
Default 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.
Reply With Quote
  #68  
Old 30th May 2012, 11:39
firefly007's Avatar
firefly007 firefly007 is offline
SUPPORT GURU
 
Join Date: Jun 2010
P2P
Posts: 721
Default
Quote:
Originally Posted by duongkimngoc View Post
How to solve this problem?
I'm getting same error.
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 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><br />";
      
                    
    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&amp;mode=edit&amp;newsid={$array['id']}'>{$lang['news_edit']}</a>&nbsp;<a href='admin.php?action=news&amp;mode=delete&amp;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><br />\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><br />
    
      <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();
?>
__________________




Please Support Majority Report


You can contact me on Skype live:phesadent.elect but please let me know first.


If you are ever need me desperately then please email me at dan.oak44@gmail.com and I will contact u within a week.


Due to free time I'm able to help interested member's with their tracker.

Please Note!
Depending on your requests I will charge you for my assistance for Tracker installs and mods.
All my mods are custom and prices will very depending on the request.
I'm able to install any tracker and mods including themes.

Please PM me

Reply With Quote
  #69  
Old 27th June 2012, 11:56
Cataclismo Cataclismo is offline
Member
 
Join Date: Jun 2010
P2P
Posts: 1
Default
File chache_functions.php is missing from include ...
EDIT :
Here is a index.php 100% working :)
Hope you like it
Attached Files
File Type: zip index.zip (2.1 KB, 302 views)
Reply With Quote
The Following User Says Thank You to Cataclismo For This Useful Post:
roland22 (31st January 2015)
  #70  
Old 10th July 2012, 15:44
djzoulox's Avatar
djzoulox djzoulox is offline
Senior Member
 
Join Date: May 2012
Denmark
Posts: 77
Default public announce.php ?
can some one write me announce.php so it works as a public tracker.

this is my announce.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: 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);



?>
__________________
https://blog4.eu
Reply With Quote
The Following User Says Thank You to djzoulox For This Useful Post:
Lany (11th February 2013)
Reply

Tags
2010 , 464 , revision , tbdev , torrentbits , torrents tracker

Thread Tools

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
xBtiT v2.5.4 Fynnon xBTiT 83 21st January 2024 00:36
SZ Edition v0.3.5 revision 337 Fynnon SZ Edition 70 21st January 2020 10:10
YSE 2.x Ashur Yuna Scatari Edition (YSE) 19 4th February 2015 23:57
[TBDEV 2010] Theme/Skin Runny TBDev 1 26th January 2010 15:37
TorrentPier 0.3.5 Revision 763 Karlson Community Cafe 1 19th January 2008 17:00



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