Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

Mp Read — 2012-06-27 06:51:39 in v2.08 Mods Completed
sorry but must be missing something because I tried more than one week and still does not work for me
Mp Read — 2012-06-20 21:22:26 in v2.08 Mods Completed
read this link in place of my theme but it still did not work



<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>

[/code]
Mp Read — 2012-06-20 18:16:42 in v2.08 Mods Completed
thanks for another change

I tried but just did not work for me

take-theme.php





<?php

//

//  TorrentTrader v2.x

//      $LastChangedDate: 2011-10-29 16:02:24 +0100 (Sat, 29 Oct 2011) $

//      $LastChangedBy: dj-howarth1 $

//

//      http://www.torrenttrader.org

//

//



require_once("backend/functions.php");

dbconn();

loggedinonly();

 if ( is_valid_id($_POST['msgid']) )

{

         SQL_Query_exec("UPDATE `messages` SET `unread` = 'no' WHERE `receiver` = " . $CURUSER["id"] . " AND `id` = " . $_POST["msgid"]);

         die;

}

$updateset = array();



$stylesheet = $_POST['stylesheet'];

$language = $_POST['language'];



if (is_valid_id($stylesheet))

    $updateset[] = "stylesheet = '$stylesheet'";

if (is_valid_id($language))

    $updateset[] = "language = '$language'";



if (count($updateset))

    SQL_Query_exec("UPDATE `users` SET " . implode(', ', $updateset) . " WHERE `id` = " . $CURUSER["id"]);



if (isset($_SERVER["HTTP_REFERER"]))

{

    header("Location: {$_SERVER["HTTP_REFERER"]}");

    return;

}    



header("Location: index.php");



?>






java_klappe.js







// <!--

function klappe(id)

{

var klappText = document.getElementById('k' + id);

var klappBild = document.getElementById('pic' + id);

if (klappText.style.display == 'none') {

klappText.style.display = 'block';

}

else {

klappText.style.display = 'none';

}

}

function klappe_news(id)

{

var klappText = document.getElementById('k' + id);

var klappBild = document.getElementById('pic' + id);

if (klappText.style.display == 'none') {

klappText.style.display = 'block';

klappBild.src = 'images/minus.gif';

}

else {

klappText.style.display = 'none';

klappBild.src = 'images/plus.gif';

}

}

function klappe_torrent(id)

{

var klappText = document.getElementById('k' + id);

var klappBild = document.getElementById('pic' + id);

if (klappText.style.display == 'none') {

klappText.style.display = 'block';

klappBild.src = 'images/minus.gif';

}

else {

klappText.style.display = 'none';

klappBild.src = 'images/plus.gif';

}

}

 var checked = false;

 function checkAll(form)

 {

 if (checked == false)

 checked = true;

 else

 checked = false;

 var length = document.getElementById(form).elements.length;



 for ( i = 0; i < length; i++ )

 {

 document.getElementById(form).elements[i].checked = checked;

 }

 }



 function toggleChecked(state)

 {

 var x = document.getElementsByTagName('input');



 for ( i = 0; i < x.length; i++ )

 {

 if ( x[i].type == 'checkbox' )

 {

  x[i].checked = state;

 }

 }

 }



 function toggleDisplay(id)

 {

 var x = document.getElementById(id);



 if ( x.style.display == '' )

  x.style.display = 'none';

 else

  x.style.display = '';

 }



 function toggleTemplate(x)

 {

 var y = true;



 if ( x.form.usetemplate.selectedIndex == 0 )

  y = false;

 

 x.form.subject.disabled = y;

 x.form.msg.disabled = y;

 x.form.draft.disabled = y;

 x.form.template.disabled = y;

 }



 function read(id)

 {

 var x = document.getElementById('msg_' + id);

 var y = document.getElementById('img_' + id);



 if ( x.style.display == '' )

 {

  x.style.display = 'none';

  y.src = 'images/plus.gif';

 }

 else

 {

  x.style.display = '';

  y.src = 'images/minus.gif';

 }

$.post("take-theme.php", {

msgid:id

}, function(data) {

//if (data != "") {

// alert('Tests... : ' + data);

//}

});

 }

 function SmileIT(smile,form,text)

 {

 document.forms[form].elements[text].value = document.forms[form].elements[text].value+" "+smile+" ";

 document.forms[form].elements[text].focus();

 }

 function PopMoreSmiles(form,name)

 {

 link = 'backend/smilies.php?action=display&form='+form+'&text='+name

 newWin = window.open(link,'moresmile','height=500,width=450,resizable=no,scrollbars=yes,location=no');

 if (window.focus) {newWin.focus()}

 }



 function PopMoreTags()

 {

 link = 'tags.php';

 newWin = window.open(link,'moresmile','height=500,width=775,resizable=no,scrollbars=yes,location=no');

 if (window.focus) {newWin.focus()}

 }

// -->

Thanks I will try to help and assist but tt was always nice to have a bar donations
is difficult to know how to donate to the great future of the TT never know which e-mail to donate
Mp Read — 2012-06-02 17:55:24 in v2.08 Mods Completed
I wonder if would like when the user clicks to display the message it has to be marked as read

thanks for the help now he is going well 100%

problem solved :D


<?php



//

//  TorrentTrader v2.x

//  $LastChangedDate$

//  $LastChangedBy$

//

//  [url="http://www.torrenttrader.org"]http://www.torrenttrader.org[/url]

//

//

 

// Please Note: Languages should not be implemented here...



error_reporting(E_ALL ^ E_NOTICE);

require_once("backend/mysql.php");

require_once("backend/config.php");

require_once("backend/mysql.class.php");



@mysql_connect($mysql_host, $mysql_user, $mysql_pass) or err('dbconn: mysql_connect: ' . mysql_error());

@mysql_select_db($mysql_db) or err('dbconn: mysql_select_db: ' . mysql_error());



$MEMBERSONLY = $site_config["MEMBERSONLY"];

$MEMBERSONLY_WAIT = $site_config["MEMBERSONLY_WAIT"];



$_GET = array_map_recursive("unesc", $_GET);



//START FUNCTIONS

function array_map_recursive ($callback, $array) {

$ret = array();



if (!is_array($array))

return $callback($array);



foreach ($array as $key => $val) {

$ret[$key] = array_map_recursive($callback, $val);

}

return $ret;

}





function unesc($x) {

if (get_magic_quotes_gpc())

return stripslashes($x);

return $x;

}



function is_valid_id($id) {

return is_numeric($id) && ($id > 0) && (floor($id) == $id);

}



function sqlesc($x) {

return "'".mysql_real_escape_string($x)."'";

}



function err($msg) {

  return benc_resp_raw("d".benc_str("failure reason").benc_str($msg)."e");

}



function benc_str($s) {

return strlen($s) . ":$s";

}



function benc_int($i) {

return "i" . $i . "e";

}



function benc_resp_raw($x) {

header("Content-Type: text/plain");

header("Pragma: no-cache");



if (extension_loaded('zlib') && !ini_get('zlib.output_compression') && $_SERVER["HTTP_ACCEPT_ENCODING"] == "gzip") {

header("Content-Encoding: gzip");

echo gzencode($x, 9, FORCE_GZIP);

} else

print($x);



exit();

}



function gmtime() {

return strtotime(get_date_time());

}



function get_date_time($timestamp = 0) {

if ($timestamp)

return date("Y-m-d H:i:s", $timestamp);

else

return gmdate("Y-m-d H:i:s");

}

//////Snatched////////////////////

$dt = gmtime() - 180;

$dt = sqlesc(get_date_time($dt));

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

function portblacklisted($port) {

// direct connect

if ($port >= 411 && $port <= 413) 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;

}



//////////////////////// NOW WE DO THE ANNOUNCE CODE ////////////////////////



// BLOCK ACCESS WITH WEB BROWSERS

$agent = $_SERVER["HTTP_USER_AGENT"];

if (preg_match("/^Mozilla|^Opera|^Links|^Lynx/i", $agent))

die("No");



//GET DETAILS OF PEERS ANNOUNCE

foreach (array("passkey","info_hash","peer_id","ip","event") as $x) {

$GLOBALS[$x] = $_GET[$x];

}



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

$GLOBALS[$x] = (int) $_GET[$x];



if (strpos($passkey, "?")) {

$tmp = substr($passkey, strpos($passkey, "?"));

$passkey = substr($passkey, 0, strpos($passkey, "?"));

$tmpname = substr($tmp, 1, strpos($tmp, "=")-1);

$tmpvalue = substr($tmp, strpos($tmp, "=")+1);

$GLOBALS[$tmpname] = $tmpvalue;

}



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

if (!isset($$x))

err("Missing key: $x");



if (strlen($peer_id) != 20)

err("Invalid peer_id");



$no_peer_id = (int) $_GET["no_peer_id"];



if (strlen($GLOBALS['info_hash']) == 20)

$GLOBALS['info_hash'] = bin2hex($GLOBALS['info_hash']);

else if (strlen($GLOBALS['info_hash']) != 40)

err("Invalid info hash value.");

$GLOBALS['info_hash'] = strtolower($GLOBALS['info_hash']);



if ($MEMBERSONLY){

if (strlen($passkey) != 32)

err("Invalid passkey (" . strlen($passkey) . " - $passkey)");

}



$ip = $_SERVER["REMOTE_ADDR"];



foreach(array("num want", "numwant", "num_want") as $k)

{

if (isset($_GET[$k]))

{

$rsize = (int) $_GET[$k];

break;

}

}



//PORT CHECK

if (!$port || $port > 0xffff)

err("invalid port");



//TRACKER EVENT CHECK

if (!isset($event))

$event = "";



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



//Agent Ban

$agentarray = array_map("trim", explode(",", $site_config["BANNED_AGENTS"]));

$useragent = substr($peer_id, 0, 8);

foreach($agentarray as $bannedclient)

if (@strpos($useragent, $bannedclient) !== false)

err("Client is banned");

//End Agent Bans



if (portblacklisted($port))

err("Port $port is blacklisted.");



$userfields = "u.id, u.class, u.uploaded, u.downloaded, u.ip, u.passkey, g.can_download"; //user details to get



$peerfields = "seeder, UNIX_TIMESTAMP(last_action) AS ez, peer_id, ip, port, uploaded, downloaded, userid, passkey"; //peers details to get



$torrentfields = "id, info_hash, banned, freeleech, seeders + leechers AS numpeers, UNIX_TIMESTAMP(added) AS ts, seeders, leechers, times_completed"; //torrent details to get



$userid = 0;

if ($MEMBERSONLY){

//check passkey is valid, and get users details

$res = SQL_Query_exec("SELECT $userfields FROM users u INNER JOIN groups g ON u.class = g.group_id WHERE u.passkey=".sqlesc($passkey)." AND u.enabled = 'yes' AND u.status = 'confirmed' LIMIT 1") or err("Cannot Get User Details");

$user = mysql_fetch_assoc($res);

if (!$user)

err("Cannot locate a user with that passkey!");

if ($user["can_download"] == "no")

err("You do not have permission to download.");

$userid = $user["id"]; //etc

}





//check torrent is valid and get torrent fields

$res = SQL_Query_exec("SELECT $torrentfields FROM torrents WHERE info_hash=".sqlesc($info_hash)) or err("Cannot Get Torrent Details");

$torrent = mysql_fetch_assoc($res);



if (!$torrent)

err("Torrent not found on this tracker - hash = " . $info_hash);

if ($torrent["banned"]=='yes')

err("Torrent has been banned - hash = " . $info_hash);

$torrentid = $torrent["id"];





//Now get data from peers table

$peerlimit = 50;

$numpeers = $torrent["numpeers"];

if ($numpeers > $peerlimit){

$limit = "ORDER BY RAND() LIMIT $peerlimit";

}else{

$limit = "";

}

$res = SQL_Query_exec("SELECT $peerfields FROM peers WHERE torrent = $torrentid $limit") or err("Error Selecting Peers");



//DO SOME BENC STUFF TO THE PEERS CONNECTION

$resp = "d8:completei$torrent[seeders]e10:downloadedi$torrent[times_completed]e10:incompletei$torrent[leechers]e";

$resp .= benc_str("interval") . "i" . $site_config['announce_interval'] . "e" . benc_str("min interval") . "i300e" . benc_str("peers");

unset($self);

while ($row = mysql_fetch_assoc($res)) {

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

$self = $row;

continue;

}



$peers .= "d" . benc_str("ip") . benc_str($row["ip"]);

if (!$no_peer_id)

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

$peers .= benc_str("port") . "i" . $row["port"] . "ee";

}

$resp .= "l{$peers}e";

$resp .= "ee";



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







// FILL $SELF WITH DETAILS FROM PEERS TABLE (CONNECTING PEERS DETAILS)

if (!isset($self)){



//check passkey isnt leaked





$res = SQL_Query_exec("SELECT $peerfields FROM peers WHERE $selfwhere");

$row = mysql_fetch_assoc($res);

if ($row){

  $self = $row;

}

}

// END $SELF FILL





if (!isset($self)){ //IF PEER IS NOT IN PEERS TABLE DO THE WAIT TIME CHECK

if ($MEMBERSONLY_WAIT && $MEMBERSONLY){

//wait time check

if($left > 0 && in_array($user["class"], explode(",",$site_config["WAIT_CLASS"]))){ //check only leechers and lowest user class

$gigs = $user["uploaded"] / (1024*1024*1024);

$elapsed = floor((gmtime() - $torrent["ts"]) / 3600);

$ratio = (($user["downloaded"] > 0) ? ($user["uploaded"] / $user["downloaded"]) : 1);

if ($ratio == 0 && $gigs == 0) $wait = $site_config["WAITA"];

elseif ($ratio < $site_config["RATIOA"] || $gigs < $site_config["GIGSA"]) $wait = $site_config["WAITA"];

elseif ($ratio < $site_config["RATIOB"] || $gigs < $site_config["GIGSB"]) $wait = $site_config["WAITB"];

elseif ($ratio < $site_config["RATIOC"] || $gigs < $site_config["GIGSC"]) $wait = $site_config["WAITC"];

elseif ($ratio < $site_config["RATIOD"] || $gigs < $site_config["GIGSD"]) $wait = $site_config["WAITD"];

else $wait = 0;

if ($elapsed < $wait)

err("Wait Time (" . ($wait - $elapsed) . " hours) - Visit ".$site_config["SITEURL"]." for more info");

}

}

$sockres = @fsockopen($ip, $port, $errno, $errstr, 5);

if (!$sockres)

$connectable = "no";

else

$connectable = "yes";

@fclose($sockres);



}else{

$upthis = max(0, $uploaded - $self["uploaded"]);

$downthis = max(0, $downloaded - $self["downloaded"]);



if (($upthis > 0 || $downthis > 0) && is_valid_id($userid)){ //  (LIVE STATS!)

if ($torrent["freeleech"] == 1 || $user["freeleechuser"] == "yes"){

SQL_Query_exec("UPDATE users SET uploaded = uploaded + $upthis WHERE id=$userid") or err("Tracker error: Unable to update stats");

}else{

SQL_Query_exec("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error: Unable to update stats");

}

}

}//END WAIT AND STATS UPDATE



$updateset = array();



////////////////// NOW WE DO THE TRACKER EVENT UPDATES ///////////////////



if ($event == "stopped") { // UPDATE "STOPPED" EVENT

////////////////////////SNATCHED/////////////////////////////////////////

$res_se = SQL_Query_exec("SELECT userid, seed_end, torrentid FROM snatched WHERE torrentid = $torrentid AND userid = $userid");

while ($row_se = mysql_fetch_assoc($res_se)) {

SQL_Query_exec("UPDATE snatched SET seed_end  = $dt WHERE finished = 'yes' AND torrentid = ". $row_se[torrentid] ." AND userid = ". $row_se[userid] ."");

}

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

SQL_Query_exec("DELETE FROM peers WHERE $selfwhere");

if (mysql_affected_rows()){

if ($self["seeder"] == "yes")

$updateset[] = "seeders = seeders - 1";

else

$updateset[] = "leechers = leechers - 1";

}

}



if ($event == "completed") { // UPDATE "COMPLETED" EVENT

$updateset[] = "times_completed = times_completed + 1";

////////////////////SNATCHED///////////////////////////

SQL_Query_exec("UPDATE snatched SET  finished  = 'yes', complete_date = $dt WHERE torrentid = $torrentid AND userid = $userid");

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

if ($MEMBERSONLY)

SQL_Query_exec("INSERT INTO completed (userid, torrentid, date) VALUES ($userid, $torrentid, '".get_date_time()."')");

}//END COMPLETED



if (isset($self)){// NO EVENT? THEN WE MUST BE A NEW PEER OR ARE NOW SEEDING A COMPLETED TORRENT

///////////////////////////////////SNATCHED//////////////////////////////////////////

$res_s = SQL_Query_exec("SELECT uploaded, downloaded FROM snatched WHERE torrentid = $torrentid AND userid = $userid");

$row_s = mysql_fetch_array($res_s);

$downloaded2 = max(0, $downloaded - $self["downloaded"]);

$uploaded2 = max(0, $uploaded - $self["uploaded"]);

SQL_Query_exec("UPDATE snatched SET uploaded = uploaded + $uploaded2, port = $port, agent= " . sqlesc($agent) . ", last_action = $dt WHERE torrentid = $torrentid AND userid = $userid");

SQL_Query_exec("UPDATE snatched SET downloaded = downloaded + $downloaded2 WHERE torrentid = $torrentid AND userid = $userid");

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



SQL_Query_exec("UPDATE peers SET ip = " . sqlesc($ip) . ", passkey = " . sqlesc($passkey) . ", port = $port, uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = '".get_date_time()."', client = " . sqlesc($agent) . ", seeder = '$seeder' 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 {

/////////////////////////////////SNATCHED//////////////////////////////////////////////////////////

$res1_s = SQL_Query_exec("SELECT torrentid, userid FROM snatched WHERE torrentid = $torrentid AND userid = $userid") or err('Tracker error (120)');

$row1_s = mysql_fetch_assoc($res1_s);

if (!$row1_s)

SQL_Query_exec("INSERT INTO snatched (torrentid, userid, port, start_date, ahrdate, agent,ip,peer_id) VALUES ($torrentid, $userid, $port, $dt, UNIX_TIMESTAMP(), " . sqlesc($agent) . "," . sqlesc($ip) . "," . sqlesc($peer_id) . ")");

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

$ret = SQL_Query_exec("INSERT INTO peers (connectable, torrent, peer_id, ip, passkey, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, client) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", " . sqlesc($passkey) . ", $port, $uploaded, $downloaded, $left, '".get_date_time()."', '".get_date_time()."', '$seeder', '$userid', " . sqlesc($agent) . ")");



if ($ret){

if ($seeder == "yes")

$updateset[] = "seeders = seeders + 1";

else

$updateset[] = "leechers = leechers + 1";

}

}



////////////////// END TRACKER EVENT UPDATES ///////////////////



// SEEDED, LETS MAKE IT VISIBLE THEN

if ($seeder == "yes") {

if ($torrent["banned"] != "yes") // DONT MAKE BANNED ONES VISIBLE

$updateset[] = "visible = 'yes'";

$updateset[] = "last_action = '".get_date_time()."'";

}



// NOW WE UPDATE THE TORRENT AS PER ABOVE

if (count($updateset))

SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid") or err("Tracker error: Unable to update torrent");



// NOW BENC THE DATA AND SEND TO CLIENT???

benc_resp_raw($resp);

?>

[/code]
after installing this modification are getting this error any help is welcome

[size=10px]Tracker: [Could not parse bencoded data][/size]
+1 ;)
Recent Downtime — 2012-02-25 05:22:49 in General Chat
most happy to see the TT back
HAPPY NEW YEAR — 2011-12-31 19:10:18 in General Chat
Happy new year to all and your families....

Thank you all for always having the TT ...

and a Happy New Year special DJ for the revival of the TT this year
Thank You — 2011-11-09 06:32:44 in General Chat
thanks for the great work that is being done in TT
modifications paid — 2011-10-26 02:32:12 in General Chat
torrenttrader the proper functioning of this community will help everyone here out of love still want to see my children come here and see torrenttrader top. they fight for everyone here so let's help those who struggle Nois because we will always be helped
modifications paid — 2011-10-24 20:31:38 in General Chat
I have a suggestion where we can have an area where users can request a mod to be fixed for the individual and they will pay a small fee, which will help the developers earn money for there hard work and hopefully to make them succeed in future.
[ADDON] Forums — 2011-09-07 00:41:07 in v2 Only Mods Complete
but cp and the friend will change the permission of the user class
I tried to use the file you sent but it is giving same error
tt v2.06

thanks for the help but the error continues

MySQL error occured.

Query: /home/XXX/public_html/viewsnatches.php

Error: (1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
I have an issue the ip ban not working when I put the ip and it will register other than what it was to be registered

v2.06

03/09/2011

17:41:14 127.255.255.255 127.255.255.255
I'm having this error on page "viewsnatches.php" thanks for the help

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728