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
re seed
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Requests

2021-10-27 09:05:02
hello, can you see to add the re seed request function in the torrent_detail.php page

thank you in advance for your help  :thumb  :grin
2021-10-27 22:10:36
I thought it was already there no?
	if ($row["external"] != "yes" && $row["times_completed"] > 0) {
echo("[<a href='torrents-completed.php?id=$id'>" .T_("WHOS_COMPLETED"). "</a>] ");
if ($row["seeders"] <= 1) {
echo("[<a href='torrents-reseed.php?id=$id'>" .T_("REQUEST_A_RE_SEED"). "</a>]");
}
}

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-10-28 02:12:13
A little simplicity, and type declarations + comparison operators == its best to use this for comparison situations, = just equals its pointed value in any case.

if ($row["external"] !== "no" && intval($row["times_completed"]) > 0) {
printf('<a href="torrents-completed.php?id=%i">%s</a>', intval($id), T_("WHOS_COMPLETED"));
if ($row["seeders"] <= 1) {
printf('[<a href="torrents-reseed.php?id=%i">%s</a>]', intval($id), T_("REQUEST_A_RE_SEED"));
}
}
Last edited by STorrents2020 on 2021-10-28 02:13:38
2021-10-28 02:17:27
You could take off less routine checking overhead by simply defining times_completed == 1 (as you always expect this case).
2021-10-28 08:47:31
thank you but when we make a reseed request we don't get the link to redirect the torrent to seed in the mailbox we just get this message?

RESEED_MESSAGE





torrents-details.php

if ($row["external"] != "yes" && $row["times_completed"] > 0) {
echo("[<a href='torrents-completed.php?id=$id'>" .T_("WHOS_COMPLETED"). "</a>] ");
if ($row["seeders"] <= 1) {
echo("[<a href='torrents-reseed.php?id=$id'>" .T_("REQUEST_A_RE_SEED"). "</a>]");
}
}

?>
Last edited by niki on 2021-10-28 10:14:06
2021-10-28 10:10:21
thank you everything works fine now with the code below


torrents-reseed.php

<?php
 //
 //  TorrentTrader v2.x
 //      $LastChangedDate: 2011-11-01 00:57:44 +0000 (Tue, 01 Nov 2011) $
 //      $LastChangedBy: dj-howarth1 $
 //
 //      http://www.torrenttrader.org
 //
 //
 
 require_once("backend/functions.php");
 dbconn();
 loggedinonly();
 
 if ($CURUSER["view_torrents"] == "no")
     show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);

 $id = (int) $_GET["id"];
 
 if (isset($_COOKIE["reseed$id"]))
     show_error_msg(T_("ERROR"), "Vous avez recemment fait une demande pour cette semence, veuillez attendre plus longtemps pour une autre demande..", 1);
     
 $res = SQL_Query_exec("SELECT `owner`, `banned`, `external` FROM `torrents` WHERE `id` = $id");
 $row = mysqli_fetch_assoc($res);
 
 if (!$row || $row["banned"] == "yes" || $row["external"] == "yes")
      show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);  
 
 $res2 = SQL_Query_exec("SELECT users.id FROM completed LEFT JOIN users ON completed.userid = users.id WHERE users.enabled = 'yes' AND users.status = 'confirmed' AND completed.torrentid = $id");

 $message = $CURUSER['username'] . " Pouvez vous remettre en seed le torrent ci-dessous pour le partager svp,... car il n'y a actuellement pas ou peu de Seeder, merci d'avance pour votre partage pour ce torrent::\n\n" . $site_config["SITEURL"] . "/torrents-details.php?id=$id \n Thank You!";
 
 while ( $row2 = mysqli_fetch_assoc($res2) )
 {
     SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row2['id']."', '".get_date_time()."', ".sqlesc($message).")");
 }
 
 if ($row["owner"] && $row["owner"] != $CURUSER["id"])
     SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row['owner']."', '".get_date_time()."', ".sqlesc($message).")");
     
 setcookie("reseed$id", $id, time() + 86400, '/');
 
 show_error_msg("Complete", "Votre demande de reseed est envoyée.", 1);
 
?>

2021-10-29 21:23:36
Can you say what you changed so that others may know as well :)
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-10-30 13:40:39
Hello MicroMonkey and yes I give you the code with explanation


create torrents-reseed.php file with the code below
torrents-reseed.php:


<?php
//
//  TorrentTrader v2.x
//      $LastChangedDate: 2011-11-01 00:57:44 +0000 (Tue, 01 Nov 2011) $
//      $LastChangedBy: dj-howarth1 $
//
//      http://www.torrenttrader.org
//
//

require_once("backend/functions.php");
dbconn();
loggedinonly();

if ($CURUSER["view_torrents"] == "no")
    show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);

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

if (isset($_COOKIE["reseed$id"]))
    show_error_msg(T_("ERROR"), "You have recently made a request for this seed, please wait longer for another request..", 1);
   
$res = SQL_Query_exec("SELECT `owner`, `banned`, `external` FROM `torrents` WHERE `id` = $id");
$row = mysqli_fetch_assoc($res);

if (!$row || $row["banned"] == "yes" || $row["external"] == "yes")
     show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);  

$res2 = SQL_Query_exec("SELECT users.id FROM completed LEFT JOIN users ON completed.userid = users.id WHERE users.enabled = 'yes' AND users.status = 'confirmed' AND completed.torrentid = $id");

$message = $CURUSER['username'] . " Can you seed the torrent below to share it please,... because there is currently no or few Seeder, thank you in advance for your sharing for this torrent::\n\n" . $site_config["SITEURL"] . "/torrents-details.php?id=$id \n Thank You!";

while ( $row2 = mysqli_fetch_assoc($res2) )
{
    SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row2['id']."', '".get_date_time()."', ".sqlesc($message).")");
}

if ($row["owner"] && $row["owner"] != $CURUSER["id"])
    SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row['owner']."', '".get_date_time()."', ".sqlesc($message).")");
   
setcookie("reseed$id", $id, time() + 86400, '/');

show_error_msg("Complete", "Your reseed request is sent.", 1);

?>



open torrent_detail.php and search for:

begin_frame(T_("TORRENT_DETAILS_FOR"). " \"" . $shortname . "\"");

echo "<div align='right'>[<a href='report.php?torrent=$id'><b>" .T_("REPORT_TORRENT"). "</b></a>] ";
if ($owned)
echo "[<a href='torrents-edit.php?id=$row[id]&returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'><b>".T_("EDIT_TORRENT")."</b></a>]<br>";



below add:

echo "<div align='right'>[<a href='torrents-reseed.php?id=$id'><b><font color='#FC5F52'>Seed discount request for this torrent</font></b></a>]<br> ";




it works well and you can put it or transfer it to the finished v3 mods  :thumb




 
Last edited by niki on 2021-10-30 13:41:52
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728