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
TorrentTrader 3.0
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Download

2021-07-03 00:31:56
DST is the DB name ,  but why does it appear there , this is strange
2021-07-03 14:47:51
seems like you made a bad edit somewhere.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2021-07-04 16:52:50
Whatever I do I can't  pass

Database error contact an administrator when I try to upload

Do you have a working torrent-upload.php vor this version ?

Or the problem could be in functions.php ?

Still getting same error but it is saying that " Query was .... "
so the query is okay
then says Query was insert but is not in the database .

Mysql Version: 10.5.10-MariaDB-1:10.5.10+maria~stretch
PHP Version: 7.1.33-38+0~20210604.56+debian9~1.gbpf7a524
VERSION_APACHE: Apache/2.4.48 (Debian)



Database Error in torrents-upload.php on line 208: Incorrect integer value: '' for column `DST_DST`.`torrents`.`numfiles` at row 1. Query was: INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action)



my torrents-upload.php

 <?php
//
//  TorrentTrader v2.x
//      $LastChangedDate: 2012-06-12 18:11:36 +0100 (Tue, 12 Jun 2012) $
//      $LastChangedBy: torrenttrader $
//
//      http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();

// check access and rights
if ($site_config["MEMBERSONLY"]){
loggedinonly();

if($CURUSER["can_upload"]=="no")
show_error_msg(T_("ERROR"), T_("UPLOAD_NO_PERMISSION"), 1);
if ($site_config["UPLOADERSONLY"] && $CURUSER["class"] < 4)
show_error_msg(T_("ERROR"), T_("UPLOAD_ONLY_FOR_UPLOADERS"), 1);
}

$announce_urls = explode(",", strtolower($site_config["announce_list"]));  //generate announce_urls[] from config.php

if ($_POST["takeupload"] == "yes") {
require_once("backend/parse.php");

   // Check form data.
   if ( ! isset($_POST['type'], $_POST['name'], $_FILES['torrent']) )
         $message = T_('MISSING_FORM_DATA');
   
   if (($num = $_FILES['torrent']['error']))
        show_error_msg(T_('ERROR'), T_("UPLOAD_ERR[$num]"), 1);

$f = $_FILES["torrent"];
$fname = $f["name"];

if (empty($fname))
$message = T_("EMPTY_FILENAME");

   $nfo = 'no';
       
if ($_FILES['nfo']['size'] != 0) {
$nfofile = $_FILES['nfo'];

if ($nfofile['name'] == '')
$message = T_("NO_NFO_UPLOADED");

if (!preg_match('/^(.+)\.nfo$/si', $nfofile['name'], $fmatches))
$message = T_("UPLOAD_NOT_NFO");

if ($nfofile['size'] == 0)
$message = T_("NO_NFO_SIZE");

if ($nfofile['size'] > 65535)
$message = T_("NFO_UPLOAD_SIZE");

$nfofilename = $nfofile['tmp_name'];

       if (($num = $_FILES['nfo']['error']))
            $message = T_("UPLOAD_ERR[$num]");
       
$nfo = 'yes';
}

$descr = $_POST["descr"];

if (!$descr)
$descr = T_("UPLOAD_NO_DESC");

$langid = (int) $_POST["lang"];

/*if (!is_valid_id($langid))
$message = "Please be sure to select a torrent language";*/

$catid = (int) $_POST["type"];

if (!is_valid_id($catid))
$message = T_("UPLOAD_NO_CAT");

if (!validfilename($fname))
$message = T_("UPLOAD_INVALID_FILENAME");

if (!preg_match('/^(.+)\.torrent$/si', $fname, $matches))
$message = T_("UPLOAD_INVALID_FILENAME_NOT_TORRENT");

$shortfname = $torrent = $matches[1];

if (!empty($_POST["name"]))
$name = $_POST["name"];
       
   $tmpname = $f['tmp_name'];

//end check form data

if (!$message) {
//parse torrent file
$torrent_dir = $site_config["torrent_dir"];
$nfo_dir = $site_config["nfo_dir"];

//if(!copy($f, "$torrent_dir/$fname"))
if(!move_uploaded_file($tmpname, "$torrent_dir/$fname"))
show_error_msg(T_("ERROR"), T_("ERROR"). ": " . T_("UPLOAD_COULD_NOT_BE_COPIED")." $tmpname - $torrent_dir - $fname",1);

   $TorrentInfo = array();
   $TorrentInfo = ParseTorrent("$torrent_dir/$fname");


$announce = $TorrentInfo[0];
$infohash = $TorrentInfo[1];
$creationdate = $TorrentInfo[2];
$internalname = $TorrentInfo[3];
$torrentsize = $TorrentInfo[4];
$filecount = $TorrentInfo[5];
$annlist = $TorrentInfo[6];
$comment = $TorrentInfo[7];
$filelist = $TorrentInfo[8];

/*
//for debug...
print ("<br /><br />announce: ".$announce."");
print ("<br /><br />infohash: ".$infohash."");
print ("<br /><br />creationdate: ".$creationdate."");
print ("<br /><br />internalname: ".$internalname."");
print ("<br /><br />torrentsize: ".$torrentsize."");
print ("<br /><br />filecount: ".$filecount."");
print ("<br /><br />annlist: ".$annlist."");
print ("<br /><br />comment: ".$comment."");
*/

//check announce url is local or external
if (!in_array($announce, $announce_urls, 1)){
$external='no';
   }else{
$external='yes';
}

//if externals is turned off
if (!$site_config["ALLOWEXTERNAL"] && $external == 'yes')
$message = T_("UPLOAD_NO_TRACKER_ANNOUNCE");
}
if ($message) {
@unlink("$torrent_dir/$fname");
@unlink($tmpname);
@unlink("$nfo_dir/$nfofilename");
show_error_msg(T_("UPLOAD_FAILED"), $message,1);
}

//release name check and adjust
if ($name ==""){
$name = $internalname;
}
$name = str_replace(".torrent","",$name);
$name = str_replace("_", " ", $name);

//upload images
$allowed_types = &$site_config["allowed_image_types"];

$inames = array();
for ($x=0; $x < 2; $x++) {
if (!($_FILES[image.$x]['name'] == "")) {
$y = $x + 1;

//if (!preg_match('/^(.+)\.(jpg|gif|png)$/si', $_FILES[image.$x]['name']))
// show_error_msg(T_("INVAILD_IMAGE"), T_("THIS_FILETYPE_NOT_IMAGE"), 1);

if ($_FILES['image$x']['size'] > $site_config['image_max_filesize'])
show_error_msg(T_("ERROR"), T_("INVAILD_FILE_SIZE_IMAGE"), 1);

$uploaddir = $site_config["torrent_dir"]."/images/";

$ifile = $_FILES[image.$x]['tmp_name'];

$im = getimagesize($ifile);

if (!$im[2])
show_error_msg(T_("ERROR"), sprintf(T_("INVALID_IMAGE"), $y), 1);

if (!array_key_exists($im['mime'], $allowed_types))
show_error_msg(T_("ERROR"), T_("INVALID_FILETYPE_IMAGE"), 1);

$ret = SQL_Query_exec("SHOW TABLE STATUS LIKE 'torrents'");
$row = mysqli_fetch_array($ret);
$next_id = $row['Auto_increment'];

$ifilename = $next_id . $x . $allowed_types[$im['mime']];

$copy = copy($ifile, $uploaddir.$ifilename);

if (!$copy)
show_error_msg(T_("ERROR"), sprintf(T_("IMAGE_UPLOAD_FAILED"), $y), 1);

$inames[] = $ifilename;

}

}
//end upload images

//anonymous upload
$anonyupload = $_POST["anonycheck"];
if ($anonyupload == "yes") {
$anon = "yes";
}else{
$anon = "no";
}

$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");

$id = mysqli_insert_id();

if (mysqli_errno() == 1062)
show_error_msg(T_("UPLOAD_FAILED"), T_("UPLOAD_ALREADY_UPLOADED"), 1);

//Update the members uploaded torrent count
/*if ($ret){
SQL_Query_exec("UPDATE users SET torrents = torrents + 1 WHERE id = $userid");*/
       
if($id == 0){
unlink("$torrent_dir/$fname");
$message = T_("UPLOAD_NO_ID");
show_error_msg(T_("UPLOAD_FAILED"), $message, 1);
}
   
   rename("$torrent_dir/$fname", "$torrent_dir/$id.torrent");

if (count($filelist)) {
foreach ($filelist as $file) {
$dir = '';
$size = $file["length"];
$count = count($file["path"]);
for ($i=0; $i<$count;$i++) {
if (($i+1) == $count)
$fname = $dir.$file["path"][$i];
else
$dir .= $file["path"][$i]."/";
}
SQL_Query_exec("INSERT INTO `files` (`torrent`, `path`, `filesize`) VALUES($id, ".sqlesc($fname).", $size)");
}
} else {
SQL_Query_exec("INSERT INTO `files` (`torrent`, `path`, `filesize`) VALUES($id, ".sqlesc($TorrentInfo[3]).", $torrentsize)");
}

if (!count($annlist)) {
$annlist = array(array($announce));
}
foreach ($annlist as $ann) {
foreach ($ann as $val) {
if (strtolower(substr($val, 0, 4)) != "udp:") {
SQL_Query_exec("INSERT INTO `announce` (`torrent`, `url`) VALUES($id, ".sqlesc($val).")");
}
}
}

if ($nfo == 'yes') {
           move_uploaded_file($nfofilename, "$nfo_dir/$id.nfo");
   }

//EXTERNAL SCRAPE
if ($external=='yes' && $site_config['UPLOADSCRAPE']){
$tracker=str_replace("/announce","/scrape",$announce);
$stats = torrent_scrape_url($tracker, $infohash);
$seeders = (int) strip_tags($stats['seeds']);
$leechers = (int) strip_tags($stats['peers']);
$downloaded = (int) strip_tags($stats['downloaded']);

SQL_Query_exec("UPDATE torrents SET leechers='".$leechers."', seeders='".$seeders."',times_completed='".$downloaded."',last_action= '".get_date_time()."',visible='yes' WHERE id='".$id."'");
}
//END SCRAPE

   write_log( sprintf(T_("TORRENT_UPLOADED"), htmlspecialchars($name), $CURUSER["username"]) );

//Uploaded ok message (update later)
if ($external=='no')
$message = sprintf( T_("TORRENT_UPLOAD_LOCAL"), $name, $id, $id );
else
$message = sprintf( T_("TORRENT_UPLOAD_EXTERNAL"), $name, $id );
show_error_msg(T_("UPLOAD_COMPLETE"), $message, 1);

die();
}//takeupload


///////////////////// FORMAT PAGE ////////////////////////

stdhead(T_("UPLOAD"));

begin_frame(T_("UPLOAD_RULES"));
echo "<b>".stripslashes($site_config["UPLOADRULES"])."</b>";
echo "<br />";
end_frame();

begin_frame(T_("UPLOAD"));
?>
<form name="upload" enctype="multipart/form-data" action="torrents-upload.php" method="post">
<input type="hidden" name="takeupload" value="yes" />
<table border="0" cellspacing="0" cellpadding="6" align="center">
<?php
print ("<tr><td align='right' valign='top'>" . T_("ANNOUNCE_URL") . ": </td><td align='left'>");

while (list($key,$value) = each($announce_urls)) {
echo "<b>$value</b><br />";
}

if ($site_config["ALLOWEXTERNAL"]){
echo "<br /><b>".T_("THIS_SITE_ACCEPTS_EXTERNAL")."</b>";
}
print ("</td></tr>");
print ("<tr><td align='right'>" . T_("TORRENT_FILE") . ": </td><td align='left'> <input type='file' name='torrent' size='50' value='" . $_FILES['torrent']['name'] . "' />\n</td></tr>");
print ("<tr><td align='right'>" .T_("NFO"). ": </td><td align='left'> <input type='file' name='nfo' size='50' value='" . $_FILES['nfo']['name'] . "' /><br />\n</td></tr>");
print ("<tr><td align='right'>" . T_("TORRENT_NAME") . ": </td><td align='left'><input type='text' name='name' size='60' value='" . $_POST['name'] . "' /><br />".T_("THIS_WILL_BE_TAKEN_TORRENT")." \n</td></tr>");
print ("<tr><td colspan='2' align='center'>".T_("MAX_FILE_SIZE").": ".mksize($site_config['image_max_filesize'])."<br />".T_("ACCEPTED_FORMATS").": ".implode(", ", array_unique($site_config["allowed_image_types"]))."<br /></td></tr><tr><td align='right'>".T_("IMAGE")." 1:&nbsp;&nbsp;</td><td><input type='file' name='image0' size='50' /></td></tr><tr><td align='right'>".T_("IMAGE")." 2:&nbsp;&nbsp;</td><td><input type='file' name='image1' size='50' /></td></tr>");

$category = "<select name=\"type\">\n<option value=\"0\">" . T_("CHOOSE_ONE") . "</option>\n";

$cats = genrelist();
foreach ($cats as $row)
$category .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["parent_cat"]) . ": " . htmlspecialchars($row["name"]) . "</option>\n";

$category .= "</select>\n";
print ("<tr><td align='right'>" . T_("CATEGORY") . ": </td><td align='left'>".$category."</td></tr>");


$language = "<select name=\"lang\">\n<option value=\"0\">".T_("UNKNOWN_NA")."</option>\n";

$langs = langlist();
foreach ($langs as $row)
$language .= "<option value=\"" . $row["id"] . "\">" . htmlspecialchars($row["name"]) . "</option>\n";

$language .= "</select>\n";
print ("<tr><td align='right'>".T_("LANGUAGE").": </td><td align='left'>".$language."</td></tr>");

if ($site_config['ANONYMOUSUPLOAD'] && $site_config["MEMBERSONLY"] ){ ?>
   <tr><td align="right"><?php echo T_("UPLOAD_ANONY");?>: </td><td><?php printf("<input name='anonycheck' value='yes' type='radio' " . ($anonycheck ? " checked='checked'" : "") . " />".T_("YES")." <input name='anonycheck' value='no' type='radio' " . (!$anonycheck ? " checked='checked'" : "") . " />".T_("NO").""); ?> &nbsp;<i><?php echo T_("UPLOAD_ANONY_MSG");?></i>
   </td></tr>
<?php
}

print ("<tr><td align='center' colspan='2'>" . T_("DESCRIPTION") . "</td></tr></table>");

require_once("backend/bbcode.php");
print textbbcode("upload","descr","$descr");
?>

<br /><br /><center><input type="submit" value="<?php echo T_("UPLOAD_TORRENT"); ?>" /><br />
<i><?php echo T_("CLICK_ONCE_IMAGE");?></i>
</center>
</form>

<?php
end_frame();
stdfoot();
?>

Last edited by wdq on 2021-07-05 04:54:53
2021-07-06 05:26:50
By changing sql_query_exec  with mysqli_query on the line $ret .... Insert into torrents .....

Passed that error to

No torrent id . Database error

Any help from here please ?
Last edited by wdq on 2021-07-06 05:27:53
2021-07-06 07:27:27
I can't test but if I remember above query add

$filecounts = (int) $filecount;


Then in query ( line 208 ) find $filecount and add s to the end to become $filecounts
2021-07-06 10:50:00
changing SQL_Query_exec to mysqli_query will require a database connection added to the argument line. Just leave it sql_query_exec, that is not your issue. Im betting that its countable that is doing it. and the count for the array. try this code
	if (is_countable($filelist) && count($filelist)) {
foreach ($filelist as $file) {
$dir = '';
$size = $file["length"];
$count = count($file["path"]);
for ($i=0; $i<$count;$i++) {
if (($i+1) == $count)
$fname = $dir.$file["path"][$i];
else
$dir .= $file["path"][$i]."/";
}
SQL_Query_exec("INSERT INTO `files` (`torrent`, `path`, `filesize`) VALUES($id, ".sqlesc($fname).", $size)");
}
} else {
SQL_Query_exec("INSERT INTO `files` (`torrent`, `path`, `filesize`) VALUES($id, ".sqlesc($TorrentInfo[3]).", $torrentsize)");
}

if (!is_array($annlist)) {
$annlist = array(array($announce));
}
foreach ($annlist as $ann) {
foreach ($ann as $val) {
if (strtolower(substr($val, 0, 4)) != "udp:") {
SQL_Query_exec("INSERT INTO `announce` (`torrent`, `url`) VALUES($id, ".sqlesc($val).")");
}
}
}

if ($nfo == 'yes') {
           move_uploaded_file($nfofilename, "$nfo_dir/$id.nfo");
   }

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-07-06 21:06:25
2021-11-04 16:04:06
just installed v3 and noticed

1) error reporting should be disabled in functions at top - it should only be used in dev mode
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(0);


2) in functions around line 807 thisEach is there but the function is commented out
while (list($code, $url) = thisEach($smilies))
$s = str_replace($code, '<img border="0" src="'.$site_config["SITEURL"].'/images/smilies/'.$url.'" alt="'.$code.'" title="'.$code.'" />', $s);


should be
	foreach($smilies as $code => $url) {
       $s = str_replace($code, '<img border="0" src="'.$site_config["SITEURL"].'/images/smilies/'.$url.'" alt="'.$code.'" title="'.$code.'" />', $s);
}


if i notice anything else ill post  :thumb
Last edited by M-jay warn on 2021-11-04 17:11:39
2021-11-04 21:41:33
oops. Missed that one. Thanks. github updated
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-11-04 21:41:46
2021-11-07 12:52:34
thanks M-jay :thumb
2024-03-06 14:26:14
Maybe a long shot but as anyone managed to get this working on php8?
2024-08-09 15:37:21
Always check github for updates. I found an error in the announce and fixed it on github. If your files are untouched, you can replace them directly, or if you have altered your file, you can compare the files on github to yours and make the appropriate changes
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2025-08-31 03:43:10
Hello MicroMonkey

First, a big thank you ♥

I just installed it on my new server:

Mysql Version: 10.6.22-MariaDB-cll-lve
PHP Version: 8.3.23
Apache Version: LiteSpeed

I had no problems installing it.

But since you asked to report any problems...
I noticed that in the Installation.txt file, the permissions were set to 777 - import/, but it doesn't exist. Anyway, I'm wondering why you're adding this again when no one uses this mode?

Then, if I go to my account and add my avatar URL of the correct size, even for the extension, it still gives me the error saying my URL is invalid?

In the default theme, you would need to change line 11 in the header.php file
<meta name="description" content="TorrentTrader is a feature packed and highly customisable PHP/MySQL Based BitTorrent tracker. Featuring intergrated forums, and plenty of administration options. Please visit www.torrenttrader.org for the support forums. " />
<meta name="keywords" content="http://nikkbu.info, http://www.torrenttrader.org" />


Pour
<meta name="description" content="TorrentTrader is a feature packed and highly customisable PHP v8.x/MySQLI Based BitTorrent tracker. Featuring intergrated forums, and plenty of administration options. Please visit www.torrenttrader.uk for the support forums. " />
<meta name="keywords" content="http://nikkbu.info, http://www.torrenttrader.uk" />


I'm just letting you know of any other problems.

Thank you very much again!!
Capture d’écran 2025-08-30 224241.png
Capture d’écran 2025-08-30 224241.png

Last edited by spiritblue on 2025-08-31 04:13:14
2025-09-01 04:14:47
For the shoutbox on my side if I open the miles it gives error 500

https://zupimages.net/up/25/36/9eq1.png
smilles.png
smilles.png

Last edited by spiritblue on 2025-09-01 04:15:44
2025-09-01 19:50:25
Après avoir testé les versions 8.0 à 8.3 si on veut les torrents se mettre en seed les versions 8 et+ ne fonctionne pas et de même pour L'édition des block dans staffCP

😞  😂
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: 4
  • Members: 0
  • Guests online: 4
  • Comments: 3
  • Messages: 1,728