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
Bump torrent to today
Controls ·  Search New posts · Mark unread

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

2021-03-31 10:38:48
Hello guys,
I have had it somewhere on my computer and my old HDD but after it crashed then all my old mods disappeared ...
Namely, it is about MOD torrent BUMP or "make torrent to today's date" as it is called.
Has anyone saved it anywhere and can please share?

Regards guys


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-03-31 16:36:35
SQL_Query_exec(“UPDATE torrents SET added = NOW() WHERE id = 1”);

??
2021-03-31 19:49:25
Yes, something about that hole, @STorrents2020 but it was like just admin can change this date in torrent list (torrent-browse) or in torrent-details.php


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-04-01 00:45:24
Simply construct a form that targets self, like method="post" action="?setnow"

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['setnow'])) {
  SQL_Query_exec(“UPDATE torrents SET added = NOW() WHERE id = $id”);
}

<form method="POST" action="?setnow">
  <input type="submit" value="Mark Today" />
</form>

--

This is incredibly simple and untested (probably very insecure). That's the idea. Place the HTML somewhere on torrents-details.php, the PHP code after $id (around top).
2021-04-01 06:04:52

//************ DO SOME "GET" STUFF BEFORE PAGE LAYOUT ***************

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

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['setnow'])) {
 SQL_Query_exec("UPDATE torrents SET added = NOW() WHERE id = $id");
}




Get me error message:

That's not a valid ID

If I move that there:

//************ DO SOME "GET" STUFF BEFORE PAGE LAYOUT ***************

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

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

if (!is_valid_id($id))
show_error_msg(T_("ERROR"), T_("THATS_NOT_A_VALID_ID"), 1);

//GET ALL MYSQL VALUES FOR THIS TORRENT
//$res = SQL_Query_exec("SELECT torrents.anon, torrents.thanks, torrents.seeders, torrents.tube, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.url, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.comments, torrents.freeleech, torrents.webseed, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id torrentgenres.name as genre_name, torrentgenres.image as genre_image FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN torrentgenres ON torrents.torrentgenres = torrentgenres.id WHERE torrents.id = $id");
$res = SQL_Query_exec("SELECT torrents.anon, torrents.thanks, torrents.seeders, torrents.tube, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.url, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.comments, torrents.freeleech, torrents.webseed, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, torrentgenres.name AS genre_name, torrentgenres.image AS genre_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN torrentgenres ON torrents.torrentgenres = torrentgenres.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id");
$row = mysql_fetch_assoc($res);

//DECIDE IF TORRENT EXISTS
if (!$row || ($row["banned"] == "yes" && $CURUSER["edit_torrents"] == "no"))
show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);

//torrent is availiable so do some stuff

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['setnow'])) {
 SQL_Query_exec("UPDATE torrents SET added = NOW() WHERE id = $id");
}



It's a same resultate


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-04-05 14:09:04
Is ?id=1 (example) present? It’s not getting the INT from the URL
2021-04-05 18:56:36
Yes, that's true
I get that link
http://my-homepage.com /torrents-details.php?setnow


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-04-05 19:20:24
http://my-homepage.com /torrents-details.php?setnow&id=1

It will look for that last part from the _GET request
2021-04-05 19:22:52
Modify the form

action=“?setnow&id=<?=isset($id)?>”
2021-04-06 07:29:56
This command get me a right link to torrent ID, but don't renew date to today

print ("<div><form method='POST' action='?setnow&id=$id'>  <input type='submit' class='btn btn-block btn-success' value='".T_("M_TODAY")."'  /> </form></div>");


https://my-homepage.com/torrents-details.php?setnow&id=81

on the top of torrent details is like this

//************ DO SOME "GET" STUFF BEFORE PAGE LAYOUT ***************

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

// sett torrent to today
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['setnow'])) {
 SQL_Query_exec("UPDATE torrents SET added = NOW() WHERE id = $id");
}
// sett torrent to today

$scrape = (int)$_GET["scrape"];
if (!is_valid_id($id))
show_error_msg(T_("ERROR"), T_("THATS_NOT_A_VALID_ID"), 1);



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-04-06 14:12:09
If you double quote any output function (echo, print, etc) you can use a variable inline without special quotes or “ . $var . “, I prefer printf(‘some text %s’, $var) for printing anything to be honest.

Try that, I do t think $id is being properly called.
2021-04-07 14:49:45
Sorry mate can't make it to work, someone who can try my torrent-details.php and improve thet there, I can send PM with file there

//Regards


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2021-04-07 14:49:59
2021-04-21 16:28:19
Hi guys, in the end I have succeeded with my wishes but only halfway (that is my opinion)
The date changes with these parameters, but as I said it was the first step which is good, the second step is that it also changes in the database itself (which was the purpose of the hack) but the third step when I go to torrents.php "updated" torrents are not visible as today's upload (on the top of torrents table).

What can they do wrong or what else do I need to fix?
Have also checked torrenttables ($ res) settings and everything looks good

Thank you so much for all the help and support you give me here


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

// sett torrent to today
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
   if (!isset($_POST['setnow'])) {
SQL_Query_exec("UPDATE torrents SET added = '".get_date_time()."' WHERE id='".$id."' ");
}
}
// sett torrent to today




       print ("<div><form method='POST' action='?setnow&id=$id'>  <input type='submit' class='btn btn-block btn-success' value='".T_("M_TODAY")."'  /> </form></div>");



www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2021-04-21 17:25:54
2021-11-21 08:25:35
not sure if you finished this but to view on torrents today edit orderby

$orderby = "ORDER BY torrents.added DESC, torrents.id DESC";
Last edited by M-jay warn on 2021-11-21 09:37:16
2021-11-22 20:41:49
You have misunderstood me mate,
I'm looking for a button that sets an older torrent to today's date in torrent-details.php and updates the sql column for the upload date


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
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