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

Hello — 2023-12-22 04:12:52 in General Chat
Just a thread / post to say hello to everyone since the shoutbox isn't back yet. I hope everyone is doing well
Nice. Thanks for the useful info
alphanumeric character — 2023-11-18 15:13:25 in v3 Support
perhaps try ALTER TABLE your_table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; Make sure the database you are importing is the same collation as the database structure you are importing into
taliwind theme — 2023-11-12 14:22:10 in v3 Themes
nice. thank you for sharing.
img no corver — 2023-11-02 21:44:53 in v3 Support
just like botanicar said, right click on the blank image, then click "copy image link" and paste it somewhere, like a empty text file, or even the browser address bar so you can see what it leads to, dont hit enter, you just want to see what the file is, or what its supposed to be
images folder — 2023-10-28 18:13:45 in v3 Support
very odd to lose a entire folder. Something must have happened on the server. I agree with botanicar, using winSCP is the best, been using it for years, and I also use mRemoteNG for all the putty ssh connections if thats something that interests you, even tho it has nothing to do with your issue, just wanted to mention it
error sql — 2023-10-09 21:12:54 in v3 Support
you can try
// 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 (is_countable($updateset) && count($updateset))
//     SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid");
// if (count($updateset))
//     SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid");
// Make sure $updateset is an array or an object implementing Countable
if (is_array($updateset) || $updateset instanceof Countable) {
   $updatesCount = count($updateset);

   if ($updatesCount > 0) {
       $updatesString = join(",", $updateset);
       SQL_Query_exec("UPDATE torrents SET $updatesString WHERE id=$torrentid");
   }
}
@Storrents, did you accidentally post in the wrong spot? Its fine if you did, no biggie, just wanted clarification  👍
use this. This code takes into account the different rar types in the preg_match (like .r01, r02). You can add more below in the array for different filetypes. Simple. This code is perfect
echo "<br /><br /><b>".T_("FILE_LIST").":</b> <img src='images/plus.gif' id='pic1' onclick='klappe_torrent(1)' alt='' /><div id='k1' style='display: none;'><table align='center' cellpadding='0' cellspacing='0' class='table_table' border='1' width='100%'><tr><th width='50' class='table_head'> ".T_("TYPE")."</th><th class='table_head' align='left'> ".T_("FILE")."</th><th width='50' class='table_head'> ".T_("SIZE")."</th></tr>";
$fres = SQL_Query_exec("SELECT * FROM `files` WHERE `torrent` = $id ORDER BY `path` ASC");
if (mysqli_num_rows($fres)) {
  while ($frow = mysqli_fetch_assoc($fres)) {
$ext = pathinfo($frow['path'], PATHINFO_EXTENSION);
$filetype_icons = [
"mp3" => "/images/filetype-icons/mp3.png",
"iso" => "/images/filetype-icons/iso.png",
"mp4" => "/images/filetype-icons/mp4.png",
"png" => "/images/filetype-icons/png.png",
"jpg" => "/images/filetype-icons/jpg.png",
"mkv" => "/images/filetype-icons/mkv.png",
"rar" => "/images/filetype-icons/rar.png",
"avi" => "/images/filetype-icons/avi.png",
"nfo" => "/images/filetype-icons/nfo.png"
];
if(preg_match("/^r\d{2}$/", $ext)) {
$filetype_icon = "<img width=40 height=40 src='/images/filetype-icons/rar.png'>";
} elseif(isset($filetype_icons[$ext])) {
$filetype_icon = "<img width=40 height=40 src='" . $filetype_icons[$ext] . "'>";
} else {
$filetype_icon = "<img width=40 height=40 src='/images/filetype-icons/unknown.png'>";
}


      echo "<tr><td class='table_col1'>".$filetype_icon."</td><td class='table_col1'>".htmlspecialchars($frow['path'])."</td><td class='table_col2'>".mksize($frow['filesize'])."</td></tr>";
  }
Yes. I dont use torrent-import, but at some point in the past I added it, so feel free to try it out. Here is my copy to compare.
<?php
require_once("backend/functions.php");
dbconn();

$dir = "import";

//ini_set("upload_max_filesize",$max_torrent_size);

$files = array();
$dh = opendir("$dir/");
while (false !== ($file=readdir($dh))) {
if (preg_match("/\.torrent$/i", $file))
$files[] = $file;
}
closedir($dh);


// check access and rights
if ($CURUSER["edit_torrents"] != "yes")
show_error_msg(T_("ERROR"), T_("ACCESS_DENIED"), 1);

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

if ($_POST["takeupload"] == "yes") {
set_time_limit(0);
require_once("backend/parse.php");
stdhead(T_("UPLOAD_COMPLETE"));
begin_frame(T_("UPLOAD_COMPLETE"));
echo "<center>";

//check form data
$catid = (int)$_POST["type"];

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

if (empty($message)) {
$r = SQL_Query_exec("SELECT name, parent_cat FROM categories WHERE id=$catid");
$r = mysqli_fetch_row($r);

echo "<b>Category:</b> ".htmlspecialchars($r[1])." -> ".htmlspecialchars($r[0])."<br />";
for ($i=0;$i<count($files);$i++) {
$fname = $files[$i];

$descr = T_("UPLOAD_NO_DESC");

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

preg_match('/^(.+)\.torrent$/si', $fname, $matches);
$shortfname = $torrent = $matches[1];

//parse torrent file
$torrent_dir = $site_config["torrent_dir"];

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


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

$message = "<br /><br /><hr /><br /><b>$internalname</b><br /><br />fname: ".htmlspecialchars($fname)."<br />message: ";

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

if (!$site_config["ALLOWEXTERNAL"] && $external == 'yes') {
$message .= T_("UPLOAD_NO_TRACKER_ANNOUNCE");
echo $message;
continue;
}

$name = $internalname;
$name = str_replace(".torrent","",$name);
$name = str_replace("_", " ", $name);

// Make torrent private
  if ($external == "no") {
   require_once("backend/BDecode.php");
   require_once("backend/BEncode.php");
   $dict = BDecode(file_get_contents("$torrent_dir/$fname"));
   $dict["info"]["private"] = 1;
   $fs = fopen("$torrent_dir/$fname", "w");
   fwrite($fs, BEncode($dict));
   fclose($fs);
   $TorrentInfo = array();
   $TorrentInfo = ParseTorrent("$torrent_dir/$fname");
   $infohash = $TorrentInfo[1];
  }
  // End add make torrent private

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

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

$id = mysqli_insert_id($GLOBALS["DBconnector"]);

if (mysqli_errno($GLOBALS["DBconnector"]) == 1062) {
$message .= T_("UPLOAD_ALREADY_UPLOADED");
echo $message;
continue;
}

if($id == 0){
$message .= T_("UPLOAD_NO_ID");
echo $message;
continue;
}
   
copy("$dir/$files[$i]", "uploads/$id.torrent");

//EXTERNAL SCRAPE
if ($external=='yes' && $site_config['UPLOADSCRAPE']) {  
$tracker        = str_replace("/announce","/scrape",$announce);
$stats = torrent_scrape_url($tracker, $infohash);
$seeders = strip_tags($stats['seeds']);
$leechers = strip_tags($stats['peers']);
$downloaded = 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("Torrent $id ($name) was Uploaded by $CURUSER[username]");

$message .= "<br /><b>".T_("UPLOAD_OK")."</b><br /><a href='torrents-details.php?id=".$id."'>".T_("UPLOAD_VIEW_DL")."</a><br /><br />";
echo $message;
@unlink("$dir/$fname");
}
echo "</center>";
end_frame();
stdfoot();
die;
}else
show_error_msg(T_("UPLOAD_FAILED"), $message, 1);

}//takeupload


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

stdhead(T_("UPLOAD"));

begin_frame(T_("UPLOAD"));
?>
<form name="upload" enctype="multipart/form-data" action="torrents-import.php" method="post">
<input type="hidden" name="takeupload" value="yes" />
<table border="0" cellspacing="0" cellpadding="6" align="center">
<tr><td align="right" valign="top"><b>File List:</b></td><td align="left"><?php
if (!count($files))
echo T_("NOTHING_TO_SHOW_FILES") ." $dir";
else{
foreach ($files as $f)
echo htmlspecialchars($f)."<br />";
echo "<br />Total files: ".count($files);
}?></td></tr>
<?php
$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\">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'>Language: </td><td align='left'>".$language."</td></tr>");

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

<?php } ?>
<tr><td align="center" colspan="2"><input type="submit" value="<?php echo T_("UPLOAD")?>" /><br />
<i><?php echo T_("CLICK_ONCE_IMAGE");?></i></td></tr></table></form>
<?php
end_frame();
stdfoot();
?>
try this.
print("<td class='ttable_col$x' nowrap='nowrap'>".(count($expandrows)?"<a href=\"javascript: klappe_torrent('t".$row['id']."')\"><img border=\"0\" src=\"".$site_config["SITEURL"]."/images/plus.gif\" id=\"pict".$row['id']."\" alt=\"Show/Hide\" class=\"showthecross\" /></a>":"")."&nbsp;<a href=\"torrents-details.php?id=$id&hit=1\" onMouseover=\"return overlib('<table class=ballooncolor border=1 width=100% class=ttable_headinner cellspacing=0 cellpadding=5 align=center><tr><td class=balloonheadercolor colspan=2 align=center>$smallname</td></tr><tr valign=top><td class=table_col1 align=center><img border=0 width=120 src=$balon></td><tr><td class=balloonheadercolor colspan=2 align=center>".T_("DESCRIPTION")."</td></tr><tr><td class=table_col1 colspan=2>" . CutName($des, $char5) . "</td></tr></table>', CENTER, HEIGHT, 150, WIDTH, 300)\"; onMouseout=\"return nd()\">".$dispname."</a></td>");
break;
weird, because its ENUM YES:NO in that code above also, it just sanitizes the text input. Im not sure what you got going on. I cant duplicate it. Data being truncated means your data is too long for the sort, which should only be an ENUM. You may have an error elsewhere, I dont know. Just use the code that works. I think it may have something to do with sqlesc(), but my code is different a bit, just use what works, no reason to overthink it, or switch this in my code above.
$subact = $_POST["subact"];
this seems like a better idea for the post data. I learned from STorrents that you should sanitize the input on POST, so what do you think? I tested it on my copy, Im just gunna add this to git. Pollid and sort dont need sanitized. Seems reasonable. I been using FILTER_SANITIZE as I go through my code. Works well as long as I put it where it belongs lol. Yea, I screw it up alot. Do we really need 19 options on this stupid thing? lol
if ($action == "polls" && $do == "save") {
   $subact = filter_input(INPUT_POST, 'subact', FILTER_SANITIZE_STRING);
   $pollid = (int)$_POST["pollid"];

   $question = filter_input(INPUT_POST, 'question', FILTER_SANITIZE_STRING);
   $option0 = filter_input(INPUT_POST, 'option0', FILTER_SANITIZE_STRING);
   $option1 = filter_input(INPUT_POST, 'option1', FILTER_SANITIZE_STRING);
   $option2 = filter_input(INPUT_POST, 'option2', FILTER_SANITIZE_STRING);
   $option3 = filter_input(INPUT_POST, 'option3', FILTER_SANITIZE_STRING);
   $option4 = filter_input(INPUT_POST, 'option4', FILTER_SANITIZE_STRING);
   $option5 = filter_input(INPUT_POST, 'option5', FILTER_SANITIZE_STRING);
   $option6 = filter_input(INPUT_POST, 'option6', FILTER_SANITIZE_STRING);
   $option7 = filter_input(INPUT_POST, 'option7', FILTER_SANITIZE_STRING);
   $option8 = filter_input(INPUT_POST, 'option8', FILTER_SANITIZE_STRING);
   $option9 = filter_input(INPUT_POST, 'option9', FILTER_SANITIZE_STRING);
   $option10 = filter_input(INPUT_POST, 'option10', FILTER_SANITIZE_STRING);
   $option11 = filter_input(INPUT_POST, 'option11', FILTER_SANITIZE_STRING);
   $option12 = filter_input(INPUT_POST, 'option12', FILTER_SANITIZE_STRING);
   $option13 = filter_input(INPUT_POST, 'option13', FILTER_SANITIZE_STRING);
   $option14 = filter_input(INPUT_POST, 'option14', FILTER_SANITIZE_STRING);
   $option15 = filter_input(INPUT_POST, 'option15', FILTER_SANITIZE_STRING);
   $option16 = filter_input(INPUT_POST, 'option16', FILTER_SANITIZE_STRING);
   $option17 = filter_input(INPUT_POST, 'option17', FILTER_SANITIZE_STRING);
   $option18 = filter_input(INPUT_POST, 'option18', FILTER_SANITIZE_STRING);
   $option19 = filter_input(INPUT_POST, 'option19', FILTER_SANITIZE_STRING);
   $sort = $_POST["sort"];
github edited and commented. Thanks for pointing it out spritblue. The poll is one of those rarely used features, so if it has a bug, most people dont even know it
disable mysql strict mode. I think thats where your issue is
SHOW VARIABLES LIKE 'sql_mode';
should look like this, if not, change it
Error sql — 2023-07-24 21:03:39 in v3 Support
Maybe this will work better? Just taking a guess
    $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) . "')");


function sqlesc($x) {
   return mysqli_real_escape_string($GLOBALS["DBconnector"], $x);
}

just wrapping the query with the quotes at the time of sql excute. I havent checked to see if this would affect anything else tho that uses the sqlesc() function, just wondering. Also wondering why the data would be too long for the table, thats confusing. I guess you could try truncating it down to 25 chars before you insert it since it seems the client is what is causing your problem, I dunno, odd. Like something like
$maxlength = 25;
if (strlen($agent) > $maxlength) {
   $agent = substr($agent, 0, $maxlength);
}

all of this is just experimental. I havent tested any of this
Error sql — 2023-07-22 22:27:31 in v3 Support
just noticed, I dont speak french, but I think OUI means yes, and your client table should be NO (Non) for null on that table and default is blank, nada, zip, ziltch, zero, nothing, rien, vide. Perhaps that is an issue?
Error sql — 2023-07-22 21:28:03 in v3 Support
hmm, well to be honest, using mysqli_query is probably the best method anyways. Its highly probable that we should eliminate sql_query exec anyways and use the built-in php code. We been relying on a function that does a function that php already does, so......
Error sql — 2023-07-22 21:11:50 in v3 Support
have you tried setting varchar at 50 on your client table? extend the amount of the string that can be inputted?
Error sql — 2023-07-22 16:36:34 in v3 Support
Cool. I never had any problems with mine, not sure why, but I have some code that I changed for some reason, I cant remember why. I think the count was a problem. I can only think that because I have alot of stuff commented. I comment old code rather than remove it in case I screw it up. Again, I cant remember why I did this, But I will post it for reference to read. I will attach mine if you want to compare in case it is useful in any way
I removed this
 if (count($updateset))
    SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid");

I changed it to this at one point
 if (is_countable($updateset) && count($updateset))
    SQL_Query_exec("UPDATE torrents SET " . join(",", $updateset) . " WHERE id=$torrentid");

then researched some and fiddled around and I use this. Its seems ok I think. It just kind of covers either array or count. probably overthinking the whole thing really lol
if (is_array($updateset) || $updateset instanceof Countable) {
   $updatesCount = count($updateset);

   if ($updatesCount > 0) {
       $updatesString = join(",", $updateset);
       SQL_Query_exec("UPDATE torrents SET $updatesString WHERE id=$torrentid");
   }
}
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